From 3c32cbf901f7b78024806b47d5b15249b68f8a66 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Sat, 1 Jun 2013 20:45:35 +0700 Subject: [PATCH] tools/bluetooth-player: Add folder properties to command show output This add folder properties to command show output if MediaFolder1 is supported. --- tools/bluetooth-player.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/bluetooth-player.c b/tools/bluetooth-player.c index 59775e824..d6aaaa140 100644 --- a/tools/bluetooth-player.c +++ b/tools/bluetooth-player.c @@ -415,9 +415,24 @@ static void print_property(GDBusProxy *proxy, const char *name) print_iter("\t", name, &iter); } +static GDBusProxy *find_folder(const char *path) +{ + GSList *l; + + for (l = folders; l; l = g_slist_next(l)) { + GDBusProxy *proxy = l->data; + + if (strcmp(path, g_dbus_proxy_get_path(proxy)) == 0) + return proxy; + } + + return NULL; +} + static void cmd_show(int argc, char *argv[]) { GDBusProxy *proxy; + GDBusProxy *folder; if (argc < 2) { if (check_default_player() == FALSE) @@ -442,6 +457,15 @@ static void cmd_show(int argc, char *argv[]) print_property(proxy, "Status"); print_property(proxy, "Position"); print_property(proxy, "Track"); + + folder = find_folder(g_dbus_proxy_get_path(proxy)); + if (folder == NULL) + return; + + rl_printf("Folder %s\n", g_dbus_proxy_get_path(proxy)); + + print_property(folder, "Name"); + print_property(folder, "NumberOfItems"); } static void cmd_select(int argc, char *argv[]) -- 2.47.3