aboutsummaryrefslogtreecommitdiff
path: root/src/mpris2-controller.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-12-17 12:48:03 +0000
committerConor Curran <conor.curran@canonical.com>2010-12-17 12:48:03 +0000
commit032797fd7a92bc8a4fd979ddc12cacb0918ca73b (patch)
treed4fd4c0600312500c6b620a092148634fce676c2 /src/mpris2-controller.vala
parent93190886959bfa16b835794a4a12a9a945e7777e (diff)
downloadayatana-indicator-sound-032797fd7a92bc8a4fd979ddc12cacb0918ca73b.tar.gz
ayatana-indicator-sound-032797fd7a92bc8a4fd979ddc12cacb0918ca73b.tar.bz2
ayatana-indicator-sound-032797fd7a92bc8a4fd979ddc12cacb0918ca73b.zip
proved active-playlist prop use-case
Diffstat (limited to 'src/mpris2-controller.vala')
-rw-r--r--src/mpris2-controller.vala26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala
index 94e82d5..d6f27ec 100644
--- a/src/mpris2-controller.vala
+++ b/src/mpris2-controller.vala
@@ -18,9 +18,8 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Dbusmenu;
-
[DBus (name = "org.freedesktop.DBus.Properties")]
- public interface FreeDesktopProperties : Object{
+public interface FreeDesktopProperties : Object{
public signal void PropertiesChanged (string source, HashTable<string, Variant?> changed_properties,
string[] invalid );
}
@@ -91,6 +90,11 @@ public class Mpris2Controller : GLib.Object
metadata.property_set_bool ( MENUITEM_PROP_VISIBLE,
metadata.populated(MetadataMenuitem.attributes_format()));
}
+ Variant? playlist_v = changed_properties.lookup("ActivePlaylist");
+ if ( playlist_v != null ){
+ debug (" WE HAVE PLAYLIST CHANGE EVENT DETECTED ");
+ this.fetch_active_playlist();
+ }
}
private GLib.HashTable<string, Variant?>? clean_metadata()
@@ -131,7 +135,7 @@ public class Mpris2Controller : GLib.Object
GLib.HashTable<string, Value?>? cleaned_metadata = this.clean_metadata();
this.owner.custom_items[PlayerController.widget_order.METADATA].update(cleaned_metadata,
MetadataMenuitem.attributes_format());
- this.fetch_playlists();
+ this.fetch_playlists();
}
public void transport_update(TransportMenuitem.action command)
@@ -169,6 +173,22 @@ public class Mpris2Controller : GLib.Object
}
}
+ public void fetch_active_playlist()
+ {
+ if (this.playlists == null && this.playlists.ActivePlaylist.valid == true){
+ warning("Playlists object is null and we have an active playlist");
+ return;
+ }
+
+ PlaylistDetails active_details = this.playlists.ActivePlaylist.active_playlist;
+ debug(" \n \n ");
+ debug( "Active Playlist Name = %s", active_details.name);
+ debug( "Active Playlist path = %s", active_details.path);
+ debug( "Active Playlist icon path = %s", active_details.icon_path);
+ debug(" \n \n ");
+ }
+
+
public bool connected()
{
return (this.player != null && this.mpris2_root != null);