added shortcuts for play, volume and restore

This commit is contained in:
Eliot Berriot 2017-12-11 21:09:17 +01:00
parent ee1449bdd0
commit 03f15ada4e
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
4 changed files with 25 additions and 3 deletions

View file

@ -86,6 +86,8 @@ class Queue {
cache.remove('queue')
}
setVolume (newValue) {
newValue = Math.min(newValue, 1)
newValue = Math.max(newValue, 0)
this.state.volume = newValue
if (this.audio.setVolume) {
this.audio.setVolume(newValue)
@ -94,7 +96,9 @@ class Queue {
}
cache.set('volume', newValue)
}
incrementVolume (value) {
this.setVolume(this.state.volume + value)
}
reorder (oldIndex, newIndex) {
// called when the user uses drag / drop to reorder
// tracks in queue