diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-06-04 16:45:42 +0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-06-10 11:06:45 +0300 |
commit | f899c1fad7278c7a6b114dc1b8024fc79ab6d61e (patch) | |
tree | a365671e517d96f4e5ae911fd40e8fda7f8977b8 /tools/bluetooth-player.c | |
parent | 9d60d860baf30900d1c62024284afe1974143b9c (diff) | |
download | bluez-f899c1fad7278c7a6b114dc1b8024fc79ab6d61e.tar.gz |
tools/bluetooth-player: Add repeat command
Add support for equalizer command which can be used to set repeat mode.
Diffstat (limited to 'tools/bluetooth-player.c')
-rw-r--r-- | tools/bluetooth-player.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/bluetooth-player.c b/tools/bluetooth-player.c index 670054a96..09f8e5492 100644 --- a/tools/bluetooth-player.c +++ b/tools/bluetooth-player.c @@ -371,6 +371,38 @@ static void cmd_equalizer(int argc, char *argv[]) rl_printf("Attempting to set equalizer\n"); } +static void cmd_repeat(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, "Repeat", &iter)) { + rl_printf("Operation not supported\n"); + return; + } + + value = g_strdup(argv[1]); + + if (g_dbus_proxy_set_property_basic(default_player, "Repeat", + DBUS_TYPE_STRING, &value, + generic_callback, value, + g_free) == FALSE) { + rl_printf("Failed to set repeat\n"); + g_free(value); + return; + } + + rl_printf("Attempting to set repeat\n"); +} + static char *proxy_description(GDBusProxy *proxy, const char *title, const char *description) { @@ -824,6 +856,8 @@ static const struct { { "rewind", NULL, cmd_rewind, "Rewind playback" }, { "equalizer", "<on/off>", cmd_equalizer, "Enable/Disable equalizer"}, + { "repeat", "<singletrack/alltrack/group/off>", cmd_repeat, + "Set repeat mode"}, { "change-folder", "<item>", cmd_change_folder, "Change current folder" }, { "list-items", "[start] [end]", cmd_list_items, |