forked from external-repos/noisedash
Add duration setting
This commit is contained in:
15202
package-lock.json
generated
15202
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
40
src/App.vue
40
src/App.vue
@@ -1,58 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-app>
|
<v-app>
|
||||||
<v-app-bar
|
|
||||||
app
|
|
||||||
color="primary"
|
|
||||||
dark
|
|
||||||
>
|
|
||||||
<div class="d-flex align-center">
|
|
||||||
<v-img
|
|
||||||
alt="Vuetify Logo"
|
|
||||||
class="shrink mr-2"
|
|
||||||
contain
|
|
||||||
src="https://cdn.vuetifyjs.com/images/logos/vuetify-logo-dark.png"
|
|
||||||
transition="scale-transition"
|
|
||||||
width="40"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<v-img
|
|
||||||
alt="Vuetify Name"
|
|
||||||
class="shrink mt-1 hidden-sm-and-down"
|
|
||||||
contain
|
|
||||||
min-width="100"
|
|
||||||
src="https://cdn.vuetifyjs.com/images/logos/vuetify-name-dark.png"
|
|
||||||
width="100"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<v-spacer />
|
|
||||||
|
|
||||||
<v-btn
|
|
||||||
href="https://github.com/vuetifyjs/vuetify/releases/latest"
|
|
||||||
target="_blank"
|
|
||||||
text
|
|
||||||
>
|
|
||||||
<span class="mr-2">Latest Release</span>
|
|
||||||
<v-icon>mdi-open-in-new</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</v-app-bar>
|
|
||||||
|
|
||||||
<v-main>
|
<v-main>
|
||||||
<HelloWorld />
|
|
||||||
<Noise />
|
<Noise />
|
||||||
</v-main>
|
</v-main>
|
||||||
</v-app>
|
</v-app>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import HelloWorld from './components/HelloWorld';
|
|
||||||
import Noise from './components/Noise';
|
import Noise from './components/Noise';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
HelloWorld,
|
|
||||||
Noise,
|
Noise,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-container>
|
<v-container>
|
||||||
<v-row class="text-center">
|
<v-row class="text-center">
|
||||||
|
<v-col cols="12">
|
||||||
|
<v-img
|
||||||
|
:src="require('../assets/logo.svg')"
|
||||||
|
class="my-3"
|
||||||
|
contain
|
||||||
|
height="200"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col class="mb-4">
|
||||||
|
<h1 class="display-2 font-weight-bold mb-3">
|
||||||
|
Welcome to Noisedash
|
||||||
|
</h1>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-btn
|
<v-btn
|
||||||
:disabled="isDisabled"
|
:disabled="isDisabled"
|
||||||
@@ -9,6 +24,7 @@
|
|||||||
Start
|
Start
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-btn
|
<v-btn
|
||||||
@click="handleStop"
|
@click="handleStop"
|
||||||
@@ -16,6 +32,13 @@
|
|||||||
Stop
|
Stop
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12">
|
||||||
|
<v-text-field
|
||||||
|
v-model="seconds"
|
||||||
|
label="Seconds"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-container>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
@@ -27,18 +50,19 @@
|
|||||||
name: 'Noise',
|
name: 'Noise',
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
isDisabled: false
|
isDisabled: false,
|
||||||
|
seconds: 4
|
||||||
}),
|
}),
|
||||||
created() {
|
created() {
|
||||||
this.noise = new Noise({volume: -10, type: "brown"}).toDestination()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleStart() {
|
handleStart() {
|
||||||
this.isDisabled = true
|
this.isDisabled = true
|
||||||
Transport.scheduleOnce((time) => {
|
Transport.cancel()
|
||||||
this.noise.start(time).stop(time + 2)
|
this.noise = new Noise({volume: -10, type: "brown"}).toDestination()
|
||||||
})
|
this.noise.sync().start(0).stop(this.seconds)
|
||||||
Transport.start()
|
Transport.start()
|
||||||
|
Transport.loopEnd = this.seconds
|
||||||
},
|
},
|
||||||
handleStop() {
|
handleStop() {
|
||||||
Transport.stop()
|
Transport.stop()
|
||||||
|
|||||||
Reference in New Issue
Block a user