summaryrefslogtreecommitdiff
path: root/tools/bluetooth-player.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-06-04 17:03:59 +0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-06-10 11:06:45 +0300
commitad3acd58f8f2b324f07f59ceb2eda352eaf08eea (patch)
tree6ccafbdb861206caa7052a713a172a161749e70b /tools/bluetooth-player.c
parentf899c1fad7278c7a6b114dc1b8024fc79ab6d61e (diff)
downloadbluez-ad3acd58f8f2b324f07f59ceb2eda352eaf08eea.tar.gz
tools/bluetooth-player: Add shuffle command
Add support for shuffle command which can be used to set shuffle mode.
Diffstat (limited to 'tools/bluetooth-player.c')
-rw-r--r--tools/bluetooth-player.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/bluetooth-player.c b/tools/bluetooth-player.c
index 09f8e5492..456617fcd 100644
--- a/tools/bluetooth-player.c
+++ b/tools/bluetooth-player.c
@@ -403,6 +403,38 @@ static void cmd_repeat(int argc, char *argv[])
rl_printf("Attempting to set repeat\n");
}
+static void cmd_shuffle(int argc, char *argv[])
+{
+ char *value;
+ DBusMessageIter iter;
+
+ if (!check_default_player())
+ return;
+
+ if (argc < 2) {
+ rl_printf("Missing mode argument\n");
+ return;
+ }
+
+ if (!g_dbus_proxy_get_property(default_player, "Shuffle", &iter)) {
+ rl_printf("Operation not supported\n");
+ return;
+ }
+
+ value = g_strdup(argv[1]);
+
+ if (g_dbus_proxy_set_property_basic(default_player, "Shuffle",
+ DBUS_TYPE_STRING, &value,
+ generic_callback, value,
+ g_free) == FALSE) {
+ rl_printf("Failed to set shuffle\n");
+ g_free(value);
+ return;
+ }
+
+ rl_printf("Attempting to set shuffle\n");
+}
+
static char *proxy_description(GDBusProxy *proxy, const char *title,
const char *description)
{
@@ -858,6 +890,8 @@ static const struct {
"Enable/Disable equalizer"},
{ "repeat", "<singletrack/alltrack/group/off>", cmd_repeat,
"Set repeat mode"},
+ { "shuffle", "<alltracks/group/off>", cmd_shuffle,
+ "Set shuffle mode"},
{ "change-folder", "<item>", cmd_change_folder,
"Change current folder" },
{ "list-items", "[start] [end]", cmd_list_items,