aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-01-27 16:23:36 +0000
committerConor Curran <conor.curran@canonical.com>2010-01-27 16:23:36 +0000
commit170afb3ecc0e216a34945eb31a9743d86bf9c325 (patch)
tree730135511e4101a2ae609729003c4486571ad122
parent5a86d06d8019cd9a827f69839d23268a2a6ebc51 (diff)
downloadayatana-indicator-sound-170afb3ecc0e216a34945eb31a9743d86bf9c325.tar.gz
ayatana-indicator-sound-170afb3ecc0e216a34945eb31a9743d86bf9c325.tar.bz2
ayatana-indicator-sound-170afb3ecc0e216a34945eb31a9743d86bf9c325.zip
signals now work, also pulling in slider
-rw-r--r--configure.ac6
-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
7 files changed, 22 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index bc9b716..54fa57d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,7 +34,8 @@ INDICATOR_DISPLAY_OBJECTS=0.1
PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
indicator >= $INDICATOR_REQUIRED_VERSION
- dbusmenu-gtk >= $DBUSMENUGTK_REQUIRED_VERSION)
+ dbusmenu-gtk >= $DBUSMENUGTK_REQUIRED_VERSION
+ libido-0.1 >= $INDICATOR_DISPLAY_OBJECTS)
AC_SUBST(APPLET_CFLAGS)
AC_SUBST(APPLET_LIBS)
@@ -43,7 +44,8 @@ DBUSMENUGLIB_REQUIRED_VERSION=0.1.1
PKG_CHECK_MODULES(SOUNDSERVICE, dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION
indicator >= $INDICATOR_REQUIRED_VERSION
- libpulse-mainloop-glib >= $PULSE_AUDIO_REQUIRED_VERSION)
+ libpulse-mainloop-glib >= $PULSE_AUDIO_REQUIRED_VERSION
+)
AC_SUBST(SOUNDSERVICE_CFLAGS)
AC_SUBST(SOUNDERVICE_LIBS)
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>