[empathy: 17/23] audio-src: add is_monitor boolean to mic struct
- From: Jonny Lamb <jonnylamb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy: 17/23] audio-src: add is_monitor boolean to mic struct
- Date: Mon, 1 Aug 2011 12:51:49 +0000 (UTC)
commit 90eaac49d3f279ae20fa061adbe8ba9ac8aaf023
Author: Jonny Lamb <jonny lamb collabora co uk>
Date: Thu Jul 28 15:24:19 2011 +0100
audio-src: add is_monitor boolean to mic struct
Signed-off-by: Jonny Lamb <jonny lamb collabora co uk>
src/empathy-audio-src.c | 10 +++++++---
src/empathy-audio-src.h | 1 +
src/empathy-mic-menu.c | 1 +
3 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/empathy-audio-src.c b/src/empathy-audio-src.c
index 9f6b9c8..3be96a9 100644
--- a/src/empathy-audio-src.c
+++ b/src/empathy-audio-src.c
@@ -157,6 +157,7 @@ operation_get_microphones_cb (pa_context *context,
mic->index = info->index;
mic->name = g_strdup (info->name);
mic->description = g_strdup (info->description);
+ mic->is_monitor = (info->monitor_of_sink != PA_INVALID_INDEX);
/* add it to the queue */
queue = g_simple_async_result_get_op_res_gpointer (result);
@@ -264,12 +265,15 @@ empathy_audio_src_source_info_cb (pa_context *context,
void *userdata)
{
EmpathyGstAudioSrc *self = userdata;
+ gboolean is_monitor;
if (eol)
return;
+ is_monitor = (info->monitor_of_sink != PA_INVALID_INDEX);
+
g_signal_emit (self, signals[MICROPHONE_ADDED], 0,
- info->index, info->name, info->description);
+ info->index, info->name, info->description, is_monitor);
}
static void
@@ -529,8 +533,8 @@ empathy_audio_src_class_init (EmpathyGstAudioSrcClass
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- _src_marshal_VOID__UINT_STRING_STRING,
- G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING);
+ _src_marshal_VOID__UINT_STRING_STRING_BOOLEAN,
+ G_TYPE_NONE, 4, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
signals[MICROPHONE_REMOVED] = g_signal_new ("microphone-removed",
G_TYPE_FROM_CLASS (empathy_audio_src_class),
diff --git a/src/empathy-audio-src.h b/src/empathy-audio-src.h
index 286a34f..05e3c46 100644
--- a/src/empathy-audio-src.h
+++ b/src/empathy-audio-src.h
@@ -67,6 +67,7 @@ typedef struct
guint index;
gchar *name;
gchar *description;
+ gboolean is_monitor;
} EmpathyAudioSrcMicrophone;
void empathy_audio_src_get_microphones_async (EmpathyGstAudioSrc *src,
diff --git a/src/empathy-mic-menu.c b/src/empathy-mic-menu.c
index a2cc34c..1053b71 100644
--- a/src/empathy-mic-menu.c
+++ b/src/empathy-mic-menu.c
@@ -241,6 +241,7 @@ empathy_mic_menu_microphone_added_cb (EmpathyGstAudioSrc *audio,
guint source_idx,
const gchar *name,
const gchar *description,
+ gboolean is_monitor,
EmpathyMicMenu *self)
{
empathy_mic_menu_add_microphone (self, name, description, source_idx);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]