Use cubic scale for volume. Fixes #21

Volume sliders should usually adjust volume using cubic scale. This also changes max volume to 150% which should be louder than previous value anyway.
This commit is contained in:
Rafostar
2020-11-30 09:26:27 +01:00
parent bc5aa45a8f
commit e7ad0143a5
4 changed files with 67 additions and 34 deletions

View File

@@ -28,6 +28,8 @@ class ClapperPlayer extends PlayerBase
this.posY = 0;
this.keyPressCount = 0;
this._maxVolume = Misc.getLinearValue(Misc.maxVolume);
this._playlist = [];
this._trackId = 0;
@@ -193,10 +195,11 @@ class ClapperPlayer extends PlayerBase
{
if(volume < 0)
volume = 0;
else if(volume > 2)
volume = 2;
else if(volume > this._maxVolume)
volume = this._maxVolume;
super.set_volume(volume);
debug(`set player volume: ${volume}`);
}
adjust_position(isIncrease)