private string transfer_mode = null;
+ private bool uri_update_hint = false;
private string? _uri = null;
public string? uri {
owned get {
if (value != "") {
switch (this._playback_state) {
case "NO_MEDIA_PRESENT":
+ this.playbin.set_state (State.READY);
this._playback_state = "STOPPED";
this.notify_property ("playback-state");
break;
case "STOPPED":
+ this.playbin.set_state (State.READY);
+ break;
case "PAUSED_PLAYBACK":
+ this.playbin.set_state (State.PAUSED);
break;
case "PLAYING":
this.playbin.set_state (State.PLAYING);
this.playbin.auto_flush_bus = false;
assert (this.playbin != null);
- playbin.source_setup.connect (this.on_source_setup);
+ this.playbin.source_setup.connect (this.on_source_setup);
+ this.playbin.notify["uri"].connect (this.on_uri_notify);
// Bus handler
var bus = this.playbin.get_bus ();
out pending);
if (old_state == State.READY && new_state == State.PAUSED) {
this.notify_property ("duration");
+ if (this.uri_update_hint) {
+ this.uri_update_hint = false;
+ string uri = this.playbin.uri;
+ if (this._uri != uri) {
+ // uri changed externally
+ this._uri = this.playbin.uri;
+ this.notify_property("uri");
+ }
+ }
}
debug ("%d %d %d", old_state, new_state, pending);
source.extra_headers = structure;
}
}
+
+ private void on_uri_notify (ParamSpec pspec) {
+ this.uri_update_hint = true;
+ }
}
/*
* Copyright (C) 2008 OpenedHand Ltd.
* Copyright (C) 2009,2010 Nokia Corporation.
+ * Copyright (C) 2012 Openismus GmbH.
*
* Author: Jorn Baayen <jorn@openedhand.com>
* Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
* <zeeshan.ali@nokia.com>
+ * Jens Georg <jensg@openismus.com>
*
* Rygel is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
set {
this.player.uri = value;
-
- this.changelog.log ("CurrentTrackURI", this.uri);
- this.changelog.log ("AVTransportURI", this.uri);
}
}
this.player.notify["playback-state"].connect (this.notify_state_cb);
this.player.notify["duration"].connect (this.notify_duration_cb);
+ this.player.notify["uri"].connect (this.notify_uri_cb);
this.session = new SessionAsync ();
}
this.changelog.log ("CurrentMediaDuration",
this.player.duration_as_str);
}
+
+ private void notify_uri_cb (Object player, ParamSpec p) {
+ this.changelog.log ("CurrentTrackURI", this.uri);
+ this.changelog.log ("AVTransportURI", this.uri);
+ }
}