aboutsummaryrefslogtreecommitdiff
path: root/src/sound-service-dbus.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-08-10 17:16:04 +0100
committerConor Curran <conor.curran@canonical.com>2011-08-10 17:16:04 +0100
commit161c8c52715995d2c9e0b9cb04236aaa078c4e8f (patch)
treee739b873d9a333bf4e93a19f01fd536fc6a1f55a /src/sound-service-dbus.c
parent7cb21f1a155f52646030e987ab60503b02a04496 (diff)
parent82a8f86a7088a2e144c89373174c8e03a597f277 (diff)
downloadayatana-indicator-sound-161c8c52715995d2c9e0b9cb04236aaa078c4e8f.tar.gz
ayatana-indicator-sound-161c8c52715995d2c9e0b9cb04236aaa078c4e8f.tar.bz2
ayatana-indicator-sound-161c8c52715995d2c9e0b9cb04236aaa078c4e8f.zip
player and track specific support is in
Diffstat (limited to 'src/sound-service-dbus.c')
-rw-r--r--src/sound-service-dbus.c56
1 files changed, 55 insertions, 1 deletions
diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c
index 0db03d4..b69f081 100644
--- a/src/sound-service-dbus.c
+++ b/src/sound-service-dbus.c
@@ -32,6 +32,7 @@
#include "device.h"
#include "gen-sound-service.xml.h"
#include "dbus-shared-names.h"
+#include "sound-service-marshal.h"
// DBUS methods
static void bus_method_call (GDBusConnection * connection,
@@ -59,6 +60,14 @@ struct _SoundServiceDbusPrivate {
gboolean greeter_mode;
};
+enum {
+ TRACK_SPECIFIC_ITEM,
+ PLAYER_SPECIFIC_ITEM,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
static GDBusNodeInfo * node_info = NULL;
static GDBusInterfaceInfo * interface_info = NULL;
@@ -111,6 +120,22 @@ sound_service_dbus_class_init (SoundServiceDbusClass *klass)
g_error("Unable to find interface '" INDICATOR_SOUND_DBUS_INTERFACE "'");
}
}
+ signals[TRACK_SPECIFIC_ITEM] = g_signal_new("track-specific-item-requested",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ _sound_service_marshal_VOID__STRING_STRING,
+ G_TYPE_NONE, 2, G_TYPE_STRING,
+ G_TYPE_STRING);
+ signals[PLAYER_SPECIFIC_ITEM] = g_signal_new("player-specific-item-requested",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ _sound_service_marshal_VOID__STRING_STRING,
+ G_TYPE_NONE, 2, G_TYPE_STRING,
+ G_TYPE_STRING);
}
static void
@@ -150,7 +175,6 @@ sound_service_dbus_create_root_item (SoundServiceDbus* self, gboolean greeter_mo
SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self);
priv->greeter_mode = greeter_mode;
priv->root_menuitem = dbusmenu_menuitem_new();
- //g_debug("Root ID: %d", dbusmenu_menuitem_get_id(priv->root_menuitem));
DbusmenuServer *server = dbusmenu_server_new (INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH);
dbusmenu_server_set_root (server, priv->root_menuitem);
g_object_unref (priv->root_menuitem);
@@ -301,6 +325,36 @@ bus_method_call (GDBusConnection * connection,
player_name);
retval = g_variant_new ("(b)", result);
}
+ else if (g_strcmp0(method, "EnableTrackSpecificItems") == 0) {
+ g_debug ("EnableTrackSpecificItems");
+ gchar* player_object_path;
+ gchar* player_id;
+ g_variant_get (params, "(os)", &player_object_path, &player_id);
+ //g_debug ("object path = %s and id = %s", player_object_path, player_id);
+ g_signal_emit (service,
+ signals[TRACK_SPECIFIC_ITEM],
+ 0,
+ player_object_path,
+ player_id);
+ g_free (player_object_path);
+ g_free (player_id);
+
+ }
+ else if (g_strcmp0(method, "EnablePlayerSpecificItems") == 0) {
+ gchar* player_object_path;
+ gchar* player_id;
+ g_variant_get (params, "(os)", &player_object_path, &player_id);
+ g_debug ("PLayer specific item - object path = %s and id = %s",
+ player_object_path,
+ player_id);
+ g_signal_emit (service,
+ signals[PLAYER_SPECIFIC_ITEM],
+ 0,
+ player_object_path,
+ player_id);
+ g_free (player_object_path);
+ g_free (player_id);
+ }
else {
g_warning("Calling method '%s' on the sound service but it's unknown", method);
}