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

View File

@@ -530,7 +530,7 @@ class ClapperWidget extends Gtk.Grid
_onPlayerVolumeChanged(player)
{
const volume = player.get_volume();
const volume = player.volume;
/* FIXME: This check should not be needed, GstPlayer should not
* emit 'volume-changed' with the same values, but it does. */
@@ -540,8 +540,7 @@ class ClapperWidget extends Gtk.Grid
/* Once above is fixed in GstPlayer, remove this var too */
this.controls.currentVolume = volume;
const cubicVolume = Misc.getCubicValue(volume);
this.controls._updateVolumeButtonIcon(cubicVolume);
this.controls._updateVolumeButtonIcon(volume);
}
_onStateNotify(toplevel)