Configurable scroll wheel volume logic
This commit is contained in:
parent
e220cfb7bc
commit
992887eecf
2 changed files with 13 additions and 5 deletions
|
@ -32,6 +32,9 @@ export class ConfigStore {
|
||||||
"normalization": false,
|
"normalization": false,
|
||||||
"spatial": false,
|
"spatial": false,
|
||||||
"maxVolume": 1,
|
"maxVolume": 1,
|
||||||
|
"volumePrecision": 0.1,
|
||||||
|
"volumeRoundMax": 0.9,
|
||||||
|
"volumeRoundMin": 0.1,
|
||||||
"spatial_properties": {
|
"spatial_properties": {
|
||||||
"presets": [],
|
"presets": [],
|
||||||
"gain": 0.8,
|
"gain": 0.8,
|
||||||
|
|
|
@ -3079,18 +3079,23 @@ const app = new Vue({
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
volumeWheel(event) {
|
volumeWheel(event) {
|
||||||
|
if (this.cfg.audio.maxVolume < 1.0 && this.cfg.audio.maxVolume > 0.01) {
|
||||||
|
this.cfg.audio.volumePrecision = 0.01
|
||||||
|
this.cfg.audio.volumeRoundMax = this.cfg.audio.maxVolume - 0.01
|
||||||
|
this.cfg.audio.volumeRoundMin = 0.01
|
||||||
|
}
|
||||||
if (event.deltaY < 0) {
|
if (event.deltaY < 0) {
|
||||||
if (this.mk.volume < 1) {
|
if (this.mk.volume < this.cfg.audio.maxVolume) {
|
||||||
if (this.mk.volume <= 0.9) {
|
if (this.mk.volume <= this.cfg.audio.volumeRoundMax) {
|
||||||
this.mk.volume += 0.1
|
this.mk.volume += this.cfg.audio.volumePrecision
|
||||||
} else {
|
} else {
|
||||||
this.mk.volume = this.cfg.audio.maxVolume
|
this.mk.volume = this.cfg.audio.maxVolume
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (event.deltaY > 0) {
|
} else if (event.deltaY > 0) {
|
||||||
if (this.mk.volume > 0) {
|
if (this.mk.volume > 0) {
|
||||||
if (this.mk.volume >= 0.1) {
|
if (this.mk.volume >= this.cfg.audio.volumeRoundMin) {
|
||||||
this.mk.volume -= 0.1
|
this.mk.volume -= this.cfg.audio.volumePrecision
|
||||||
} else {
|
} else {
|
||||||
this.mk.volume = 0
|
this.mk.volume = 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue