[gnome-music] Move UI update from 'about-to-finish' to 'state-changed'
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] Move UI update from 'about-to-finish' to 'state-changed'
- Date: Thu, 16 May 2013 14:54:19 +0000 (UTC)
commit 853377e685c646e192977da00294ef518cc2de53
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date: Thu May 16 16:54:12 2013 +0200
Move UI update from 'about-to-finish' to 'state-changed'
src/player.js | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/player.js b/src/player.js
index 3843a57..552eaa6 100644
--- a/src/player.js
+++ b/src/player.js
@@ -61,6 +61,12 @@ const Player = new Lang.Class({
this.player = Gst.ElementFactory.make("playbin", "player");
this.bus = this.player.get_bus();
this.bus.add_signal_watch();
+
+ this.bus.connect("message::state-changed", Lang.bind(this, function(bus, message) {
+ if (message.parse_state_changed()[1] == Gst.State.NULL){
+ this.loadNextTrack();
+ }
+ }));
this.bus.connect("message::error", Lang.bind(this, function(bus, message) {
let uri;
if (this.playlist[this.currentTrack])
@@ -90,7 +96,6 @@ const Player = new Lang.Class({
this.player.connect("about-to-finish", Lang.bind(this, function(player) {
if(player.nextUrl != null) {
player.set_property('uri', player.nextUrl);
- GLib.idle_add(GLib.PRIORITY_HIGH, Lang.bind(this, this.loadNextTrack));
}
return true;
}));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]