mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-15 04:38:00 +00:00
Start work for getting filter to work while noise is playing
This commit is contained in:
@@ -100,7 +100,7 @@
|
||||
v-model="isFilterEnabled"
|
||||
label="Enabled"
|
||||
class="mb-5"
|
||||
:disabled="startDisabled"
|
||||
@change="updateFilter"
|
||||
/>
|
||||
</v-row>
|
||||
</v-col>
|
||||
@@ -112,7 +112,6 @@
|
||||
:items="filterTypeOptions"
|
||||
label="Filter Type"
|
||||
class="mx-3"
|
||||
:disabled="!isFilterEnabled || startDisabled"
|
||||
/>
|
||||
|
||||
<v-slider
|
||||
@@ -120,7 +119,6 @@
|
||||
label="Frequency Cutoff (Hz)"
|
||||
thumb-label="always"
|
||||
:thumb-size="40"
|
||||
:disabled="!isFilterEnabled || startDisabled"
|
||||
max="20000"
|
||||
min="0"
|
||||
class="mx-3"
|
||||
|
||||
@@ -26,6 +26,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
playNoise () {
|
||||
console.log('frequencyCutoff: ', this.frequencyCutoff)
|
||||
this.startDisabled = true
|
||||
Transport.cancel()
|
||||
|
||||
@@ -55,6 +56,9 @@ export default {
|
||||
|
||||
clearInterval(this.timeRemainingInterval)
|
||||
this.timeRemaining = 0
|
||||
|
||||
this.noise = new Noise()
|
||||
this.filter = new Filter()
|
||||
},
|
||||
startTimer () {
|
||||
this.timeRemaining -= 1
|
||||
@@ -64,6 +68,16 @@ export default {
|
||||
},
|
||||
updateNoiseColor () {
|
||||
this.noise.type = this.noiseColor
|
||||
},
|
||||
updateFilter () {
|
||||
console.log('change')
|
||||
if (this.isFilterEnabled) {
|
||||
this.filter = new Filter(this.frequencyCutoff, this.filterType).toDestination()
|
||||
this.noise.connect(this.filter)
|
||||
} else {
|
||||
this.noise.disconnect(this.filter)
|
||||
this.noise.toDestination()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ const router = new VueRouter({
|
||||
})
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (to.name === 'Home') {
|
||||
if (to.name === 'TMP_Home') {
|
||||
instance.get('/auth')
|
||||
.then(response => {
|
||||
if (response.status === 200) {
|
||||
|
||||
Reference in New Issue
Block a user