click volume button to mute and unclick to go back to lastVolume

This commit is contained in:
Jason Chen 2022-01-19 19:19:47 -08:00
parent 7bc77b2b1d
commit c36b47bd93
5 changed files with 50 additions and 5 deletions

View file

@ -517,8 +517,17 @@ const app = new Vue({
}
}
MusicKitInterop.init()
// Set the volume
this.mk.volume = this.cfg.audio.volume
// Set the volume
// Check the value of this.cfg.audio.muted
if( !this.cfg.audio.muted )
{
// Set the mk.volume to the last stored volume data
this.mk.volume = this.cfg.audio.volume
} else if( this.cfg.audio.muted ) {
// Set mk.volume to -1 (setting to 0 wont work, so temp solution setting to -1)
this.mk.volume = -1;
}
// ipcRenderer.invoke('getStoreValue', 'audio.volume').then((value) => {
// self.mk.volume = value
// })
@ -2984,6 +2993,17 @@ const app = new Vue({
}
}
},
muteButtonPressed() {
if( this.cfg.audio.muted ) {
this.mk.volume = this.cfg.audio.lastVolume;
this.cfg.audio.muted = false;
} else {
this.cfg.audio.lastVolume = this.cfg.audio.volume;
this.mk.volume = 0;
this.cfg.audio.muted = true;
}
},
async apiCall(url, callback) {
const xmlHttp = new XMLHttpRequest();