aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-03-16 12:38:04 +0000
committerConor Curran <conor.curran@canonical.com>2011-03-16 12:38:04 +0000
commita893dae8a5ab7f5f02e8eb1d1db626c135b3383d (patch)
tree908eff545add881018d8318d8e187c757a13865c
parent205489a9c85c3c3d5d2caa7f48850cf04f29a70d (diff)
downloadayatana-indicator-sound-a893dae8a5ab7f5f02e8eb1d1db626c135b3383d.tar.gz
ayatana-indicator-sound-a893dae8a5ab7f5f02e8eb1d1db626c135b3383d.tar.bz2
ayatana-indicator-sound-a893dae8a5ab7f5f02e8eb1d1db626c135b3383d.zip
keyhandling for the voip slider now working and voip slider now activated when app role is also production
-rw-r--r--src/indicator-sound.c25
-rw-r--r--src/pulseaudio-mgr.c2
-rw-r--r--src/sound-service.c2
3 files changed, 14 insertions, 15 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 22ecebe..7d74a42 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -484,19 +484,15 @@ key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer data)
IndicatorSound *indicator = INDICATOR_SOUND (data);
IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(indicator);
-/*
- if(priv->volume_widget == NULL){
- return FALSE;
- }
-*/
- gdouble current_value = 0;
- gdouble new_value = 0;
- const gdouble five_percent = 5;
-
GtkWidget *menuitem;
menuitem = GTK_MENU_SHELL (widget)->active_menu_item;
if (IDO_IS_SCALE_MENU_ITEM(menuitem) == TRUE){
+ gdouble current_value = 0;
+ gdouble new_value = 0;
+ const gdouble five_percent = 5;
+ gboolean is_voip_slider = FALSE;
+
if (g_ascii_strcasecmp (ido_scale_menu_item_get_primary_label (IDO_SCALE_MENU_ITEM(menuitem)), "VOLUME") == 0) {
g_debug ("vOLUME SLIDER KEY PRESS");
GtkWidget* slider_widget = volume_widget_get_ido_slider(VOLUME_WIDGET(priv->volume_widget));
@@ -514,6 +510,7 @@ key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer data)
g_return_val_if_fail(GTK_IS_RANGE(range), FALSE);
current_value = gtk_range_get_value(range);
new_value = current_value;
+ is_voip_slider = TRUE;
}
switch (event->keyval) {
@@ -537,9 +534,13 @@ key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer data)
break;
}
new_value = CLAMP(new_value, 0, 100);
- if (new_value != current_value) {
- //g_debug("Attempting to set the range from the key listener to %f", new_value);
- volume_widget_update(VOLUME_WIDGET(priv->volume_widget), new_value);
+ if (new_value != current_value){
+ if (is_voip_slider == TRUE){
+ voip_input_widget_update (VOIP_INPUT_WIDGET(priv->voip_widget), new_value);
+ }
+ else{
+ volume_widget_update (VOLUME_WIDGET(priv->volume_widget), new_value);
+ }
}
}
else if (IS_TRANSPORT_WIDGET(menuitem) == TRUE) {
diff --git a/src/pulseaudio-mgr.c b/src/pulseaudio-mgr.c
index 8811bcf..95f4c06 100644
--- a/src/pulseaudio-mgr.c
+++ b/src/pulseaudio-mgr.c
@@ -483,7 +483,7 @@ pm_sink_input_info_callback (pa_context *c,
g_debug ("Sink input info has media role property");
const char* value = pa_proplist_gets (info->proplist, PA_PROP_MEDIA_ROLE);
g_debug ("prop role = %s", value);
- if (g_strcmp0 (value, "phone") == 0) {
+ if (g_strcmp0 (value, "phone") == 0 || g_strcmp0 (value, "production") == 0) {
g_debug ("And yes its a VOIP app ... sink input index = %i", info->index);
device_activate_voip_item (a_sink, (gint)info->index, (gint)info->client);
// TODO to start with we will assume our source is the same as what this 'client'
diff --git a/src/sound-service.c b/src/sound-service.c
index 9f44624..cfc0b7e 100644
--- a/src/sound-service.c
+++ b/src/sound-service.c
@@ -39,10 +39,8 @@ service_shutdown (IndicatorService *service, gpointer user_data)
{
if (mainloop != NULL) {
g_debug("Service shutdown !");
-/*
close_pulse_activites();
g_main_loop_quit(mainloop);
-*/
}
return;
}