summaryrefslogtreecommitdiff
path: root/tools/bluetooth-player.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-05-30 22:46:03 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-06-10 11:06:45 +0300
commitffba5601a886a03fc96a4e861b745c144bebfa6b (patch)
tree7f69c1923d65c846858abcb58e5f0a1d31a025af /tools/bluetooth-player.c
parent9948de8271385a5ffa84ff6dd4e2f019740bb587 (diff)
downloadbluez-ffba5601a886a03fc96a4e861b745c144bebfa6b.tar.gz
tools/bluetooth-player: Add fast-forward command
Add support for fast-forward command which can be used to fast forward the playback
Diffstat (limited to 'tools/bluetooth-player.c')
-rw-r--r--tools/bluetooth-player.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/bluetooth-player.c b/tools/bluetooth-player.c
index b8c7e0648..dab0e6e25 100644
--- a/tools/bluetooth-player.c
+++ b/tools/bluetooth-player.c
@@ -231,6 +231,35 @@ static void cmd_previous(int argc, char *argv[])
rl_printf("Attempting to jump to previous\n");
}
+static void fast_forward_reply(DBusMessage *message, void *user_data)
+{
+ DBusError error;
+
+ dbus_error_init(&error);
+
+ if (dbus_set_error_from_message(&error, message) == TRUE) {
+ rl_printf("Failed to fast forward: %s\n", error.name);
+ dbus_error_free(&error);
+ return;
+ }
+
+ rl_printf("FastForward successful\n");
+}
+
+static void cmd_fast_forward(int argc, char *argv[])
+{
+ if (!check_default_player())
+ return;
+
+ if (g_dbus_proxy_method_call(default_player, "FastForward", NULL,
+ fast_forward_reply, NULL, NULL) == FALSE) {
+ rl_printf("Failed to jump to previous\n");
+ return;
+ }
+
+ rl_printf("Fast forward playback\n");
+}
+
static const struct {
const char *cmd;
const char *arg;
@@ -242,6 +271,8 @@ static const struct {
{ "stop", NULL, cmd_stop, "Stop playback" },
{ "next", NULL, cmd_next, "Jump to next item" },
{ "previous", NULL, cmd_previous, "Jump to previous item" },
+ { "fast-forward", NULL, cmd_fast_forward,
+ "Fast forward playback" },
{ "quit", NULL, cmd_quit, "Quit program" },
{ "exit", NULL, cmd_quit },
{ "help" },