[gnome-music/wip/mschraal/core: 77/86] player: Speed up current_song
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/core: 77/86] player: Speed up current_song
- Date: Fri, 7 Jun 2019 15:33:39 +0000 (UTC)
commit 3015be9618ba87abee20467dc4e8ddc0d6c92d0e
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]