mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 16:31:58 +02:00
Tweak position and volume slider values
This commit is contained in:
@@ -83,13 +83,12 @@ class ClapperInterface extends Gtk.Grid
|
|||||||
if(this.controls.isPositionSeeking)
|
if(this.controls.isPositionSeeking)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let positionSeconds = position / 1000000000;
|
let positionSeconds = Math.round(position / 1000000000);
|
||||||
let positionFloor = Math.floor(positionSeconds);
|
|
||||||
|
|
||||||
if(positionFloor === this.lastPositionValue)
|
if(positionSeconds === this.lastPositionValue)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.lastPositionValue = positionFloor;
|
this.lastPositionValue = positionSeconds;
|
||||||
this.controls.positionScale.set_value(positionSeconds);
|
this.controls.positionScale.set_value(positionSeconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,6 +99,7 @@ class ClapperInterface extends Gtk.Grid
|
|||||||
if(volume === this.lastVolumeValue)
|
if(volume === this.lastVolumeValue)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
this.lastVolumeValue = volume;
|
||||||
this.controls.volumeButton.set_value(volume);
|
this.controls.volumeButton.set_value(volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,21 +121,21 @@ class ClapperInterface extends Gtk.Grid
|
|||||||
if(this.seekOnDrop && this.controls.isPositionSeeking)
|
if(this.seekOnDrop && this.controls.isPositionSeeking)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let position = Math.floor(positionScale.get_value());
|
let positionSeconds = Math.round(positionScale.get_value());
|
||||||
|
|
||||||
if(position === this.lastPositionValue)
|
if(positionSeconds === this.lastPositionValue)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.lastPositionValue = position;
|
this.lastPositionValue = positionSeconds;
|
||||||
this._player.seek_seconds(position);
|
this._player.seek_seconds(positionSeconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onControlsVolumeChanged(widget, value)
|
_onControlsVolumeChanged(widget, volume)
|
||||||
{
|
{
|
||||||
if(value === this.lastVolumeValue)
|
if(volume === this.lastVolumeValue)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.lastVolumeValue = value;
|
this.lastVolumeValue = volume;
|
||||||
this._player.set_volume(value);
|
this._player.set_volume(volume);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user