diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-06-01 20:45:35 +0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-06-10 11:06:45 +0300 |
commit | 3c32cbf901f7b78024806b47d5b15249b68f8a66 (patch) | |
tree | 42a910abb8a741fe3ee42b6aaad7ede3b3340615 /tools/bluetooth-player.c | |
parent | 2fcad91d2317420d85b2acb2f530af359daba3e9 (diff) | |
download | bluez-3c32cbf901f7b78024806b47d5b15249b68f8a66.tar.gz |
tools/bluetooth-player: Add folder properties to command show output
This add folder properties to command show output if MediaFolder1 is
supported.
Diffstat (limited to 'tools/bluetooth-player.c')
-rw-r--r-- | tools/bluetooth-player.c | 24 |
1 files changed, 24 insertions, 0 deletions
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[]) |