From af0659ba5f02764c79dd5b9a2f1d9031dd19af63 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 28 Oct 2011 10:49:21 +0300 Subject: [PATCH] Add support for MediaPlayer.Release to mpris-player --- test/mpris-player.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/mpris-player.c b/test/mpris-player.c index 4592e5df7..a1632f324 100644 --- a/test/mpris-player.c +++ b/test/mpris-player.c @@ -429,6 +429,22 @@ static char *sender2path(const char *sender) return g_strdelimit(path, ":.", '_'); } +static DBusHandlerResult player_message(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + if (dbus_message_is_method_call(msg, "org.bluez.MediaPlayer", + "Release")) { + printf("Release\n"); + exit(1); + } + + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; +} + +static const DBusObjectPathVTable player_table = { + .message_function = player_message, +}; + static void add_player(DBusConnection *conn, const char *name, const char *sender) { @@ -492,6 +508,10 @@ static void add_player(DBusConnection *conn, const char *name, goto done; } + if (!dbus_connection_register_object_path(sys, path, &player_table, + NULL)) + fprintf(stderr, "Can't register object path for agent\n"); + done: if (reply) dbus_message_unref(reply); -- 2.47.3