[gnome-music/wip/mschraal/core: 82/92] player: Speed up current_song
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/core: 82/92] player: Speed up current_song
- Date: Mon, 17 Jun 2019 22:53:50 +0000 (UTC)
commit 582d5ef5e1de1615c61a645e2d2aa3c0519cd7e2
Author: Marinus Schraal <mschraal gnome org>
Date: Wed Jun 5 12:00:21 2019 +0200
player: Speed up current_song
gnomemusic/player.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 58261ee8..ce6653fa 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -441,8 +441,15 @@ class PlayerPlaylist(GObject.GObject):
:returns: the song being played or None if there are no songs
:rtype: Grl.Media
"""
- for coresong in self._model:
+ if self._model.get_n_items() != 0:
+ current_song = self._model[self._current_index]
+ if current_song.props.state == SongWidget.State.PLAYING:
+ return current_song.props.media
+
+ for idx, coresong in enumerate(self._model):
if coresong.props.state == SongWidget.State.PLAYING:
+ print("position", idx)
+ self._current_index = idx
return coresong.props.media
return None
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]