rl_printf("Attempting to pause\n");
}
+static void stop_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 stop: %s\n", error.name);
+ dbus_error_free(&error);
+ return;
+ }
+
+ rl_printf("Stop successful\n");
+}
+
+static void cmd_stop(int argc, char *argv[])
+{
+ if (!check_default_player())
+ return;
+
+ if (g_dbus_proxy_method_call(default_player, "Stop", NULL, stop_reply,
+ NULL, NULL) == FALSE) {
+ rl_printf("Failed to stop\n");
+ return;
+ }
+
+ rl_printf("Attempting to stop\n");
+}
+
static const struct {
const char *cmd;
const char *arg;
} cmd_table[] = {
{ "play", NULL, cmd_play, "Start playback" },
{ "pause", NULL, cmd_pause, "Pause playback" },
+ { "stop", NULL, cmd_stop, "Stop playback" },
{ "quit", NULL, cmd_quit, "Quit program" },
{ "exit", NULL, cmd_quit },
{ "help" },