Mercurial > pidgin.yaz
annotate pidgin/plugins/vvconfig.c @ 32702:78fae2fc38d5
More code changed to use the accessor functions.
author | andrew.victor@mxit.com |
---|---|
date | Sat, 01 Oct 2011 15:50:20 +0000 |
parents | eca71aa27e21 |
children |
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 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
|
86 ret = g_list_prepend(ret, ""); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
87 |
31601
2b63df6e495c
vvconfig: Don't crash when the stored device isn't found in the list of
jakub.adam@ktknet.cz
parents:
31534
diff
changeset
|
88 if (!strcmp(element_name, "<custom>") || (*element_name == '\0')) { |
2b63df6e495c
vvconfig: Don't crash when the stored device isn't found in the list of
jakub.adam@ktknet.cz
parents:
31534
diff
changeset
|
89 return g_list_reverse(ret); |
28392
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 element = gst_element_factory_make(element_name, "test"); |
31934
eca71aa27e21
Fix another vvconfig crash. Fixes #13290, #13774.
pat@erley.org
parents:
31874
diff
changeset
|
93 if(!element) { |
eca71aa27e21
Fix another vvconfig crash. Fixes #13290, #13774.
pat@erley.org
parents:
31874
diff
changeset
|
94 purple_debug_info("vvconfig", "'%s' - unable to find element\n", element_name); |
eca71aa27e21
Fix another vvconfig crash. Fixes #13290, #13774.
pat@erley.org
parents:
31874
diff
changeset
|
95 return g_list_reverse(ret); |
eca71aa27e21
Fix another vvconfig crash. Fixes #13290, #13774.
pat@erley.org
parents:
31874
diff
changeset
|
96 } |
eca71aa27e21
Fix another vvconfig crash. Fixes #13290, #13774.
pat@erley.org
parents:
31874
diff
changeset
|
97 |
28392
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
98 klass = G_OBJECT_GET_CLASS (element); |
31934
eca71aa27e21
Fix another vvconfig crash. Fixes #13290, #13774.
pat@erley.org
parents:
31874
diff
changeset
|
99 if(!klass) { |
eca71aa27e21
Fix another vvconfig crash. Fixes #13290, #13774.
pat@erley.org
parents:
31874
diff
changeset
|
100 purple_debug_info("vvconfig", "'%s' - unable to find G_Object Class\n", element_name); |
eca71aa27e21
Fix another vvconfig crash. Fixes #13290, #13774.
pat@erley.org
parents:
31874
diff
changeset
|
101 return g_list_reverse(ret); |
eca71aa27e21
Fix another vvconfig crash. Fixes #13290, #13774.
pat@erley.org
parents:
31874
diff
changeset
|
102 } |
eca71aa27e21
Fix another vvconfig crash. Fixes #13290, #13774.
pat@erley.org
parents:
31874
diff
changeset
|
103 |
28392
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
104 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
|
105 !GST_IS_PROPERTY_PROBE(element) || |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
106 !(probe = GST_PROPERTY_PROBE(element)) || |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
107 !(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
|
108 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
|
109 } else { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
110 gint n; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
111 GValueArray *array; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
112 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
113 /* 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
|
114 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
|
115 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
|
116 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
|
117 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
|
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 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
121 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
|
122 if (array == NULL) { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
123 purple_debug_info("vvconfig", "'%s' has no devices\n", element_name); |
31601
2b63df6e495c
vvconfig: Don't crash when the stored device isn't found in the list of
jakub.adam@ktknet.cz
parents:
31534
diff
changeset
|
124 return g_list_reverse(ret); |
28392
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
125 } |
31534
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31524
diff
changeset
|
126 |
28392
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
127 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
|
128 GValue *device; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
129 const gchar *name; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
130 const gchar *device_name; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
131 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
132 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
|
133 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
|
134 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
|
135 != GST_STATE_CHANGE_SUCCESS) { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
136 purple_debug_warning("vvconfig", |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
137 "Error changing state of %s\n", |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
138 element_name); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
139 continue; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
140 } |
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 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
|
143 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
|
144 if (name == NULL) |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
145 name = _("Unknown"); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
146 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
|
147 device_name, name, element_name); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
148 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
|
149 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
|
150 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
|
151 } |
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 gst_object_unref(element); |
31534
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31524
diff
changeset
|
154 |
31601
2b63df6e495c
vvconfig: Don't crash when the stored device isn't found in the list of
jakub.adam@ktknet.cz
parents:
31534
diff
changeset
|
155 return g_list_reverse(ret); |
28392
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
156 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
157 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
158 static GList * |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
159 get_element_plugins(const gchar **plugins) |
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 GList *ret = NULL; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
162 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
163 ret = g_list_prepend(ret, "Default"); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
164 ret = g_list_prepend(ret, ""); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
165 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
|
166 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
|
167 plugins[0], 0, 0, 0)) { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
168 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
|
169 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
|
170 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
171 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
172 ret = g_list_reverse(ret); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
173 return ret; |
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 static void |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
177 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
|
178 gconstpointer value, gpointer data) |
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 GtkSizeGroup *sg = data; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
181 GtkWidget *parent, *widget; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
182 GSList *widgets; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
183 GList *devices; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
184 GValue gvalue; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
185 gint position; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
186 gchar *label, *pref; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
187 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
188 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
|
189 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
|
190 const gchar *widget_name = |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
191 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
|
192 if (!strcmp(widget_name, name)) { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
193 gchar *temp_str; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
194 gchar delimiters[3] = {0, 0, 0}; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
195 const gchar *text; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
196 gint keyval, pos; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
197 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
198 widget = widgets->data; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
199 /* Get label with _ from the GtkLabel */ |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
200 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
|
201 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
|
202 delimiters[0] = g_ascii_tolower(keyval); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
203 delimiters[1] = g_ascii_toupper(keyval); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
204 pos = strcspn(text, delimiters); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
205 if (pos != -1) { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
206 temp_str = g_strndup(text, pos); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
207 label = g_strconcat(temp_str, "_", |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
208 text + pos, NULL); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
209 g_free(temp_str); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
210 } else { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
211 label = g_strdup(text); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
212 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
213 break; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
214 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
215 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
216 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
217 if (widgets == NULL) |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
218 return; |
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 parent = gtk_widget_get_parent(widget); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
221 widget = parent; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
222 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
|
223 gvalue.g_type = 0; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
224 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
|
225 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
|
226 GTK_WIDGET(widget), "position", &gvalue); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
227 position = g_value_get_int(&gvalue); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
228 g_value_unset(&gvalue); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
229 gtk_widget_destroy(widget); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
230 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
231 pref = g_strdup(name); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
232 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
|
233 devices = get_element_devices(value); |
31601
2b63df6e495c
vvconfig: Don't crash when the stored device isn't found in the list of
jakub.adam@ktknet.cz
parents:
31534
diff
changeset
|
234 if (g_list_find_custom(devices, purple_prefs_get_string(pref), |
2b63df6e495c
vvconfig: Don't crash when the stored device isn't found in the list of
jakub.adam@ktknet.cz
parents:
31534
diff
changeset
|
235 (GCompareFunc)strcmp) == NULL) |
28392
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
236 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
|
237 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
|
238 label, PURPLE_PREF_STRING, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
239 pref, devices); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
240 g_list_free(devices); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
241 g_signal_connect_swapped(widget, "destroy", |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
242 G_CALLBACK(g_free), pref); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
243 g_free(label); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
244 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
|
245 gtk_widget_set_name(widget, name); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
246 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
|
247 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
|
248 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
|
249 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
250 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
251 static void |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
252 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
|
253 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
|
254 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
|
255 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
|
256 { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
257 GtkWidget *vbox, *widget; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
258 GList *plugins, *devices; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
259 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
260 vbox = pidgin_make_frame(parent, name); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
261 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
262 /* Setup plugin preference */ |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
263 plugins = get_element_plugins(plugin_strs); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
264 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
|
265 PURPLE_PREF_STRING, plugin_pref, plugins); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
266 g_list_free(plugins); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
267 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
|
268 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
|
269 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
270 /* Setup device preference */ |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
271 devices = get_element_devices(purple_prefs_get_string(plugin_pref)); |
31524
25bbabd11c91
vvconfig: Stop resetting device selections to defaults. Fixes #13044.
jakub.adam@ktknet.cz
parents:
30914
diff
changeset
|
272 if (g_list_find_custom(devices, purple_prefs_get_string(device_pref), |
25bbabd11c91
vvconfig: Stop resetting device selections to defaults. Fixes #13044.
jakub.adam@ktknet.cz
parents:
30914
diff
changeset
|
273 (GCompareFunc) strcmp) == NULL) |
28392
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
274 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
|
275 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
|
276 PURPLE_PREF_STRING, device_pref, devices); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
277 g_list_free(devices); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
278 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
|
279 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
|
280 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
|
281 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
282 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
|
283 device_changed_cb, sg); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
284 g_signal_connect_swapped(vbox, "destroy", |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
285 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
|
286 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
287 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
288 static GtkWidget * |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
289 get_plugin_config_frame(PurplePlugin *plugin) { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
290 GtkWidget *notebook, *vbox_audio, *vbox_video; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
291 GtkSizeGroup *sg; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
292 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
293 notebook = gtk_notebook_new(); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
294 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
|
295 PIDGIN_HIG_BORDER); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
296 gtk_widget_show(notebook); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
297 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
298 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
|
299 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
|
300 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
|
301 vbox_audio, gtk_label_new(_("Audio"))); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
302 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
|
303 vbox_video, gtk_label_new(_("Video"))); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
304 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
|
305 PIDGIN_HIG_BORDER); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
306 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
|
307 PIDGIN_HIG_BORDER); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
308 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
309 gtk_widget_show(vbox_audio); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
310 gtk_widget_show(vbox_video); |
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 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
|
313 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
314 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
|
315 "/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
|
316 "/plugins/core/vvconfig/audio/sink/device"); |
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, _("Input"), _("P_lugin"), AUDIO_SRC_PLUGINS, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
318 "/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
|
319 "/plugins/core/vvconfig/audio/src/device"); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
320 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
321 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
|
322 "/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
|
323 "/plugins/gtk/vvconfig/video/sink/device"); |
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, _("Input"), _("P_lugin"), VIDEO_SRC_PLUGINS, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
325 "/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
|
326 "/plugins/core/vvconfig/video/src/device"); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
327 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
328 return notebook; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
329 } |
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 static GstElement * |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
332 create_video_src(PurpleMedia *media, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
333 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
|
334 { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
335 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
|
336 "/plugins/core/vvconfig/video/src/plugin"); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
337 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
|
338 "/plugins/core/vvconfig/video/src/device"); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
339 GstElement *ret; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
340 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
341 if (plugin[0] == '\0') |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
342 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
|
343 media, session_id, participant); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
344 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
345 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
|
346 if (device[0] != '\0') |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
347 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
|
348 if (!strcmp(plugin, "videotestsrc")) |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
349 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
|
350 return ret; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
351 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
352 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
353 static GstElement * |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
354 create_video_sink(PurpleMedia *media, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
355 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
|
356 { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
357 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
|
358 "/plugins/gtk/vvconfig/video/sink/plugin"); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
359 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
|
360 "/plugins/gtk/vvconfig/video/sink/device"); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
361 GstElement *ret; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
362 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
363 if (plugin[0] == '\0') |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
364 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
|
365 media, session_id, participant); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
366 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
367 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
|
368 if (device[0] != '\0') |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
369 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
|
370 return ret; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
371 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
372 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
373 static GstElement * |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
374 create_audio_src(PurpleMedia *media, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
375 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
|
376 { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
377 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
|
378 "/plugins/core/vvconfig/audio/src/plugin"); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
379 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
|
380 "/plugins/core/vvconfig/audio/src/device"); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
381 GstElement *ret; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
382 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
383 if (plugin[0] == '\0') |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
384 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
|
385 media, session_id, participant); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
386 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
387 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
|
388 if (device[0] != '\0') |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
389 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
|
390 return ret; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
391 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
392 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
393 static GstElement * |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
394 create_audio_sink(PurpleMedia *media, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
395 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
|
396 { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
397 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
|
398 "/plugins/core/vvconfig/audio/sink/plugin"); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
399 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
|
400 "/plugins/core/vvconfig/audio/sink/device"); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
401 GstElement *ret; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
402 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
403 if (plugin[0] == '\0') |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
404 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
|
405 media, session_id, participant); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
406 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
407 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
|
408 if (device[0] != '\0') |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
409 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
|
410 return ret; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
411 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
412 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
413 static void |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
414 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
|
415 PurpleMediaElementInfo *new_info, const gchar *id) |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
416 { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
417 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
|
418 if (!strcmp(element_id, id)) |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
419 purple_media_manager_set_active_element( |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
420 purple_media_manager_get(), new_info); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
421 g_free(element_id); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
422 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
423 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
424 static gboolean |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
425 plugin_load(PurplePlugin *plugin) |
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 PurpleMediaManager *manager; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
428 PurpleMediaElementInfo *video_src, *video_sink, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
429 *audio_src, *audio_sink; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
430 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
431 /* 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
|
432 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
|
433 PURPLE_MEDIA_CAPS_NONE) |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
434 return FALSE; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
435 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
436 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
|
437 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
|
438 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
|
439 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
|
440 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
|
441 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
|
442 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
|
443 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
|
444 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
|
445 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
|
446 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
|
447 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
|
448 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
|
449 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
|
450 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
|
451 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
|
452 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
|
453 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
454 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
|
455 "id", "vvconfig-videosrc", |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
456 "name", "VV Conf Plugin Video Source", |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
457 "type", PURPLE_MEDIA_ELEMENT_VIDEO |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
458 | PURPLE_MEDIA_ELEMENT_SRC |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
459 | PURPLE_MEDIA_ELEMENT_ONE_SRC |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
460 | PURPLE_MEDIA_ELEMENT_UNIQUE, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
461 "create-cb", create_video_src, NULL); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
462 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
|
463 "id", "vvconfig-videosink", |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
464 "name", "VV Conf Plugin Video Sink", |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
465 "type", PURPLE_MEDIA_ELEMENT_VIDEO |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
466 | PURPLE_MEDIA_ELEMENT_SINK |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
467 | PURPLE_MEDIA_ELEMENT_ONE_SINK, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
468 "create-cb", create_video_sink, NULL); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
469 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
|
470 "id", "vvconfig-audiosrc", |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
471 "name", "VV Conf Plugin Audio Source", |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
472 "type", PURPLE_MEDIA_ELEMENT_AUDIO |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
473 | PURPLE_MEDIA_ELEMENT_SRC |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
474 | PURPLE_MEDIA_ELEMENT_ONE_SRC |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
475 | PURPLE_MEDIA_ELEMENT_UNIQUE, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
476 "create-cb", create_audio_src, NULL); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
477 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
|
478 "id", "vvconfig-audiosink", |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
479 "name", "VV Conf Plugin Audio Sink", |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
480 "type", PURPLE_MEDIA_ELEMENT_AUDIO |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
481 | PURPLE_MEDIA_ELEMENT_SINK |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
482 | PURPLE_MEDIA_ELEMENT_ONE_SINK, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
483 "create-cb", create_audio_sink, NULL); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
484 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
485 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
|
486 manager = purple_media_manager_get(); |
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 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
|
489 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
|
490 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
|
491 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
|
492 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
|
493 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
|
494 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
|
495 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
|
496 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
497 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
|
498 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
|
499 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
|
500 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
|
501 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
502 return TRUE; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
503 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
504 |
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
|
505 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
|
506 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
|
507 { |
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 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
|
509 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
|
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 |
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 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
|
513 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
|
514 { |
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
|
515 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
|
516 } |
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 |
31874
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
518 typedef GtkWidget *(*FrameCreateCb)(PurplePlugin *plugin); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
519 |
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
|
520 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
|
521 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
|
522 { |
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 if (!window) { |
31874
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
524 FrameCreateCb create_frame = action->user_data; |
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); |
31874
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
527 GtkWidget *config_frame = create_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); |
31534
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31524
diff
changeset
|
529 |
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
|
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); |
31874
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
532 window = pidgin_create_window(action->label, |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
533 PIDGIN_HIG_BORDER, NULL, FALSE); |
31534
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31524
diff
changeset
|
534 g_signal_connect(G_OBJECT(window), "destroy", |
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
|
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 } |
30914
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
546 |
31874
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
547 static GstElement * |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
548 create_pipeline() |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
549 { |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
550 GstElement *pipeline = gst_pipeline_new("voicetest"); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
551 GstElement *src = create_audio_src(NULL, NULL, NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
552 GstElement *sink = create_audio_sink(NULL, NULL, NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
553 GstElement *volume = gst_element_factory_make("volume", "volume"); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
554 GstElement *level = gst_element_factory_make("level", "level"); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
555 GstElement *valve = gst_element_factory_make("valve", "valve"); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
556 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
557 gst_bin_add_many(GST_BIN(pipeline), src, volume, level, valve, sink, NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
558 gst_element_link_many(src, volume, level, valve, sink, NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
559 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
560 gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
561 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
562 return pipeline; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
563 } |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
564 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
565 static void |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
566 on_volume_change_cb(GtkRange *range, GstBin *pipeline) |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
567 { |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
568 GstElement *volume; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
569 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
570 g_return_if_fail(pipeline != NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
571 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
572 volume = gst_bin_get_by_name(pipeline, "volume"); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
573 g_object_set(volume, "volume", gtk_range_get_value(range) / 10.0, NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
574 } |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
575 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
576 static gdouble |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
577 gst_msg_db_to_percent(GstMessage *msg, gchar *value_name) |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
578 { |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
579 const GValue *list; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
580 const GValue *value; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
581 gdouble value_db; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
582 gdouble percent; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
583 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
584 list = gst_structure_get_value( |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
585 gst_message_get_structure(msg), value_name); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
586 value = gst_value_list_get_value(list, 0); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
587 value_db = g_value_get_double(value); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
588 percent = pow(10, value_db / 20); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
589 return (percent > 1.0) ? 1.0 : percent; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
590 } |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
591 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
592 typedef struct |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
593 { |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
594 GtkProgressBar *level; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
595 GtkRange *threshold; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
596 } BusCbCtx; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
597 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
598 static gboolean |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
599 gst_bus_cb(GstBus *bus, GstMessage *msg, BusCbCtx *ctx) |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
600 { |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
601 if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_ELEMENT && |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
602 gst_structure_has_name(msg->structure, "level")) { |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
603 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
604 GstElement *src = GST_ELEMENT(GST_MESSAGE_SRC(msg)); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
605 gchar *name = gst_element_get_name(src); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
606 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
607 if (!strcmp(name, "level")) { |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
608 gdouble percent; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
609 gdouble threshold; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
610 GstElement *valve; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
611 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
612 percent = gst_msg_db_to_percent(msg, "rms"); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
613 gtk_progress_bar_set_fraction(ctx->level, percent * 5); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
614 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
615 percent = gst_msg_db_to_percent(msg, "decay"); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
616 threshold = gtk_range_get_value(ctx->threshold) / 100.0; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
617 valve = gst_bin_get_by_name(GST_BIN(GST_ELEMENT_PARENT(src)), "valve"); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
618 g_object_set(valve, "drop", (percent < threshold), NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
619 g_object_set(ctx->level, |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
620 "text", (percent < threshold) ? _("DROP") : " ", NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
621 } |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
622 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
623 g_free(name); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
624 } |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
625 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
626 return TRUE; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
627 } |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
628 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
629 static void |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
630 voice_test_frame_destroy_cb(GtkObject *w, GstElement *pipeline) |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
631 { |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
632 g_return_if_fail(GST_IS_ELEMENT(pipeline)); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
633 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
634 gst_element_set_state(pipeline, GST_STATE_NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
635 gst_object_unref(pipeline); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
636 } |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
637 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
638 static void |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
639 volume_scale_destroy_cb(GtkRange *volume, gpointer nul) |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
640 { |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
641 purple_prefs_set_int("/purple/media/audio/volume/input", |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
642 gtk_range_get_value(volume)); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
643 } |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
644 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
645 static gchar* |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
646 threshold_value_format_cb(GtkScale *scale, gdouble value) |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
647 { |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
648 return g_strdup_printf ("%.*f%%", gtk_scale_get_digits(scale), value); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
649 } |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
650 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
651 static void |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
652 threshold_scale_destroy_cb(GtkRange *threshold, gpointer nul) |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
653 { |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
654 purple_prefs_set_int("/purple/media/audio/silence_threshold", |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
655 gtk_range_get_value(threshold)); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
656 } |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
657 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
658 static GtkWidget * |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
659 get_voice_test_frame(PurplePlugin *plugin) |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
660 { |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
661 GtkWidget *vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
662 GtkWidget *level = gtk_progress_bar_new(); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
663 GtkWidget *volume = gtk_hscale_new_with_range(0, 100, 1); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
664 GtkWidget *threshold = gtk_hscale_new_with_range(0, 100, 1); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
665 GtkWidget *label; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
666 GtkTable *table = GTK_TABLE(gtk_table_new(2, 2, FALSE)); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
667 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
668 GstElement *pipeline; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
669 GstBus *bus; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
670 BusCbCtx *ctx; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
671 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
672 g_object_set(vbox, "width-request", 500, NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
673 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
674 gtk_table_set_row_spacings(table, PIDGIN_HIG_BOX_SPACE); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
675 gtk_table_set_col_spacings(table, PIDGIN_HIG_BOX_SPACE); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
676 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
677 label = gtk_label_new(_("Volume:")); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
678 g_object_set(label, "xalign", 0.0, NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
679 gtk_table_attach(table, label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
680 gtk_table_attach_defaults(table, volume, 1, 2, 0, 1); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
681 label = gtk_label_new(_("Silence threshold:")); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
682 g_object_set(label, "xalign", 0.0, "yalign", 1.0, NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
683 gtk_table_attach(table, label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
684 gtk_table_attach_defaults(table, threshold, 1, 2, 1, 2); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
685 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
686 gtk_container_add(GTK_CONTAINER(vbox), level); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
687 gtk_container_add(GTK_CONTAINER(vbox), GTK_WIDGET(table)); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
688 gtk_widget_show_all(vbox); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
689 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
690 pipeline = create_pipeline(); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
691 bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
692 gst_bus_add_signal_watch(bus); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
693 ctx = g_new(BusCbCtx, 1); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
694 ctx->level = GTK_PROGRESS_BAR(level); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
695 ctx->threshold = GTK_RANGE(threshold); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
696 g_signal_connect_data(bus, "message", G_CALLBACK(gst_bus_cb), |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
697 ctx, (GClosureNotify)g_free, 0); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
698 gst_object_unref(bus); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
699 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
700 g_signal_connect(volume, "value-changed", |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
701 (GCallback)on_volume_change_cb, pipeline); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
702 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
703 gtk_range_set_value(GTK_RANGE(volume), |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
704 purple_prefs_get_int("/purple/media/audio/volume/input")); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
705 gtk_widget_set(volume, "draw-value", FALSE, NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
706 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
707 gtk_range_set_value(GTK_RANGE(threshold), |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
708 purple_prefs_get_int("/purple/media/audio/silence_threshold")); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
709 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
710 g_signal_connect(vbox, "destroy", |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
711 G_CALLBACK(voice_test_frame_destroy_cb), pipeline); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
712 g_signal_connect(volume, "destroy", |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
713 G_CALLBACK(volume_scale_destroy_cb), NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
714 g_signal_connect(threshold, "format-value", |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
715 G_CALLBACK(threshold_value_format_cb), NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
716 g_signal_connect(threshold, "destroy", |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
717 G_CALLBACK(threshold_scale_destroy_cb), NULL); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
718 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
719 return vbox; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
720 } |
30914
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
721 |
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
|
722 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
|
723 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
|
724 { |
1bf7346e5d57
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents:
28392
diff
changeset
|
725 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
|
726 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
|
727 |
31874
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
728 act = purple_plugin_action_new(_("Input and Output 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
|
729 show_config); |
31874
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
730 act->user_data = get_plugin_config_frame; |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
731 l = g_list_append(l, act); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
732 |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
733 act = purple_plugin_action_new(_("Microphone Test"), |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
734 show_config); |
f4a1df87ce91
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
jakub.adam@ktknet.cz
parents:
31601
diff
changeset
|
735 act->user_data = get_voice_test_frame; |
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
|
736 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
|
737 |
1bf7346e5d57
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents:
28392
diff
changeset
|
738 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
|
739 } |
1bf7346e5d57
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <ml@update.uu.se>
parents:
28392
diff
changeset
|
740 |
28392
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
741 static gboolean |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
742 plugin_unload(PurplePlugin *plugin) |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
743 { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
744 PurpleMediaManager *manager = purple_media_manager_get(); |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
745 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
|
746 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
|
747 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
|
748 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
|
749 return TRUE; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
750 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
751 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
752 static PidginPluginUiInfo ui_info = { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
753 get_plugin_config_frame, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
754 0, /* page_num (Reserved) */ |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
755 /* Padding */ |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
756 NULL, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
757 NULL, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
758 NULL, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
759 NULL |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
760 }; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
761 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
762 static PurplePluginInfo info = |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
763 { |
30914
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
764 PURPLE_PLUGIN_MAGIC, /**< magic */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
765 PURPLE_MAJOR_VERSION, /**< major version */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
766 PURPLE_MINOR_VERSION, /**< minor version */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
767 PURPLE_PLUGIN_STANDARD, /**< type */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
768 PIDGIN_PLUGIN_TYPE, /**< ui_requirement */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
769 0, /**< flags */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
770 NULL, /**< dependencies */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
771 PURPLE_PRIORITY_DEFAULT, /**< priority */ |
28392
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
772 |
30914
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
773 "gtk-maiku-vvconfig", /**< id */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
774 N_("Voice/Video Settings"), /**< name */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
775 DISPLAY_VERSION, /**< version */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
776 N_("Configure your microphone and webcam."), /**< summary */ |
28392
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
777 N_("Configure microphone and webcam " |
30914
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
778 "settings for voice/video calls."), /**< description */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
779 "Mike Ruprecht <cmaiku@gmail.com>", /**< author */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
780 PURPLE_WEBSITE, /**< homepage */ |
28392
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
781 |
30914
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
782 plugin_load, /**< load */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
783 plugin_unload, /**< unload */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
784 NULL, /**< destroy */ |
28392
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
785 |
30914
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
786 &ui_info, /**< ui_info */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
787 NULL, /**< extra_info */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
788 NULL, /**< prefs_info */ |
d0965a30216a
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30904
diff
changeset
|
789 actions, /**< actions */ |
28392
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
790 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
791 /* padding */ |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
792 NULL, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
793 NULL, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
794 NULL, |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
795 NULL |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
796 }; |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
797 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
798 static void |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
799 init_plugin(PurplePlugin *plugin) { |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
800 } |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
801 |
33e8d40ae6ec
Add the vvconfig plugin. It allows you to choose different microphones,
maiku@pidgin.im
parents:
diff
changeset
|
802 PURPLE_INIT_PLUGIN(vvconfig, init_plugin, info) |