aboutsummaryrefslogtreecommitdiff
path: root/src/metadata-menu-item.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-06-17 18:06:54 +0100
committerConor Curran <conor.curran@canonical.com>2010-06-17 18:06:54 +0100
commit007d3af477529ac3d4f645001815a73788e70fbe (patch)
tree334ca7ed1c9594566de5537ffa5994ba2d4b3a73 /src/metadata-menu-item.vala
parentbe955e01aa7792932d4b33e9419db48247f87756 (diff)
parent5f7e8583de28afb9424666bbf9652b9774cf9499 (diff)
downloadayatana-indicator-sound-007d3af477529ac3d4f645001815a73788e70fbe.tar.gz
ayatana-indicator-sound-007d3af477529ac3d4f645001815a73788e70fbe.tar.bz2
ayatana-indicator-sound-007d3af477529ac3d4f645001815a73788e70fbe.zip
merge with the mpris branch
Diffstat (limited to 'src/metadata-menu-item.vala')
-rw-r--r--src/metadata-menu-item.vala23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/metadata-menu-item.vala b/src/metadata-menu-item.vala
index ef72143..82926b1 100644
--- a/src/metadata-menu-item.vala
+++ b/src/metadata-menu-item.vala
@@ -13,15 +13,26 @@ public class MetadataMenuitem : Dbusmenu.Menuitem
public MetadataMenuitem()
{
this.property_set(MENUITEM_PROP_TYPE, DBUSMENU_METADATA_MENUITEM_TYPE);
- this.property_set(DBUSMENU_METADATA_MENUITEM_TEXT_ARTIST, "Sonnamble");
- this.property_set(DBUSMENU_METADATA_MENUITEM_TEXT_PIECE, "Nocturne");
- this.property_set(DBUSMENU_METADATA_MENUITEM_TEXT_CONTAINER, "Seven Months in E minor");
- this.property_set(DBUSMENU_METADATA_MENUITEM_IMAGE_PATH, "/home/ronoc/Desktop/Sonnamble/Sonnamble_CD.jpg");
-
- debug("image_path property set %s:", this.property_get(DBUSMENU_METADATA_MENUITEM_IMAGE_PATH));
+ }
+ public void update(HashMap<string, string> data)
+ {
+ this.property_set(DBUSMENU_METADATA_MENUITEM_TEXT_ARTIST, data.get("artist").strip());
+ this.property_set(DBUSMENU_METADATA_MENUITEM_TEXT_PIECE, data.get("title").strip());
+ this.property_set(DBUSMENU_METADATA_MENUITEM_TEXT_CONTAINER, data.get("album").strip());
+ this.property_set(DBUSMENU_METADATA_MENUITEM_IMAGE_PATH, sanitize_image_path(data.get("arturl")));
}
+ public static string sanitize_image_path(string path)
+ {
+ string result = path.strip();
+ if(result.has_prefix("file:///")){
+ result = result.slice(7, result.len());
+ }
+ debug("Sanitize image path - result = %s", result);
+ return result;
+ }
+
public override void handle_event(string name, GLib.Value input_value, uint timestamp)
{
debug("MetadataItem -> handle event caught!");