annotate pidgin/plugins/vvconfig.c @ 30904:bfc08a3c9c21

media: Add a close button to the stand-alone video configuration window. Adjusted title
author Marcus Lundblad <ml@update.uu.se>
date Tue, 31 Aug 2010 20:48:59 +0000
parents 1bf7346e5d57
children d0965a30216a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28392
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
1 /*
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
2 * Configures microphones and webcams for voice and video
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
3 * Copyright (C) 2009 Mike Ruprecht <cmaiku@gmail.com>
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
4 *
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
6 * modify it under the terms of the GNU General Public License
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
7 * as published by the Free Software Foundation; either version 2
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
8 * of the License, or (at your option) any later version.
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
9 *
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
13 * GNU General Public License for more details.
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
14 *
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
16 * along with this program; if not, write to the Free Software
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA.
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
18 */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
19 #include "internal.h"
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
20
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
21 #include "debug.h"
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
22 #include "mediamanager.h"
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
23 #include "media-gst.h"
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
24 #include "version.h"
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
25 #include "gtkplugin.h"
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
26 #include "gtkutils.h"
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
27 #include "gtkprefs.h"
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
28
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
29 #include <gst/interfaces/propertyprobe.h>
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
30
30903
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
31 /* container window for showing a stand-alone configurator */
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
32 static GtkWidget *window = NULL;
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
33
28392
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
34 static PurpleMediaElementInfo *old_video_src = NULL, *old_video_sink = NULL,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
35 *old_audio_src = NULL, *old_audio_sink = NULL;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
36
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
37 static const gchar *AUDIO_SRC_PLUGINS[] = {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
38 "alsasrc", "ALSA",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
39 /* "esdmon", "ESD", ? */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
40 "osssrc", "OSS",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
41 "pulsesrc", "PulseAudio",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
42 /* "audiotestsrc wave=silence", "Silence", */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
43 "audiotestsrc", "Test Sound",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
44 NULL
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
45 };
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
46
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
47 static const gchar *AUDIO_SINK_PLUGINS[] = {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
48 "alsasink", "ALSA",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
49 "artsdsink", "aRts",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
50 "esdsink", "ESD",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
51 "osssink", "OSS",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
52 "pulsesink", "PulseAudio",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
53 NULL
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
54 };
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
55
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
56 static const gchar *VIDEO_SRC_PLUGINS[] = {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
57 "videotestsrc", "Test Input",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
58 "dshowvideosrc","DirectDraw",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
59 "ksvideosrc", "KS Video",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
60 "qcamsrc", "Quickcam",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
61 "v4lsrc", "Video4Linux",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
62 "v4l2src", "Video4Linux2",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
63 "v4lmjpegsrc", "Video4Linux MJPEG",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
64 NULL
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
65 };
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
66
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
67 static const gchar *VIDEO_SINK_PLUGINS[] = {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
68 /* "aasink", "AALib", Didn't work for me */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
69 "directdrawsink","DirectDraw",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
70 "glimagesink", "OpenGL",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
71 "ximagesink", "X Window System",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
72 "xvimagesink", "X Window System (Xv)",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
73 NULL
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
74 };
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
75
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
76 static GList *
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
77 get_element_devices(const gchar *element_name)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
78 {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
79 GList *ret = NULL;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
80 GstElement *element;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
81 GObjectClass *klass;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
82 GstPropertyProbe *probe;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
83 const GParamSpec *pspec;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
84
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
85 if (!strcmp(element_name, "<custom>")) {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
86 ret = g_list_prepend(ret, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
87 ret = g_list_prepend(ret, (gpointer)_("Default"));
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
88 ret = g_list_prepend(ret, "");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
89 return ret;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
90 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
91
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
92 ret = g_list_prepend(ret, (gpointer)_("Default"));
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
93 ret = g_list_prepend(ret, "");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
94
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
95 if (*element_name == '\0') {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
96 ret = g_list_prepend(ret, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
97 ret = g_list_reverse(ret);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
98 return ret;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
99 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
100
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
101 element = gst_element_factory_make(element_name, "test");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
102 klass = G_OBJECT_GET_CLASS (element);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
103 if (!g_object_class_find_property(klass, "device") ||
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
104 !GST_IS_PROPERTY_PROBE(element) ||
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
105 !(probe = GST_PROPERTY_PROBE(element)) ||
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
106 !(pspec = gst_property_probe_get_property(probe, "device"))) {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
107 purple_debug_info("vvconfig", "'%s' - no device\n", element_name);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
108 } else {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
109 gint n;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
110 GValueArray *array;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
111
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
112 /* Set autoprobe[-fps] to FALSE to avoid delays when probing. */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
113 if (g_object_class_find_property (klass, "autoprobe")) {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
114 g_object_set (G_OBJECT (element), "autoprobe", FALSE, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
115 if (g_object_class_find_property (klass, "autoprobe-fps")) {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
116 g_object_set (G_OBJECT (element), "autoprobe-fps", FALSE, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
117 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
118 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
119
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
120 array = gst_property_probe_probe_and_get_values (probe, pspec);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
121 if (array == NULL) {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
122 purple_debug_info("vvconfig", "'%s' has no devices\n", element_name);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
123 ret = g_list_prepend(ret, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
124 ret = g_list_reverse(ret);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
125 return ret;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
126 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
127
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
128 for (n=0; n < array->n_values; ++n) {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
129 GValue *device;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
130 const gchar *name;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
131 const gchar *device_name;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
132
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
133 device = g_value_array_get_nth(array, n);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
134 g_object_set_property(G_OBJECT(element), "device", device);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
135 if (gst_element_set_state(element, GST_STATE_READY)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
136 != GST_STATE_CHANGE_SUCCESS) {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
137 purple_debug_warning("vvconfig",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
138 "Error changing state of %s\n",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
139 element_name);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
140 continue;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
141 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
142
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
143 g_object_get(G_OBJECT(element), "device-name", &name, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
144 device_name = g_value_get_string(device);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
145 if (name == NULL)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
146 name = _("Unknown");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
147 purple_debug_info("vvconfig", "Found device %s : %s for %s\n",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
148 device_name, name, element_name);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
149 ret = g_list_prepend(ret, (gpointer)name);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
150 ret = g_list_prepend(ret, (gpointer)device_name);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
151 gst_element_set_state(element, GST_STATE_NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
152 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
153 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
154 gst_object_unref(element);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
155
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
156 ret = g_list_prepend(ret, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
157 ret = g_list_reverse(ret);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
158
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
159 return ret;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
160 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
161
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
162 static GList *
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
163 get_element_plugins(const gchar **plugins)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
164 {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
165 GList *ret = NULL;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
166
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
167 ret = g_list_prepend(ret, "Default");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
168 ret = g_list_prepend(ret, "");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
169 for (; plugins[0] && plugins[1]; plugins += 2) {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
170 if (gst_default_registry_check_feature_version(
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
171 plugins[0], 0, 0, 0)) {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
172 ret = g_list_prepend(ret, (gpointer)plugins[1]);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
173 ret = g_list_prepend(ret, (gpointer)plugins[0]);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
174 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
175 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
176 ret = g_list_prepend(ret, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
177 ret = g_list_reverse(ret);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
178 return ret;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
179 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
180
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
181 static void
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
182 device_changed_cb(const gchar *name, PurplePrefType type,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
183 gconstpointer value, gpointer data)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
184 {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
185 GtkSizeGroup *sg = data;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
186 GtkWidget *parent, *widget;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
187 GSList *widgets;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
188 GList *devices;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
189 GValue gvalue;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
190 gint position;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
191 gchar *label, *pref;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
192
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
193 widgets = gtk_size_group_get_widgets(GTK_SIZE_GROUP(sg));
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
194 for (; widgets; widgets = g_slist_next(widgets)) {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
195 const gchar *widget_name =
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
196 gtk_widget_get_name(GTK_WIDGET(widgets->data));
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
197 if (!strcmp(widget_name, name)) {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
198 gchar *temp_str;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
199 gchar delimiters[3] = {0, 0, 0};
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
200 const gchar *text;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
201 gint keyval, pos;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
202
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
203 widget = widgets->data;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
204 /* Get label with _ from the GtkLabel */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
205 text = gtk_label_get_text(GTK_LABEL(widget));
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
206 keyval = gtk_label_get_mnemonic_keyval(GTK_LABEL(widget));
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
207 delimiters[0] = g_ascii_tolower(keyval);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
208 delimiters[1] = g_ascii_toupper(keyval);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
209 pos = strcspn(text, delimiters);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
210 if (pos != -1) {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
211 temp_str = g_strndup(text, pos);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
212 label = g_strconcat(temp_str, "_",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
213 text + pos, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
214 g_free(temp_str);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
215 } else {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
216 label = g_strdup(text);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
217 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
218 break;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
219 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
220 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
221
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
222 if (widgets == NULL)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
223 return;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
224
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
225 parent = gtk_widget_get_parent(widget);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
226 widget = parent;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
227 parent = gtk_widget_get_parent(GTK_WIDGET(widget));
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
228 gvalue.g_type = 0;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
229 g_value_init(&gvalue, G_TYPE_INT);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
230 gtk_container_child_get_property(GTK_CONTAINER(parent),
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
231 GTK_WIDGET(widget), "position", &gvalue);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
232 position = g_value_get_int(&gvalue);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
233 g_value_unset(&gvalue);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
234 gtk_widget_destroy(widget);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
235
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
236 pref = g_strdup(name);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
237 strcpy(pref + strlen(pref) - strlen("plugin"), "device");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
238 devices = get_element_devices(value);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
239 if (g_list_find(devices, purple_prefs_get_string(pref)) == NULL)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
240 purple_prefs_set_string(pref, g_list_next(devices)->data);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
241 widget = pidgin_prefs_dropdown_from_list(parent,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
242 label, PURPLE_PREF_STRING,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
243 pref, devices);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
244 g_list_free(devices);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
245 g_signal_connect_swapped(widget, "destroy",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
246 G_CALLBACK(g_free), pref);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
247 g_free(label);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
248 gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
249 gtk_widget_set_name(widget, name);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
250 gtk_size_group_add_widget(sg, widget);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
251 gtk_box_reorder_child(GTK_BOX(parent),
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
252 gtk_widget_get_parent(GTK_WIDGET(widget)), position);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
253 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
254
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
255 static void
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
256 get_plugin_frame(GtkWidget *parent, GtkSizeGroup *sg,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
257 const gchar *name, const gchar *plugin_label,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
258 const gchar **plugin_strs, const gchar *plugin_pref,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
259 const gchar *device_label, const gchar *device_pref)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
260 {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
261 GtkWidget *vbox, *widget;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
262 GList *plugins, *devices;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
263
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
264 vbox = pidgin_make_frame(parent, name);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
265
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
266 /* Setup plugin preference */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
267 plugins = get_element_plugins(plugin_strs);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
268 widget = pidgin_prefs_dropdown_from_list(vbox, plugin_label,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
269 PURPLE_PREF_STRING, plugin_pref, plugins);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
270 g_list_free(plugins);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
271 gtk_size_group_add_widget(sg, widget);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
272 gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
273
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
274 /* Setup device preference */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
275 devices = get_element_devices(purple_prefs_get_string(plugin_pref));
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
276 if (g_list_find(devices, purple_prefs_get_string(device_pref)) == NULL)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
277 purple_prefs_set_string(device_pref, g_list_next(devices)->data);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
278 widget = pidgin_prefs_dropdown_from_list(vbox, device_label,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
279 PURPLE_PREF_STRING, device_pref, devices);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
280 g_list_free(devices);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
281 gtk_widget_set_name(widget, plugin_pref);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
282 gtk_size_group_add_widget(sg, widget);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
283 gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
284
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
285 purple_prefs_connect_callback(vbox, plugin_pref,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
286 device_changed_cb, sg);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
287 g_signal_connect_swapped(vbox, "destroy",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
288 G_CALLBACK(purple_prefs_disconnect_by_handle), vbox);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
289 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
290
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
291 static GtkWidget *
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
292 get_plugin_config_frame(PurplePlugin *plugin) {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
293 GtkWidget *notebook, *vbox_audio, *vbox_video;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
294 GtkSizeGroup *sg;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
295
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
296 notebook = gtk_notebook_new();
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
297 gtk_container_set_border_width(GTK_CONTAINER(notebook),
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
298 PIDGIN_HIG_BORDER);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
299 gtk_widget_show(notebook);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
300
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
301 vbox_audio = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
302 vbox_video = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
303 gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
304 vbox_audio, gtk_label_new(_("Audio")));
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
305 gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
306 vbox_video, gtk_label_new(_("Video")));
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
307 gtk_container_set_border_width(GTK_CONTAINER (vbox_audio),
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
308 PIDGIN_HIG_BORDER);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
309 gtk_container_set_border_width(GTK_CONTAINER (vbox_video),
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
310 PIDGIN_HIG_BORDER);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
311
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
312 gtk_widget_show(vbox_audio);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
313 gtk_widget_show(vbox_video);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
314
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
315 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
316
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
317 get_plugin_frame(vbox_audio, sg, _("Output"), _("_Plugin"), AUDIO_SINK_PLUGINS,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
318 "/plugins/core/vvconfig/audio/sink/plugin", _("_Device"),
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
319 "/plugins/core/vvconfig/audio/sink/device");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
320 get_plugin_frame(vbox_audio, sg, _("Input"), _("P_lugin"), AUDIO_SRC_PLUGINS,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
321 "/plugins/core/vvconfig/audio/src/plugin", _("D_evice"),
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
322 "/plugins/core/vvconfig/audio/src/device");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
323
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
324 get_plugin_frame(vbox_video, sg, _("Output"), _("_Plugin"), VIDEO_SINK_PLUGINS,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
325 "/plugins/gtk/vvconfig/video/sink/plugin", _("_Device"),
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
326 "/plugins/gtk/vvconfig/video/sink/device");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
327 get_plugin_frame(vbox_video, sg, _("Input"), _("P_lugin"), VIDEO_SRC_PLUGINS,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
328 "/plugins/core/vvconfig/video/src/plugin", _("D_evice"),
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
329 "/plugins/core/vvconfig/video/src/device");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
330
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
331 return notebook;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
332 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
333
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
334 static GstElement *
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
335 create_video_src(PurpleMedia *media,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
336 const gchar *session_id, const gchar *participant)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
337 {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
338 const gchar *plugin = purple_prefs_get_string(
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
339 "/plugins/core/vvconfig/video/src/plugin");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
340 const gchar *device = purple_prefs_get_string(
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
341 "/plugins/core/vvconfig/video/src/device");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
342 GstElement *ret;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
343
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
344 if (plugin[0] == '\0')
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
345 return purple_media_element_info_call_create(old_video_src,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
346 media, session_id, participant);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
347
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
348 ret = gst_element_factory_make(plugin, "vvconfig-videosrc");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
349 if (device[0] != '\0')
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
350 g_object_set(G_OBJECT(ret), "device", device, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
351 if (!strcmp(plugin, "videotestsrc"))
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
352 g_object_set(G_OBJECT(ret), "is-live", 1, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
353 return ret;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
354 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
355
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
356 static GstElement *
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
357 create_video_sink(PurpleMedia *media,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
358 const gchar *session_id, const gchar *participant)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
359 {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
360 const gchar *plugin = purple_prefs_get_string(
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
361 "/plugins/gtk/vvconfig/video/sink/plugin");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
362 const gchar *device = purple_prefs_get_string(
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
363 "/plugins/gtk/vvconfig/video/sink/device");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
364 GstElement *ret;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
365
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
366 if (plugin[0] == '\0')
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
367 return purple_media_element_info_call_create(old_video_sink,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
368 media, session_id, participant);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
369
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
370 ret = gst_element_factory_make(plugin, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
371 if (device[0] != '\0')
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
372 g_object_set(G_OBJECT(ret), "device", device, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
373 return ret;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
374 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
375
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
376 static GstElement *
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
377 create_audio_src(PurpleMedia *media,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
378 const gchar *session_id, const gchar *participant)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
379 {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
380 const gchar *plugin = purple_prefs_get_string(
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
381 "/plugins/core/vvconfig/audio/src/plugin");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
382 const gchar *device = purple_prefs_get_string(
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
383 "/plugins/core/vvconfig/audio/src/device");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
384 GstElement *ret;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
385
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
386 if (plugin[0] == '\0')
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
387 return purple_media_element_info_call_create(old_audio_src,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
388 media, session_id, participant);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
389
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
390 ret = gst_element_factory_make(plugin, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
391 if (device[0] != '\0')
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
392 g_object_set(G_OBJECT(ret), "device", device, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
393 return ret;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
394 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
395
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
396 static GstElement *
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
397 create_audio_sink(PurpleMedia *media,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
398 const gchar *session_id, const gchar *participant)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
399 {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
400 const gchar *plugin = purple_prefs_get_string(
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
401 "/plugins/core/vvconfig/audio/sink/plugin");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
402 const gchar *device = purple_prefs_get_string(
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
403 "/plugins/core/vvconfig/audio/sink/device");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
404 GstElement *ret;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
405
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
406 if (plugin[0] == '\0')
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
407 return purple_media_element_info_call_create(old_audio_sink,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
408 media, session_id, participant);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
409
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
410 ret = gst_element_factory_make(plugin, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
411 if (device[0] != '\0')
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
412 g_object_set(G_OBJECT(ret), "device", device, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
413 return ret;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
414 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
415
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
416 static void
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
417 set_element_info_cond(PurpleMediaElementInfo *old_info,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
418 PurpleMediaElementInfo *new_info, const gchar *id)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
419 {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
420 gchar *element_id = purple_media_element_info_get_id(old_info);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
421 if (!strcmp(element_id, id))
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
422 purple_media_manager_set_active_element(
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
423 purple_media_manager_get(), new_info);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
424 g_free(element_id);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
425 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
426
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
427 static gboolean
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
428 plugin_load(PurplePlugin *plugin)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
429 {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
430 PurpleMediaManager *manager;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
431 PurpleMediaElementInfo *video_src, *video_sink,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
432 *audio_src, *audio_sink;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
433
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
434 /* Disable the plugin if the UI doesn't support VV */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
435 if (purple_media_manager_get_ui_caps(purple_media_manager_get()) ==
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
436 PURPLE_MEDIA_CAPS_NONE)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
437 return FALSE;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
438
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
439 purple_prefs_add_none("/plugins/core/vvconfig");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
440 purple_prefs_add_none("/plugins/core/vvconfig/audio");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
441 purple_prefs_add_none("/plugins/core/vvconfig/audio/src");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
442 purple_prefs_add_string("/plugins/core/vvconfig/audio/src/plugin", "");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
443 purple_prefs_add_string("/plugins/core/vvconfig/audio/src/device", "");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
444 purple_prefs_add_none("/plugins/core/vvconfig/audio/sink");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
445 purple_prefs_add_string("/plugins/core/vvconfig/audio/sink/plugin", "");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
446 purple_prefs_add_string("/plugins/core/vvconfig/audio/sink/device", "");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
447 purple_prefs_add_none("/plugins/core/vvconfig/video");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
448 purple_prefs_add_none("/plugins/core/vvconfig/video/src");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
449 purple_prefs_add_string("/plugins/core/vvconfig/video/src/plugin", "");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
450 purple_prefs_add_string("/plugins/core/vvconfig/video/src/device", "");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
451 purple_prefs_add_none("/plugins/gtk/vvconfig");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
452 purple_prefs_add_none("/plugins/gtk/vvconfig/video");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
453 purple_prefs_add_none("/plugins/gtk/vvconfig/video/sink");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
454 purple_prefs_add_string("/plugins/gtk/vvconfig/video/sink/plugin", "");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
455 purple_prefs_add_string("/plugins/gtk/vvconfig/video/sink/device", "");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
456
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
457 video_src = g_object_new(PURPLE_TYPE_MEDIA_ELEMENT_INFO,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
458 "id", "vvconfig-videosrc",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
459 "name", "VV Conf Plugin Video Source",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
460 "type", PURPLE_MEDIA_ELEMENT_VIDEO
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
461 | PURPLE_MEDIA_ELEMENT_SRC
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
462 | PURPLE_MEDIA_ELEMENT_ONE_SRC
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
463 | PURPLE_MEDIA_ELEMENT_UNIQUE,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
464 "create-cb", create_video_src, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
465 video_sink = g_object_new(PURPLE_TYPE_MEDIA_ELEMENT_INFO,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
466 "id", "vvconfig-videosink",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
467 "name", "VV Conf Plugin Video Sink",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
468 "type", PURPLE_MEDIA_ELEMENT_VIDEO
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
469 | PURPLE_MEDIA_ELEMENT_SINK
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
470 | PURPLE_MEDIA_ELEMENT_ONE_SINK,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
471 "create-cb", create_video_sink, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
472 audio_src = g_object_new(PURPLE_TYPE_MEDIA_ELEMENT_INFO,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
473 "id", "vvconfig-audiosrc",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
474 "name", "VV Conf Plugin Audio Source",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
475 "type", PURPLE_MEDIA_ELEMENT_AUDIO
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
476 | PURPLE_MEDIA_ELEMENT_SRC
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
477 | PURPLE_MEDIA_ELEMENT_ONE_SRC
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
478 | PURPLE_MEDIA_ELEMENT_UNIQUE,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
479 "create-cb", create_audio_src, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
480 audio_sink = g_object_new(PURPLE_TYPE_MEDIA_ELEMENT_INFO,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
481 "id", "vvconfig-audiosink",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
482 "name", "VV Conf Plugin Audio Sink",
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
483 "type", PURPLE_MEDIA_ELEMENT_AUDIO
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
484 | PURPLE_MEDIA_ELEMENT_SINK
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
485 | PURPLE_MEDIA_ELEMENT_ONE_SINK,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
486 "create-cb", create_audio_sink, NULL);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
487
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
488 purple_debug_info("gtkmedia", "Registering media element types\n");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
489 manager = purple_media_manager_get();
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
490
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
491 old_video_src = purple_media_manager_get_active_element(manager,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
492 PURPLE_MEDIA_ELEMENT_VIDEO | PURPLE_MEDIA_ELEMENT_SRC);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
493 old_video_sink = purple_media_manager_get_active_element(manager,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
494 PURPLE_MEDIA_ELEMENT_VIDEO | PURPLE_MEDIA_ELEMENT_SINK);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
495 old_audio_src = purple_media_manager_get_active_element(manager,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
496 PURPLE_MEDIA_ELEMENT_AUDIO | PURPLE_MEDIA_ELEMENT_SRC);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
497 old_audio_sink = purple_media_manager_get_active_element(manager,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
498 PURPLE_MEDIA_ELEMENT_AUDIO | PURPLE_MEDIA_ELEMENT_SINK);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
499
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
500 set_element_info_cond(old_video_src, video_src, "pidgindefaultvideosrc");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
501 set_element_info_cond(old_video_sink, video_sink, "pidgindefaultvideosink");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
502 set_element_info_cond(old_audio_src, audio_src, "pidgindefaultaudiosrc");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
503 set_element_info_cond(old_audio_sink, audio_sink, "pidgindefaultaudiosink");
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
504
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
505 return TRUE;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
506 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
507
30903
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
508 static void
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
509 config_destroy(GtkObject *w, gpointer nul)
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
510 {
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
511 purple_debug_info("vvconfig", "closing vv configuration window\n");
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
512 window = NULL;
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
513 }
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
514
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
515 static void
30904
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
516 config_close(GtkObject *w, gpointer nul)
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
517 {
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
518 gtk_widget_destroy(GTK_WIDGET(window));
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
519 }
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
520
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
521 static void
30903
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
522 show_config(PurplePluginAction *action)
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
523 {
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
524 if (!window) {
30904
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
525 GtkWidget *vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER);
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
526 GtkWidget *hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER);
30903
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
527 GtkWidget *config_frame = get_plugin_config_frame(NULL);
30904
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
528 GtkWidget *close = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
529
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
530 gtk_container_add(GTK_CONTAINER(vbox), config_frame);
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
531 gtk_container_add(GTK_CONTAINER(vbox), hbox);
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
532 window = pidgin_create_window(_("Voice/Video Settings"),
30903
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
533 PIDGIN_HIG_BORDER, NULL, TRUE);
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
534 g_signal_connect(G_OBJECT(window), "destroy",
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
535 G_CALLBACK(config_destroy), NULL);
30904
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
536 g_signal_connect(G_OBJECT(close), "clicked",
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
537 G_CALLBACK(config_close), NULL);
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
538 gtk_box_pack_end(GTK_BOX(hbox), close, FALSE, FALSE, PIDGIN_HIG_BORDER);
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
539 gtk_container_add(GTK_CONTAINER(window), vbox);
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
540 gtk_widget_show(GTK_WIDGET(close));
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
541 gtk_widget_show(GTK_WIDGET(vbox));
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
542 gtk_widget_show(GTK_WIDGET(hbox));
30903
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
543 }
30904
bfc08a3c9c21 media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <ml@update.uu.se>
parents: 30903
diff changeset
544 gtk_window_present(GTK_WINDOW(window));
30903
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
545 }
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
546
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
547
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
548 static GList *
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
549 actions(PurplePlugin *plugin, gpointer context)
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
550 {
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
551 GList *l = NULL;
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
552 PurplePluginAction *act = NULL;
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
553
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
554 act = purple_plugin_action_new(_("Voice and Video Settings"),
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
555 show_config);
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
556 l = g_list_append(l, act);
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
557
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
558 return l;
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
559 }
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
560
28392
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
561 static gboolean
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
562 plugin_unload(PurplePlugin *plugin)
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
563 {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
564 PurpleMediaManager *manager = purple_media_manager_get();
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
565 purple_media_manager_set_active_element(manager, old_video_src);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
566 purple_media_manager_set_active_element(manager, old_video_sink);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
567 purple_media_manager_set_active_element(manager, old_audio_src);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
568 purple_media_manager_set_active_element(manager, old_audio_sink);
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
569 return TRUE;
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
570 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
571
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
572 static PidginPluginUiInfo ui_info = {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
573 get_plugin_config_frame,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
574 0, /* page_num (Reserved) */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
575 /* Padding */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
576 NULL,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
577 NULL,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
578 NULL,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
579 NULL
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
580 };
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
581
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
582 static PurplePluginInfo info =
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
583 {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
584 PURPLE_PLUGIN_MAGIC, /**< magic */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
585 PURPLE_MAJOR_VERSION, /**< major version */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
586 PURPLE_MINOR_VERSION, /**< minor version */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
587 PURPLE_PLUGIN_STANDARD, /**< type */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
588 PIDGIN_PLUGIN_TYPE, /**< ui_requirement */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
589 0, /**< flags */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
590 NULL, /**< dependencies */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
591 PURPLE_PRIORITY_DEFAULT, /**< priority */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
592
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
593 "gtk-maiku-vvconfig", /**< id */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
594 N_("Voice/Video Settings"), /**< name */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
595 DISPLAY_VERSION, /**< version */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
596 N_("Configure your microphone and webcam."), /**< summary */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
597 N_("Configure microphone and webcam "
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
598 "settings for voice/video calls."), /**< description */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
599 "Mike Ruprecht <cmaiku@gmail.com>", /**< author */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
600 PURPLE_WEBSITE, /**< homepage */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
601
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
602 plugin_load, /**< load */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
603 plugin_unload, /**< unload */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
604 NULL, /**< destroy */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
605
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
606 &ui_info, /**< ui_info */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
607 NULL, /**< extra_info */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
608 NULL, /**< prefs_info */
30903
1bf7346e5d57 media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents: 28392
diff changeset
609 actions, /**< actions */
28392
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
610
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
611 /* padding */
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
612 NULL,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
613 NULL,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
614 NULL,
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
615 NULL
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
616 };
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
617
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
618 static void
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
619 init_plugin(PurplePlugin *plugin) {
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
620 }
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
621
33e8d40ae6ec Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff changeset
622 PURPLE_INIT_PLUGIN(vvconfig, init_plugin, info)