aboutsummaryrefslogtreecommitdiff
path: root/src/voip-input-menu-item.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-02-17 19:58:09 +0000
committerConor Curran <conor.curran@canonical.com>2011-02-17 19:58:09 +0000
commit8263f9aed8c1c66cfe7a7749a4d78c096165acd3 (patch)
tree7f066486d0aa1bbe57c47ba3482acfe28ab72482 /src/voip-input-menu-item.c
parent4bebcafef41b3dbc6b4f3f3e2f6382d82390335f (diff)
downloadayatana-indicator-sound-8263f9aed8c1c66cfe7a7749a4d78c096165acd3.tar.gz
ayatana-indicator-sound-8263f9aed8c1c66cfe7a7749a4d78c096165acd3.tar.bz2
ayatana-indicator-sound-8263f9aed8c1c66cfe7a7749a4d78c096165acd3.zip
enough for one day
Diffstat (limited to 'src/voip-input-menu-item.c')
-rw-r--r--src/voip-input-menu-item.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/voip-input-menu-item.c b/src/voip-input-menu-item.c
index 203fed4..54e12e6 100644
--- a/src/voip-input-menu-item.c
+++ b/src/voip-input-menu-item.c
@@ -23,6 +23,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <glib/gi18n.h>
#include "voip-input-menu-item.h"
#include "common-defs.h"
+#include "pulseaudio-mgr.h"
typedef struct _VoipInputMenuItemPrivate VoipInputMenuItemPrivate;
@@ -107,11 +108,18 @@ handle_event (DbusmenuMenuitem * mi,
input = g_variant_get_variant(value);
}
- gboolean volume_input = g_variant_get_double(input);
+ gboolean percent = g_variant_get_double(input);
if (value != NULL){
if (IS_VOIP_INPUT_MENU_ITEM (mi)) {
VoipInputMenuItemPrivate* priv = VOIP_INPUT_MENU_ITEM_GET_PRIVATE (VOIP_INPUT_MENU_ITEM (mi));
- g_debug ("Handle event in the voip input level backend instance - %f", volume_input);
+ g_debug ("Handle event in the voip input level backend instance - %f", percent);
+ pa_cvolume new_volume;
+ pa_cvolume_init(&new_volume);
+ new_volume.channels = 1;
+ pa_volume_t new_volume_value = (pa_volume_t) ((percent * PA_VOLUME_NORM) / 100);
+ pa_cvolume_set(&new_volume, 1, new_volume_value);
+
+ pm_update_mic_gain (priv->index, new_volume);
//active_sink_update_volume (priv->a_sink, volume_input);
//active_sink_ensure_sink_is_unmuted (priv->a_sink);
}