API: operate on cubic volume scale

Instead converting volume inside GJS, simplify things by making API operate on cubic volume scale.
This commit is contained in:
Rafał Dzięgiel
2021-02-24 08:42:27 +01:00
parent 6130ffa6c0
commit 86d365872a
5 changed files with 33 additions and 45 deletions

5
src/controls.js vendored
View File

@@ -489,7 +489,7 @@ class ClapperControls extends Gtk.Box
const initialVolume = (settings.get_string('volume-initial') === 'custom')
? settings.get_int('volume-value') / 100
: Misc.getCubicValue(settings.get_double('volume-last'));
: settings.get_double('volume-last');
this.volumeScale.set_value(initialVolume);
}
@@ -567,10 +567,9 @@ class ClapperControls extends Gtk.Box
_onVolumeScaleValueChanged(scale)
{
const volume = scale.get_value();
const linearVolume = Misc.getLinearValue(volume);
const { player } = this.get_ancestor(Gtk.Grid);
player.set_volume(linearVolume);
player.set_volume(volume);
/* FIXME: All of below should be placed in 'volume-changed'
* event once we move to message bus API */