aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2011-07-28 22:24:19 +0800
committerJonny Lamb <jonny.lamb@collabora.co.uk>2011-07-29 18:02:08 +0800
commit90eaac49d3f279ae20fa061adbe8ba9ac8aaf023 (patch)
tree09e53ca8359f839d8dfd3315b6427bd254a87c75 /src
parenta36214f589404b37c6125b0a3faa756f9e001cd6 (diff)
downloadgsoc2013-empathy-90eaac49d3f279ae20fa061adbe8ba9ac8aaf023.tar
gsoc2013-empathy-90eaac49d3f279ae20fa061adbe8ba9ac8aaf023.tar.gz
gsoc2013-empathy-90eaac49d3f279ae20fa061adbe8ba9ac8aaf023.tar.bz2
gsoc2013-empathy-90eaac49d3f279ae20fa061adbe8ba9ac8aaf023.tar.lz
gsoc2013-empathy-90eaac49d3f279ae20fa061adbe8ba9ac8aaf023.tar.xz
gsoc2013-empathy-90eaac49d3f279ae20fa061adbe8ba9ac8aaf023.tar.zst
gsoc2013-empathy-90eaac49d3f279ae20fa061adbe8ba9ac8aaf023.zip
audio-src: add is_monitor boolean to mic struct
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/empathy-audio-src.c10
-rw-r--r--src/empathy-audio-src.h1
-rw-r--r--src/empathy-mic-menu.c1
3 files changed, 9 insertions, 3 deletions
diff --git a/src/empathy-audio-src.c b/src/empathy-audio-src.c
index 9f6b9c86c..3be96a996 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 286a34f9a..05e3c46cc 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 a2cc34ccf..1053b7129 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);