From 9d0d8eaa8b9c021fbb45368f96489f520aab86e7 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Thu, 4 Mar 2010 21:23:40 +1100 Subject: Put mocking core in place for Connor. --- src/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 40a8fdd..8ddcff5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -59,8 +59,8 @@ indicator_sound_service_SOURCES = \ sound-service-marshal.h \ slider-menu-item.h \ slider-menu-item.c -indicator_sound_service_CFLAGS = $(SOUNDSERVICE_CFLAGS) $(GCONF_CFLAGS) -DLIBEXECDIR=\"$(libexecdir)\" -Wall -Werror -indicator_sound_service_LDADD = $(SOUNDSERVICE_LIBS) $(GCONF_LIBS) +indicator_sound_service_CFLAGS = $(PULSEAUDIO_CFLAGS) $(SOUNDSERVICE_CFLAGS) $(GCONF_CFLAGS) -DLIBEXECDIR=\"$(libexecdir)\" -Wall -Werror +indicator_sound_service_LDADD = $(PULSEAUDIO_LIBS) $(SOUNDSERVICE_LIBS) $(GCONF_LIBS) sound-service-server.h: $(srcdir)/sound-service.xml dbus-binding-tool \ -- cgit v1.2.3 From 364d9362165f9f0d468eadc269c6421f4bf929e3 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 8 Mar 2010 20:40:32 +0000 Subject: new pulse manager test beginnings --- src/pulse-manager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/pulse-manager.c b/src/pulse-manager.c index 4594d2f..04f842a 100644 --- a/src/pulse-manager.c +++ b/src/pulse-manager.c @@ -462,7 +462,8 @@ static void subscribed_events_callback(pa_context *c, enum pa_subscription_event if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE) { //TODO handle the remove event => if its our default sink - update date pa state - } else + } + else { pa_operation_unref(pa_context_get_sink_info_by_index(c, index, update_sink_info, userdata)); } -- cgit v1.2.3 From f02377f77f88106ba1c26cb184a14f33cd1a89fe Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 22 Mar 2010 17:32:57 +0000 Subject: first pulse manager test wrote ... finally --- src/pulse-manager.c | 23 ++++++++++++----------- src/pulse-manager.h | 3 --- 2 files changed, 12 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/pulse-manager.c b/src/pulse-manager.c index 2f86a90..a95c887 100644 --- a/src/pulse-manager.c +++ b/src/pulse-manager.c @@ -72,6 +72,11 @@ void establish_pulse_activities(SoundServiceDbus *service) pa_context_connect(pulse_context, NULL, PA_CONTEXT_NOFAIL, NULL); } +pa_context* get_context() +{ + return pulse_context; +} + void close_pulse_activites() { if (pulse_context != NULL){ @@ -98,7 +103,11 @@ static void reconnect_to_pulse() pa_context_unref(pulse_context); pulse_context = NULL; } - g_hash_table_destroy(sink_hash); + + if(sink_hash != NULL){ + g_hash_table_destroy(sink_hash); + sink_hash = NULL; + } // reconnect pulse_context = pa_context_new(pa_glib_mainloop_get_api(pa_main_loop), "ayatana.indicator.sound"); @@ -115,7 +124,6 @@ static void destroy_sink_info(void *value) sink_info *sink = (sink_info*)value; g_free(sink->name); g_free(sink->description); - g_free(sink->icon_name); g_free(sink); } @@ -289,11 +297,9 @@ static void pulse_sink_info_callback(pa_context *c, const pa_sink_info *sink, in g_debug("About to add an item to our hash"); sink_info *value; value = g_new0(sink_info, 1); - value->index = value->device_index = sink->index; + value->index = sink->index; value->name = g_strdup(sink->name); value->description = g_strdup(sink->description); - value->icon_name = g_strdup(pa_proplist_gets(sink->proplist, PA_PROP_DEVICE_ICON_NAME)); - value->active_port = (sink->active_port != NULL); value->mute = !!sink->mute; value->volume = sink->volume; value->base_volume = sink->base_volume; @@ -363,8 +369,6 @@ static void update_sink_info(pa_context *c, const pa_sink_info *info, int eol, v sink_info *s = g_hash_table_lookup(sink_hash, GINT_TO_POINTER(info->index)); s->name = g_strdup(info->name); s->description = g_strdup(info->description); - s->icon_name = g_strdup(pa_proplist_gets(info->proplist, PA_PROP_DEVICE_ICON_NAME)); - s->active_port = (info->active_port != NULL); gboolean mute_changed = s->mute != !!info->mute; s->mute = !!info->mute; gboolean volume_changed = (pa_cvolume_equal(&info->volume, &s->volume) == 0); @@ -398,14 +402,11 @@ static void update_sink_info(pa_context *c, const pa_sink_info *info, int eol, v } else { - sink_info *value; value = g_new0(sink_info, 1); - value->index = value->device_index = info->index; + value->index = info->index; value->name = g_strdup(info->name); value->description = g_strdup(info->description); - value->icon_name = g_strdup(pa_proplist_gets(info->proplist, PA_PROP_DEVICE_ICON_NAME)); - value->active_port = (info->active_port != NULL); value->mute = !!info->mute; value->volume = info->volume; value->base_volume = info->base_volume; diff --git a/src/pulse-manager.h b/src/pulse-manager.h index e1777fb..60a7ad3 100644 --- a/src/pulse-manager.h +++ b/src/pulse-manager.h @@ -31,13 +31,10 @@ with this program. If not, see . typedef struct { gchar* name; gchar* description; - gchar* icon_name; gint index; - gint device_index; pa_cvolume volume; pa_channel_map channel_map; gboolean mute; - gboolean active_port; pa_volume_t base_volume; } sink_info; -- cgit v1.2.3 From 017109c083b207d4a2bfb1d7d17e09aafc123b55 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 23 Mar 2010 16:05:35 +0000 Subject: dbus methods are now tested --- src/sound-service-dbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index 260e064..5c6c487 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -140,7 +140,7 @@ sound_service_dbus_init (SoundServiceDbus *self) } /* register the service on it */ dbus_g_connection_register_g_object(priv->connection, - "/org/ayatana/indicator/sound/service", + INDICATOR_SOUND_SERVICE_DBUS_OBJECT, G_OBJECT(self)); } -- cgit v1.2.3