aboutsummaryrefslogtreecommitdiff
path: root/src/player-item.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-06-21 19:36:21 +0100
committerConor Curran <conor.curran@canonical.com>2010-06-21 19:36:21 +0100
commit6e001f4e0606bce9d3eb070df97d44a7b10081c5 (patch)
tree74373818cebb4d313b7d6d7988b104e8e2ff85c5 /src/player-item.vala
parent7be2c7248a0b29ea74e8e36db405d5974995a57b (diff)
downloadayatana-indicator-sound-6e001f4e0606bce9d3eb070df97d44a7b10081c5.tar.gz
ayatana-indicator-sound-6e001f4e0606bce9d3eb070df97d44a7b10081c5.tar.bz2
ayatana-indicator-sound-6e001f4e0606bce9d3eb070df97d44a7b10081c5.zip
wip
Diffstat (limited to 'src/player-item.vala')
-rw-r--r--src/player-item.vala32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/player-item.vala b/src/player-item.vala
index 10dedc2..ee09074 100644
--- a/src/player-item.vala
+++ b/src/player-item.vala
@@ -29,11 +29,26 @@ public class PlayerItem : Dbusmenu.Menuitem
{
}
- public void update(HashMap<string, Value?> data, Type type)
+ public void update(HashTable<string, Value?> data, HashMap<string, Type> attributes)
{
debug("PlayerItem::update()");
- HashMap<string, Type> attributes = type.attributes_format();
- foreach(var property in data){
+ foreach(var property in attributes){
+ //debug("property value = %s", attributes.get(property.key).name());
+ GLib.Object obj = GLib.Object.new(attributes.get(property.key));
+ debug("bang line");
+ Type t = obj.get_type();
+ if(t.is_a(typeof(string)) == true){
+ debug("obj is a string !!! we can tell -halla fucking lula!");
+ }
+ //string[] input_keys = property.key.split("-");
+ //string search_key = input_keys[input_keys.length-1 : input_keys.length][0];
+ //debug("key parsed from properties is %s", search_key);
+ //debug("and the bloody type should be %s", property.value.name());
+ //var input_value = data.lookup(search_key) as property.value.name();
+ //foreach(var s in input_keys){
+ // debug("string = %s", s);
+ //}
+ //string[] st = input_keys[input_keys.length-1 : input_keys.length];
//property.value as attributes.get(property.key)
//this.property_set(property.key, );
}
@@ -44,6 +59,17 @@ public class PlayerItem : Dbusmenu.Menuitem
this.mpris_adaptor = adaptor;
}
+ public static HashMap<string, string> format_updates(HashTable<string,Value?> ht)
+ {
+ HashMap<string,string> results = new HashMap<string, string>();
+ //HashMap<string, Type> attrs = attributes_format();
+ //results.set(MENUITEM_TEXT_TITLE, (string)data.lookup("title").strip());
+ //results.set(MENUITEM_TEXT_ARTIST, (string)data.lookup("artist").strip());
+ //results.set(MENUITEM_TEXT_ALBUM, (string)data.lookup("album").strip(), typeof(string));
+ //results.set(MENUITEM_TEXT_ARTURL, sanitize_image_path((string)data.lookup("arturl").strip()), typeof(string));
+ return results;
+ }
+
// Bespoke constructors for player items
// Title item
public static PlayerItem new_title_item(dynamic string name)