mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user