From 0b66ce027d9fab70a01ada23f6b77035bbf6719f Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Sat, 30 Jan 2010 13:41:18 +0000 Subject: pulse functionality refactored out inot to a separate PA file(s), sink details now stored in hash, complete list of events subscribed to, get sink list method added to the dbus service --- src/sound-service-dbus.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/sound-service-dbus.c') diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index 06117eb..286af32 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -28,7 +28,7 @@ #include "sound-service-server.h" #include "common-defs.h" #include "sound-service-marshal.h" - +#include "pulse-manager.h" typedef struct _SoundServiceDbusPrivate SoundServiceDbusPrivate; @@ -36,14 +36,17 @@ struct _SoundServiceDbusPrivate { DBusGConnection *system_bus; DBusGConnection *connection; + GHashTable *sinks_hash; }; + /* Signals */ enum { SINK_INPUT_WHILE_MUTED, LAST_SIGNAL }; + static guint signals[LAST_SIGNAL] = { 0 }; #define SOUND_SERVICE_DBUS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SOUND_SERVICE_DBUS_TYPE, SoundServiceDbusPrivate)) @@ -85,7 +88,7 @@ DBUS Method Callbacks **/ gboolean sound_service_dbus_set_sink_volume(SoundServiceDbus* service, const guint volume_percent, GError** gerror) { - g_debug("in the set sink volume method in the sound service dbus! Holy Fuck with volume_percent of %i", volume_percent); + g_debug("in the set sink volume method in the sound service dbus!, with volume_percent of %i", volume_percent); /* if (!IS_SOUND_SERVICE_DBUS(service)) {*/ /* g_warning("NO BAD EVIL!");*/ /* return FALSE;*/ @@ -93,6 +96,14 @@ gboolean sound_service_dbus_set_sink_volume(SoundServiceDbus* service, const gui return TRUE; } +GList * +sound_service_dbus_get_sink_list (SoundServiceDbus *self) +{ + SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (self); + + return g_hash_table_get_keys (priv->sinks_hash); +} + /** Utility methods to emit signals from the service into the ether. @@ -108,6 +119,11 @@ void sound_service_dbus_sink_input_while_muted(SoundServiceDbus* obj, gint sink_ value); } +void set_pa_sinks_hash(SoundServiceDbus *self, GHashTable *sinks) +{ + SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (self); + priv->sinks_hash = sinks; +} static void sound_service_dbus_init (SoundServiceDbus *self) -- cgit v1.2.3