aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/dbus-shared-names.h2
-rw-r--r--src/indicator-sound.c15
-rw-r--r--src/sound-service-dbus.c2
-rw-r--r--src/sound-service.c4
-rw-r--r--src/sound-service.xml4
6 files changed, 18 insertions, 11 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index bd9b2ad..8488e50 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -66,7 +66,7 @@ indicator_sound_service_LDADD = $(SOUNDSERVICE_LIBS) $(GCONF_LIBS)
# Other Stuff
###############
BUILT_SOURCES = \
- sound-service-client.h \
+ sound-service-client.h \
sound-service-server.h \
sound-service-marshal.h \
sound-service-marshal.c
diff --git a/src/dbus-shared-names.h b/src/dbus-shared-names.h
index 124692a..276e88b 100644
--- a/src/dbus-shared-names.h
+++ b/src/dbus-shared-names.h
@@ -41,7 +41,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#define INDICATOR_SOUND_DBUS_NAME "org.ayatana.indicator.sound"
#define INDICATOR_SOUND_DBUS_OBJECT "/org/ayatana/indicator/sound/menu"
#define INDICATOR_SOUND_SERVICE_DBUS_OBJECT "/org/ayatana/indicator/sound/service"
-#define INDICATOR_SOUND_SERVICE_DBUS_INTERFACE "org.ayatana.indicator.sound.service"
+#define INDICATOR_SOUND_SERVICE_DBUS_INTERFACE "org.ayatana.indicator.sound"
#define INDICATOR_SOUND_DBUS_VERSION 0
#endif /* __DBUS_SHARED_NAMES_H__ */
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 64a6688..ed7de27 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -25,7 +25,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <glib-object.h>
#include <gtk/gtk.h>
#include <libdbusmenu-gtk/menu.h>
-/*#include <idoscalemenuitem.h>*/
+#include <idoscalemenuitem.h>
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-bindings.h>
@@ -71,7 +71,9 @@ INDICATOR_SET_TYPE(INDICATOR_SOUND_TYPE)
static GtkLabel * get_label (IndicatorObject * io);
static GtkImage * get_icon (IndicatorObject * io);
static GtkMenu * get_menu (IndicatorObject * io);
-//static GtkWidget *volume_item;
+static GtkWidget *volume_item = NULL;
+static GtkMenu* menu = NULL;
+
static DBusGProxy * sound_dbus_proxy = NULL;
@@ -154,7 +156,7 @@ connection_changed (IndicatorServiceManager * sm, gboolean connected, gpointer u
static void catch_signal (DBusGProxy * proxy, gint sink_index, gboolean value, gpointer userdata)
{
- g_debug("signal caught - i don't believe it !");
+ g_debug("signal caught - i don't believe it ! with index %i and value %i", sink_index, value);
}
@@ -201,9 +203,10 @@ get_icon (IndicatorObject * io)
static GtkMenu *
get_menu (IndicatorObject * io)
{
- //volume_item = ido_scale_menu_item_new_with_range ("Volume", 0, 100, 1);
- //gtk_menu_shell_append (GTK_MENU_SHELL (menu), volume_item);
- return GTK_MENU(dbusmenu_gtkmenu_new(INDICATOR_SOUND_DBUS_NAME, INDICATOR_SOUND_DBUS_OBJECT));
+ volume_item = ido_scale_menu_item_new_with_range ("Volume", 0, 100, 1);
+ menu = GTK_MENU(dbusmenu_gtkmenu_new(INDICATOR_SOUND_DBUS_NAME, INDICATOR_SOUND_DBUS_OBJECT));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), volume_item);
+ return menu;
}
diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c
index 920664e..338f135 100644
--- a/src/sound-service-dbus.c
+++ b/src/sound-service-dbus.c
@@ -73,7 +73,7 @@ sound_service_dbus_class_init (SoundServiceDbusClass *klass)
dbus_g_object_type_install_info(SOUND_SERVICE_DBUS_TYPE,
&dbus_glib__sound_service_server_object_info);
- signals[SINK_INPUT_WHILE_MUTED] = g_signal_new(SIGNAL_SINK_INPUT_WHILE_MUTED,
+ signals[SINK_INPUT_WHILE_MUTED] = g_signal_new("sink-input-while-muted",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
diff --git a/src/sound-service.c b/src/sound-service.c
index dc43d77..7f4b588 100644
--- a/src/sound-service.c
+++ b/src/sound-service.c
@@ -50,6 +50,7 @@ static void context_success_callback(pa_context *c, int success, void *userdata)
g_debug("Context Success Callback - result = %i", success);
}
+// TODO we are not handling multiple sinks appropriately
static void retrieve_complete_sink_list(pa_context *c, const pa_sink_info *sink, int eol, void *userdata){
if(eol > 0){
// TODO apparently never returns 0 sinks - Tested and it appears this assumption/prediction is correct.
@@ -63,6 +64,9 @@ static void retrieve_complete_sink_list(pa_context *c, const pa_sink_info *sink,
int value = g_strcasecmp(only_sink->name, " auto_null ");
g_debug("comparison outcome with auto_null is %i", value);
sink_available = (value != 0 && only_sink->active_port != NULL);
+ // Strictly speaking all_muted should only be through if all sinks are muted
+ // It is more application specific
+ all_muted = (only_sink->mute == 1);
g_debug("Available sink is named %s", only_sink->name);
g_debug("does Available sink have an active port: %i", only_sink->active_port != NULL);
g_debug("sink_available = %i", sink_available);
diff --git a/src/sound-service.xml b/src/sound-service.xml
index a0f6f57..ad1a626 100644
--- a/src/sound-service.xml
+++ b/src/sound-service.xml
@@ -7,8 +7,8 @@
<!-- </method>-->
<!-- Triggered when a sink is muted but the input has been sent to that sink -->
<signal name="SinkInputWhileMuted">
- <arg name="cur_value" type="i" direction="out"/>
- <arg name="cur_value" type="b" direction="out"/>
+ <arg name="sink_index" type="i" direction="out"/>
+ <arg name="mute_value" type="b" direction="out"/>
</signal>
</interface>
</node>