From 0fe67267ce62de20bddae2918b7fc39a8df55ceb Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 17 Jul 2013 14:17:11 +0300 Subject: [PATCH] audio/player: Add Player property to MediaItem1 This proper refer to the player object path which the item belongs to --- profiles/audio/player.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/profiles/audio/player.c b/profiles/audio/player.c index 0c52ea90d..917c66e1a 100644 --- a/profiles/audio/player.c +++ b/profiles/audio/player.c @@ -1499,6 +1499,19 @@ static DBusMessage *media_item_add_to_nowplaying(DBusConnection *conn, return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); } +static gboolean get_player(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct media_item *item = data; + + DBG("%s", item->player->path); + + dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH, + &item->player->path); + + return TRUE; +} + static gboolean item_name_exists(const GDBusPropertyTable *property, void *data) { @@ -1671,6 +1684,8 @@ static const GDBusMethodTable media_item_methods[] = { }; static const GDBusPropertyTable media_item_properties[] = { + { "Player", "o", get_player, NULL, NULL, + G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, { "Name", "s", get_item_name, NULL, item_name_exists, G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, { "Type", "s", get_item_type, NULL, NULL, -- 2.47.3