aboutsummaryrefslogtreecommitdiff
path: root/src/mpris2-controller.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-02-09 10:56:49 +0000
committerConor Curran <conor.curran@canonical.com>2011-02-09 10:56:49 +0000
commit17f01f35c7b474f4286dd55b129fcf72075760dc (patch)
treef2db8f02e93be83e26fbd54db79935e93bec019d /src/mpris2-controller.vala
parent800023f7ab5854c19bdaf426ba86d24feea014ec (diff)
downloadayatana-indicator-sound-17f01f35c7b474f4286dd55b129fcf72075760dc.tar.gz
ayatana-indicator-sound-17f01f35c7b474f4286dd55b129fcf72075760dc.tar.bz2
ayatana-indicator-sound-17f01f35c7b474f4286dd55b129fcf72075760dc.zip
fixed racey active playlist property and commented some debugs
Diffstat (limited to 'src/mpris2-controller.vala')
-rw-r--r--src/mpris2-controller.vala19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala
index 444bdf6..3e06487 100644
--- a/src/mpris2-controller.vala
+++ b/src/mpris2-controller.vala
@@ -64,7 +64,7 @@ public class Mpris2Controller : GLib.Object
HashTable<string, Variant?> changed_properties,
string[] invalid )
{
- debug("properties-changed for interface %s and owner %s", interface_source, this.owner.dbus_name);
+ //debug("properties-changed for interface %s and owner %s", interface_source, this.owner.dbus_name);
if ( changed_properties == null ||
interface_source.has_prefix ( MPRIS_PREFIX ) == false ){
warning("Property-changed hash is null or this is an interface that doesn't concerns us");
@@ -92,7 +92,9 @@ public class Mpris2Controller : GLib.Object
}
Variant? playlist_v = changed_properties.lookup("ActivePlaylist");
if ( playlist_v != null && this.owner.use_playlists == true ){
- this.fetch_active_playlist();
+ // Once again GDBus race condition, the property_changed signal is sent
+ // before the value is set on the respective property.
+ Timeout.add (300, this.fetch_active_playlist);
}
Variant? playlist_count_v = changed_properties.lookup("PlaylistCount");
if ( playlist_count_v != null && this.owner.use_playlists == true ){
@@ -112,7 +114,7 @@ public class Mpris2Controller : GLib.Object
}
private bool ensure_correct_playback_status(){
- debug("TEST playback status = %s", this.player.PlaybackStatus);
+ //debug("TEST playback status = %s", this.player.PlaybackStatus);
TransportMenuitem.state p = (TransportMenuitem.state)this.determine_play_state(this.player.PlaybackStatus);
(this.owner.custom_items[PlayerController.widget_order.TRANSPORT] as TransportMenuitem).change_play_state(p);
return false;
@@ -174,7 +176,7 @@ public class Mpris2Controller : GLib.Object
public void transport_update(TransportMenuitem.action command)
{
- debug("transport_event input = %i", (int)command);
+ //debug("transport_event input = %i", (int)command);
if(command == TransportMenuitem.action.PLAY_PAUSE){
this.player.PlayPause.begin();
}
@@ -219,7 +221,7 @@ public class Mpris2Controller : GLib.Object
}
if( current_playlists != null ){
- debug( "Size of the playlist array = %i", current_playlists.length );
+ //debug( "Size of the playlist array = %i", current_playlists.length );
PlaylistsMenuitem playlists_item = this.owner.custom_items[PlayerController.widget_order.PLAYLISTS] as PlaylistsMenuitem;
playlists_item.update(current_playlists);
}
@@ -229,13 +231,14 @@ public class Mpris2Controller : GLib.Object
}
}
- private void fetch_active_playlist()
+ private bool fetch_active_playlist()
{
if (this.playlists.ActivePlaylist.valid == false){
- debug("We don't have an active playlist");
- }
+ debug(" We don't have an active playlist");
+ }
PlaylistsMenuitem playlists_item = this.owner.custom_items[PlayerController.widget_order.PLAYLISTS] as PlaylistsMenuitem;
playlists_item.update_active_playlist ( this.playlists.ActivePlaylist.details );
+ return false;
}
public void activate_playlist (ObjectPath path)