diff options
-rw-r--r-- | src/metadata-menu-item.vala | 23 | ||||
-rw-r--r-- | src/player-item.vala | 6 | ||||
-rw-r--r-- | vapi/common-defs.vapi | 9 | ||||
-rw-r--r-- | vapi/music-bridge.vapi | 4 |
4 files changed, 20 insertions, 22 deletions
diff --git a/src/metadata-menu-item.vala b/src/metadata-menu-item.vala index 28e034a..02ae1c9 100644 --- a/src/metadata-menu-item.vala +++ b/src/metadata-menu-item.vala @@ -4,25 +4,18 @@ using CommonDefs; public class MetadataMenuitem : PlayerItem { - /* Not ideal duplicate definition of const - see common-defs/h */ - //const string DBUSMENU_METADATA_MENUITEM_TYPE = "x-canonical-metadata-menu-item"; - //const string DBUSMENU_METADATA_MENUITEM_TEXT_ARTIST = "x-canonical-metadata-text-artist"; - //const string DBUSMENU_METADATA_MENUITEM_TEXT_TITLE = "x-canonical-metadata-text-title"; - //const string DBUSMENU_METADATA_MENUITEM_TEXT_ALBUM = "x-canonical-metadata-text-album"; - //const string DBUSMENU_METADATA_MENUITEM_IMAGE_PATH = "x-canonical-metadata-image"; - public MetadataMenuitem() { - this.property_set(MENUITEM_PROP_TYPE, DBUSMENU_METADATA_MENUITEM_TYPE); + this.property_set(MENUITEM_PROP_TYPE, CommonDefs.DBUSMENU_METADATA_MENUITEM_TYPE); } public override 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"))); + this.property_set(CommonDefs.DBUSMENU_METADATA_MENUITEM_TEXT_ARTIST, data.get("artist").strip()); + this.property_set(CommonDefs.DBUSMENU_METADATA_MENUITEM_TEXT_TITLE, data.get("title").strip()); + this.property_set(CommonDefs.DBUSMENU_METADATA_MENUITEM_TEXT_ALBUM, data.get("album").strip()); + this.property_set(CommonDefs.DBUSMENU_METADATA_MENUITEM_IMAGE_PATH, sanitize_image_path(data.get("arturl"))); } public static string sanitize_image_path(string path) @@ -44,9 +37,9 @@ public class MetadataMenuitem : PlayerItem { HashMap<string, Type> result = new HashMap<string, Type>(); result.set(DBUSMENU_METADATA_MENUITEM_TEXT_ARTIST, typeof(string)); - result.set("x-canonical-metadata-text-title", typeof(string)); - result.set("x-canonical-metadata-text-album", typeof(string)); - result.set("x-canonical-metadata-text-image", typeof(string)); + result.set(DBUSMENU_METADATA_MENUITEM_TEXT_TITLE, typeof(string)); + result.set(DBUSMENU_METADATA_MENUITEM_TEXT_ALBUM, typeof(string)); + result.set(DBUSMENU_METADATA_MENUITEM_IMAGE_PATH, typeof(string)); return result; } diff --git a/src/player-item.vala b/src/player-item.vala index a0ea25a..aa35b33 100644 --- a/src/player-item.vala +++ b/src/player-item.vala @@ -32,9 +32,9 @@ public class PlayerItem : Dbusmenu.Menuitem public virtual void update(HashMap<string, Value?> data) { debug("PlayerItem::update()"); - foreach(var key in this.attributes().keys){ - this.attributes.get(key); - } + //foreach(var key in this.attributes().keys){ + // this.attributes.get(key); + //} } public void set_adaptor(MprisController adaptor) diff --git a/vapi/common-defs.vapi b/vapi/common-defs.vapi new file mode 100644 index 0000000..8f374d0 --- /dev/null +++ b/vapi/common-defs.vapi @@ -0,0 +1,9 @@ +/* music-bridge.vapi generated by valac, do not modify. */ +[CCode (cheader_filename = "common-defs.h")] +namespace CommonDefs{ + public const string DBUSMENU_METADATA_MENUITEM_TYPE; + public const string DBUSMENU_METADATA_MENUITEM_TEXT_ARTIST; + public const string DBUSMENU_METADATA_MENUITEM_TEXT_TITLE; + public const string DBUSMENU_METADATA_MENUITEM_TEXT_ALBUM; + public const string DBUSMENU_METADATA_MENUITEM_IMAGE_PATH; +}
\ No newline at end of file diff --git a/vapi/music-bridge.vapi b/vapi/music-bridge.vapi deleted file mode 100644 index 65d40ec..0000000 --- a/vapi/music-bridge.vapi +++ /dev/null @@ -1,4 +0,0 @@ -/* music-bridge.vapi generated by valac, do not modify. */ -[CCode (cheader_filename = "common-defs.h")] -namespace CommonDefs{ -}
\ No newline at end of file |