aboutsummaryrefslogtreecommitdiff
path: root/src/sound-service-dbus.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-01-30 13:41:18 +0000
committerConor Curran <conor.curran@canonical.com>2010-01-30 13:41:18 +0000
commit0b66ce027d9fab70a01ada23f6b77035bbf6719f (patch)
treee9ce0b585878c526055d8ad66492edd790b07893 /src/sound-service-dbus.c
parentf3baf71567c1b8840dafcdcbb73a793dd6064c0f (diff)
downloadayatana-indicator-sound-0b66ce027d9fab70a01ada23f6b77035bbf6719f.tar.gz
ayatana-indicator-sound-0b66ce027d9fab70a01ada23f6b77035bbf6719f.tar.bz2
ayatana-indicator-sound-0b66ce027d9fab70a01ada23f6b77035bbf6719f.zip
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
Diffstat (limited to 'src/sound-service-dbus.c')
-rw-r--r--src/sound-service-dbus.c20
1 files changed, 18 insertions, 2 deletions
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)