[gnome-music/wip/jfelder/smoothscale-player: 6/8] smoothscale: Do not interact with GstPlayer
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/smoothscale-player: 6/8] smoothscale: Do not interact with GstPlayer
- Date: Wed, 10 Oct 2018 07:23:12 +0000 (UTC)
commit 18602204acc2037be109c4d079a8cd5c0e21d746
Author: Jean Felder <jfelder src gnome org>
Date: Thu Sep 27 09:00:05 2018 +0200
smoothscale: Do not interact with GstPlayer
gnomemusic/player.py | 6 ------
gnomemusic/widgets/playertoolbar.py | 2 +-
gnomemusic/widgets/smoothscale.py | 13 ++++++-------
3 files changed, 7 insertions(+), 14 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 0296ca63..b4a4042b 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -805,12 +805,6 @@ class Player(GObject.GObject):
"""
return self._playlist.props.playlist_id
- # MPRIS
- @log
- def get_gst_player(self):
- """GstPlayer getter"""
- return self._player
-
@log
def get_position(self):
return self._player.position
diff --git a/gnomemusic/widgets/playertoolbar.py b/gnomemusic/widgets/playertoolbar.py
index d764802f..2d75e5bb 100644
--- a/gnomemusic/widgets/playertoolbar.py
+++ b/gnomemusic/widgets/playertoolbar.py
@@ -71,7 +71,7 @@ class PlayerToolbar(Gtk.ActionBar):
self._main_window = main_window
self._player = player
- self._progress_scale.player = self._player.get_gst_player()
+ self._progress_scale.player = self._player
self._cover_stack.props.size = Art.Size.XSMALL
self._cover_stack.connect('updated', self._on_cover_stack_updated)
diff --git a/gnomemusic/widgets/smoothscale.py b/gnomemusic/widgets/smoothscale.py
index b9d6cb30..b8eabbed 100644
--- a/gnomemusic/widgets/smoothscale.py
+++ b/gnomemusic/widgets/smoothscale.py
@@ -37,7 +37,6 @@ class SmoothScale(Gtk.Scale):
The progressbar Gtk.Scale, extended with smoothing capabilities, so
the indicator updates every pixel available.
- This class interacts directly with the GstPlayer class.
"""
__gtype_name__ = 'SmoothScale'
@@ -71,18 +70,18 @@ class SmoothScale(Gtk.Scale):
# object via init when using Gtk.Builder.
@GObject.Property
def player(self):
- """The GstPlayer object used
+ """The Player object used
:return: player object
- :rtype: GstPlayer
+ :rtype: Player
"""
return self._player
@player.setter
def player(self, player):
- """Set the GstPlayer object used
+ """Set the Player object used
- :param GstPlayer player: The GstPlayer to use
+ :param Player player: The Player to use
"""
if (player is None
or (self._player is not None
@@ -207,13 +206,13 @@ class SmoothScale(Gtk.Scale):
@log
def _on_smooth_scale_change_value(self, scroll):
seconds = scroll.get_value() / 60
- self._player.seek(seconds)
+ self._player.set_position(seconds)
return True
@log
def _update_position_callback(self):
- position = self._player.position
+ position = self._player.get_position()
if position > 0:
self.set_value(position * 60)
self._update_timeout()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]