]> git.0d.be Git - empathy.git/commitdiff
audio-src: add is_monitor boolean to mic struct
authorJonny Lamb <jonny.lamb@collabora.co.uk>
Thu, 28 Jul 2011 14:24:19 +0000 (15:24 +0100)
committerJonny Lamb <jonny.lamb@collabora.co.uk>
Fri, 29 Jul 2011 10:02:08 +0000 (11:02 +0100)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
src/empathy-audio-src.c
src/empathy-audio-src.h
src/empathy-mic-menu.c

index 9f6b9c86c93036ae9e8e99d137de5df6e1692251..3be96a9962f1e09d41b83c6f1e29982d93a3975b 100644 (file)
@@ -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),
index 286a34f9a7f0a8d00df8f977e66042cc531432ac..05e3c46cc769efa7bfb316edafd91f8a09f0cd31 100644 (file)
@@ -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,
index a2cc34ccf12b3fff106f8063cb4cff491655777d..1053b71298c1d76754933944ef435e1abb05584c 100644 (file)
@@ -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);