8139
|
1 |
diff -urN gnome-media-2.16.1/gst-mixer/src/element.c gnome-media-2.16.1-hacked/gst-mixer/src/element.c
|
|
2 |
--- gnome-media-2.16.1/gst-mixer/src/element.c 2006-09-04 07:44:55.000000000 +1200
|
8142
|
3 |
+++ gnome-media-2.16.1-hacked/gst-mixer/src/element.c 2006-09-15 12:07:01.665009000 +1200
|
8139
|
4 |
@@ -215,7 +215,7 @@
|
|
5 |
{
|
|
6 |
struct {
|
|
7 |
gchar *label;
|
|
8 |
- GtkWidget *page, *old_sep, *new_sep;
|
|
9 |
+ GtkWidget *page, *flagbuttonbox, *old_sep, *new_sep;
|
|
10 |
gboolean use;
|
|
11 |
gint pos, height, width;
|
|
12 |
GnomeVolumeControlTrack * (* get_track_widget) (GtkTable *table,
|
|
13 |
@@ -226,13 +226,13 @@
|
|
14 |
GtkWidget *right_sep,
|
|
15 |
GnomeAppBar *appbar);
|
|
16 |
} content[4] = {
|
|
17 |
- { _("Playback"), NULL, NULL, NULL, FALSE, 0, 5, 1,
|
|
18 |
+ { _("Playback"), NULL, NULL, NULL, NULL, FALSE, 0, 5, 1,
|
|
19 |
gnome_volume_control_track_add_playback },
|
|
20 |
- { _("Capture"), NULL, NULL, NULL, FALSE, 0, 5, 1,
|
|
21 |
+ { _("Capture"), NULL, NULL, NULL, NULL, FALSE, 0, 5, 1,
|
|
22 |
gnome_volume_control_track_add_capture },
|
|
23 |
- { _("Switches"), NULL, NULL, NULL, FALSE, 0, 1, 3,
|
|
24 |
+ { _("Switches"), NULL, NULL, NULL, NULL, FALSE, 0, 1, 3,
|
|
25 |
gnome_volume_control_track_add_switch },
|
|
26 |
- { _("Options"), NULL, NULL, NULL, FALSE, 0, 1, 3,
|
|
27 |
+ { _("Options"), NULL, NULL, NULL, NULL, FALSE, 0, 1, 3,
|
|
28 |
gnome_volume_control_track_add_option }
|
|
29 |
};
|
|
30 |
gvc_whitelist list[] = whitelist_init_list;
|
|
31 |
@@ -316,6 +316,10 @@
|
|
32 |
el->appbar);
|
|
33 |
gnome_volume_control_track_show (trkw, active);
|
7868
|
34 |
|
8139
|
35 |
+ /* Only the first trkw on the page will return flagbuttonbox */
|
|
36 |
+ if (trkw->flagbuttonbox != NULL)
|
|
37 |
+ content[i].flagbuttonbox = trkw->flagbuttonbox;
|
|
38 |
+
|
|
39 |
g_object_set_data (G_OBJECT (track),
|
|
40 |
"gnome-volume-control-trkw", trkw);
|
|
41 |
|
8142
|
42 |
@@ -359,8 +363,24 @@
|
8139
|
43 |
viewport = gtk_viewport_new (hadjustment, vadjustment);
|
|
44 |
gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
|
7868
|
45 |
|
8139
|
46 |
- gtk_container_add (GTK_CONTAINER (viewport), content[i].page);
|
|
47 |
- gtk_container_add (GTK_CONTAINER (view), viewport);
|
|
48 |
+ if (content[i].flagbuttonbox != NULL) {
|
|
49 |
+ GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
|
|
50 |
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 6);
|
8142
|
51 |
+ GtkWidget *hbox2 = gtk_hbox_new (FALSE, 6);
|
|
52 |
+ GtkWidget *separator = gtk_hseparator_new ();
|
|
53 |
+ gtk_box_pack_start (GTK_BOX (hbox2), separator, TRUE, TRUE, 6);
|
8139
|
54 |
+ gtk_box_pack_start (GTK_BOX (vbox), content[i].page, TRUE, TRUE, 6);
|
8142
|
55 |
+ gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, FALSE, 6);
|
|
56 |
+ gtk_box_pack_start (GTK_BOX (hbox), content[i].flagbuttonbox, TRUE, FALSE, 6);
|
8139
|
57 |
+ gtk_widget_show(hbox);
|
|
58 |
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 6);
|
8142
|
59 |
+ gtk_widget_show_all (vbox);
|
8139
|
60 |
+ gtk_container_add (GTK_CONTAINER (viewport), vbox);
|
|
61 |
+ gtk_container_add (GTK_CONTAINER (view), viewport);
|
|
62 |
+ } else {
|
|
63 |
+ gtk_container_add (GTK_CONTAINER (viewport), content[i].page);
|
|
64 |
+ gtk_container_add (GTK_CONTAINER (view), viewport);
|
|
65 |
+ }
|
|
66 |
|
|
67 |
label = gtk_label_new (content[i].label);
|
|
68 |
gtk_notebook_append_page (GTK_NOTEBOOK (el), view, label);
|
|
69 |
diff -urN gnome-media-2.16.1/gst-mixer/src/track.c gnome-media-2.16.1-hacked/gst-mixer/src/track.c
|
|
70 |
--- gnome-media-2.16.1/gst-mixer/src/track.c 2005-04-16 00:59:37.000000000 +1200
|
8142
|
71 |
+++ gnome-media-2.16.1-hacked/gst-mixer/src/track.c 2006-09-15 12:07:01.714869000 +1200
|
7558
|
72 |
@@ -19,6 +19,11 @@
|
|
73 |
* Boston, MA 02111-1307, USA.
|
|
74 |
*/
|
|
75 |
|
|
76 |
+#ifdef __sun
|
|
77 |
+#include <fcntl.h>
|
|
78 |
+#include <sys/audio.h>
|
|
79 |
+#endif
|
|
80 |
+
|
|
81 |
#ifdef HAVE_CONFIG_H
|
|
82 |
#include "config.h"
|
|
83 |
#endif
|
8142
|
84 |
@@ -101,6 +106,134 @@
|
7558
|
85 |
}
|
|
86 |
}
|
|
87 |
|
|
88 |
+#ifdef __sun
|
|
89 |
+static gint mixer_fd;
|
|
90 |
+static gboolean out_switch_display = FALSE;
|
|
91 |
+static gboolean in_switch_display = FALSE;
|
|
92 |
+static GtkWidget *out_speaker_button = NULL;
|
|
93 |
+static GtkWidget *out_headphone_button = NULL;
|
|
94 |
+static GtkWidget *out_lineout_button = NULL;
|
|
95 |
+static GtkWidget *out_spdif_button = NULL;
|
|
96 |
+static GtkWidget *out_aux1_button = NULL;
|
|
97 |
+static GtkWidget *out_aux2_button = NULL;
|
|
98 |
+static GtkWidget *in_microphone_button = NULL;
|
|
99 |
+static GtkWidget *in_line_in_button = NULL;
|
|
100 |
+static GtkWidget *in_cd_button = NULL;
|
|
101 |
+static GtkWidget *in_spdif_button = NULL;
|
|
102 |
+static GtkWidget *in_aux1_button = NULL;
|
|
103 |
+static GtkWidget *in_aux2_button = NULL;
|
|
104 |
+static GtkWidget *in_codec_button = NULL;
|
|
105 |
+
|
|
106 |
+static void
|
|
107 |
+sun_out_button_cb (GtkToggleButton *tb, gpointer data)
|
|
108 |
+{
|
|
109 |
+ audio_info_t ainfo;
|
|
110 |
+ int ret;
|
|
111 |
+
|
|
112 |
+ AUDIO_INITINFO (&ainfo);
|
|
113 |
+
|
|
114 |
+ if (ioctl (mixer_fd, AUDIO_GETINFO, &ainfo) < 0)
|
|
115 |
+ g_warning ("Error setting audio device information");
|
|
116 |
+
|
|
117 |
+ if (out_speaker_button != NULL) {
|
|
118 |
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_speaker_button)))
|
|
119 |
+ ainfo.play.port |= AUDIO_SPEAKER;
|
|
120 |
+ else
|
|
121 |
+ ainfo.play.port &= ~AUDIO_SPEAKER;
|
|
122 |
+ }
|
|
123 |
+
|
|
124 |
+ if (out_headphone_button != NULL) {
|
|
125 |
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_headphone_button)))
|
|
126 |
+ ainfo.play.port |= AUDIO_HEADPHONE;
|
|
127 |
+ else
|
|
128 |
+ ainfo.play.port &= ~AUDIO_HEADPHONE;
|
|
129 |
+ }
|
|
130 |
+
|
|
131 |
+ if (out_lineout_button != NULL) {
|
|
132 |
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_lineout_button)))
|
|
133 |
+ ainfo.play.port |= AUDIO_LINE_OUT;
|
|
134 |
+ else
|
|
135 |
+ ainfo.play.port &= ~AUDIO_LINE_OUT;
|
|
136 |
+ }
|
|
137 |
+
|
|
138 |
+ if (out_spdif_button != NULL) {
|
|
139 |
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_spdif_button)))
|
|
140 |
+ ainfo.play.port |= AUDIO_SPDIF_OUT;
|
|
141 |
+ else
|
|
142 |
+ ainfo.play.port &= ~AUDIO_SPDIF_OUT;
|
|
143 |
+ }
|
|
144 |
+
|
|
145 |
+ if (out_aux1_button != NULL) {
|
|
146 |
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_aux1_button)))
|
|
147 |
+ ainfo.play.port |= AUDIO_AUX1_OUT;
|
|
148 |
+ else
|
|
149 |
+ ainfo.play.port &= ~AUDIO_AUX1_OUT;
|
|
150 |
+ }
|
|
151 |
+
|
|
152 |
+ if (out_aux2_button != NULL) {
|
|
153 |
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_aux2_button)))
|
|
154 |
+ ainfo.play.port |= AUDIO_AUX2_OUT;
|
|
155 |
+ else
|
|
156 |
+ ainfo.play.port &= ~AUDIO_AUX2_OUT;
|
|
157 |
+ }
|
|
158 |
+
|
|
159 |
+ if (ioctl (mixer_fd, AUDIO_SETINFO, &ainfo) < 0)
|
|
160 |
+ g_warning ("Error setting audio device information");
|
|
161 |
+}
|
|
162 |
+
|
|
163 |
+static void
|
|
164 |
+sun_in_button_cb (GtkToggleButton *tb, gpointer data)
|
|
165 |
+{
|
|
166 |
+ audio_info_t ainfo;
|
|
167 |
+ int ret;
|
|
168 |
+
|
|
169 |
+ AUDIO_INITINFO (&ainfo);
|
|
170 |
+
|
|
171 |
+ if (ioctl (mixer_fd, AUDIO_GETINFO, &ainfo) < 0)
|
|
172 |
+ g_warning ("Error getting audio device information");
|
|
173 |
+
|
|
174 |
+ if (in_microphone_button != NULL &&
|
|
175 |
+ tb == GTK_TOGGLE_BUTTON (in_microphone_button)) {
|
|
176 |
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_microphone_button)))
|
|
177 |
+ ainfo.record.port = AUDIO_MICROPHONE;
|
|
178 |
+ }
|
|
179 |
+
|
|
180 |
+ if (in_line_in_button != NULL &&
|
|
181 |
+ tb == GTK_TOGGLE_BUTTON (in_line_in_button)) {
|
|
182 |
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_line_in_button)))
|
|
183 |
+ ainfo.record.port = AUDIO_LINE_IN;
|
|
184 |
+ }
|
|
185 |
+
|
|
186 |
+ if (in_cd_button != NULL && tb == GTK_TOGGLE_BUTTON (in_cd_button)) {
|
|
187 |
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_cd_button)))
|
|
188 |
+ ainfo.record.port = AUDIO_CD;
|
|
189 |
+ }
|
|
190 |
+
|
|
191 |
+ if (in_spdif_button != NULL && tb == GTK_TOGGLE_BUTTON (in_spdif_button)) {
|
|
192 |
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_spdif_button)))
|
|
193 |
+ ainfo.record.port = AUDIO_SPDIF_IN;
|
|
194 |
+ }
|
|
195 |
+
|
|
196 |
+ if (in_aux1_button != NULL && tb == GTK_TOGGLE_BUTTON (in_aux1_button)) {
|
|
197 |
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_aux1_button)))
|
|
198 |
+ ainfo.record.port = AUDIO_AUX1_IN;
|
|
199 |
+ }
|
|
200 |
+
|
|
201 |
+ if (in_aux2_button != NULL && tb == GTK_TOGGLE_BUTTON (in_aux2_button)) {
|
|
202 |
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_aux2_button)))
|
|
203 |
+ ainfo.record.port = AUDIO_AUX2_IN;
|
|
204 |
+ }
|
|
205 |
+
|
|
206 |
+ if (in_codec_button != NULL && tb == GTK_TOGGLE_BUTTON (in_codec_button)) {
|
|
207 |
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_codec_button)))
|
|
208 |
+ ainfo.record.port = AUDIO_CODEC_LOOPB_IN;
|
|
209 |
+ }
|
|
210 |
+
|
|
211 |
+ if (ioctl (mixer_fd, AUDIO_SETINFO, &ainfo) < 0)
|
|
212 |
+ g_warning ("Error setting audio device information");
|
|
213 |
+}
|
|
214 |
+#endif
|
|
215 |
+
|
|
216 |
/*
|
|
217 |
* Timeout to check for changes in mixer outside ourselves.
|
|
218 |
*/
|
8142
|
219 |
@@ -149,6 +282,112 @@
|
7558
|
220 |
* apps change device state.
|
|
221 |
*/
|
|
222 |
|
|
223 |
+#ifdef __sun
|
7868
|
224 |
+ /*
|
|
225 |
+ * Update the Sun flag buttons, if they change.
|
|
226 |
+ */
|
7558
|
227 |
+ {
|
|
228 |
+ audio_info_t ainfo;
|
|
229 |
+ int ret;
|
|
230 |
+
|
|
231 |
+ if (ioctl (mixer_fd, AUDIO_GETINFO, &ainfo) < 0)
|
|
232 |
+ g_warning ("Error setting audio device volume");
|
|
233 |
+
|
|
234 |
+ if (out_speaker_button != NULL &&
|
|
235 |
+ (ainfo.play.avail_ports & AUDIO_SPEAKER) &&
|
|
236 |
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_speaker_button)) !=
|
|
237 |
+ (ainfo.play.port & AUDIO_SPEAKER)) {
|
|
238 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_speaker_button),
|
|
239 |
+ (ainfo.play.port & AUDIO_SPEAKER));
|
|
240 |
+ }
|
|
241 |
+
|
|
242 |
+ if (out_headphone_button != NULL &&
|
|
243 |
+ (ainfo.play.avail_ports & AUDIO_HEADPHONE) &&
|
|
244 |
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_headphone_button)) !=
|
|
245 |
+ (ainfo.play.port & AUDIO_HEADPHONE)) {
|
|
246 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_headphone_button),
|
|
247 |
+ (ainfo.play.port & AUDIO_HEADPHONE));
|
|
248 |
+ }
|
|
249 |
+
|
|
250 |
+ if (out_lineout_button != NULL && (ainfo.play.avail_ports & AUDIO_LINE_OUT) &&
|
|
251 |
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_lineout_button)) !=
|
|
252 |
+ (ainfo.play.port & AUDIO_LINE_OUT)) {
|
|
253 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_lineout_button),
|
|
254 |
+ (ainfo.play.port & AUDIO_LINE_OUT));
|
|
255 |
+ }
|
|
256 |
+
|
|
257 |
+ if (out_spdif_button != NULL && (ainfo.play.avail_ports & AUDIO_SPDIF_OUT) &&
|
|
258 |
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_spdif_button)) !=
|
|
259 |
+ (ainfo.play.port & AUDIO_SPDIF_OUT)) {
|
|
260 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_spdif_button),
|
|
261 |
+ (ainfo.play.port & AUDIO_SPDIF_OUT));
|
|
262 |
+ }
|
|
263 |
+
|
|
264 |
+ if (out_aux1_button != NULL && (ainfo.play.avail_ports & AUDIO_AUX1_OUT) &&
|
|
265 |
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_aux1_button)) !=
|
|
266 |
+ (ainfo.play.port & AUDIO_AUX1_OUT)) {
|
|
267 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_aux1_button),
|
|
268 |
+ (ainfo.play.port & AUDIO_AUX1_OUT));
|
|
269 |
+ }
|
|
270 |
+
|
|
271 |
+ if (out_aux2_button != NULL && (ainfo.play.avail_ports & AUDIO_AUX2_OUT) &&
|
|
272 |
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_aux2_button)) !=
|
|
273 |
+ (ainfo.play.port & AUDIO_AUX2_OUT)) {
|
|
274 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_aux2_button),
|
|
275 |
+ (ainfo.play.port & AUDIO_AUX2_OUT));
|
|
276 |
+ }
|
|
277 |
+
|
|
278 |
+ if (in_microphone_button != NULL && (ainfo.record.avail_ports & AUDIO_MICROPHONE) &&
|
|
279 |
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_microphone_button)) !=
|
|
280 |
+ (ainfo.record.port & AUDIO_MICROPHONE)) {
|
|
281 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_microphone_button),
|
|
282 |
+ (ainfo.record.port & AUDIO_MICROPHONE));
|
|
283 |
+ }
|
|
284 |
+
|
|
285 |
+ if (in_line_in_button != NULL && (ainfo.record.avail_ports & AUDIO_LINE_IN) &&
|
|
286 |
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_line_in_button)) !=
|
|
287 |
+ (ainfo.record.port & AUDIO_LINE_IN)) {
|
|
288 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_line_in_button),
|
|
289 |
+ (ainfo.record.port & AUDIO_LINE_IN));
|
|
290 |
+ }
|
|
291 |
+
|
|
292 |
+ if (in_cd_button != NULL && (ainfo.record.avail_ports & AUDIO_CD) &&
|
|
293 |
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_cd_button)) !=
|
|
294 |
+ (ainfo.record.port & AUDIO_CD)) {
|
|
295 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_cd_button),
|
|
296 |
+ (ainfo.record.port & AUDIO_CD));
|
|
297 |
+ }
|
|
298 |
+
|
|
299 |
+ if (in_spdif_button != NULL && (ainfo.record.avail_ports & AUDIO_SPDIF_IN) &&
|
|
300 |
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_spdif_button)) !=
|
|
301 |
+ (ainfo.record.port & AUDIO_SPDIF_IN)) {
|
|
302 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_spdif_button),
|
|
303 |
+ (ainfo.record.port & AUDIO_SPDIF_IN));
|
|
304 |
+ }
|
|
305 |
+
|
|
306 |
+ if (in_aux1_button != NULL && (ainfo.record.avail_ports & AUDIO_AUX1_IN) &&
|
|
307 |
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_aux1_button)) !=
|
|
308 |
+ (ainfo.record.port & AUDIO_AUX1_IN)) {
|
|
309 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_aux1_button),
|
|
310 |
+ (ainfo.record.port & AUDIO_AUX1_IN));
|
|
311 |
+ }
|
|
312 |
+
|
|
313 |
+ if (in_aux2_button != NULL && (ainfo.record.avail_ports & AUDIO_AUX2_IN) &&
|
|
314 |
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_aux2_button)) !=
|
|
315 |
+ (ainfo.record.port & AUDIO_AUX2_IN)) {
|
|
316 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_aux2_button),
|
|
317 |
+ (ainfo.record.port & AUDIO_AUX2_IN));
|
|
318 |
+ }
|
|
319 |
+
|
|
320 |
+ if (in_codec_button != NULL && (ainfo.record.avail_ports & AUDIO_CODEC_LOOPB_IN) &&
|
|
321 |
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_codec_button)) !=
|
|
322 |
+ (ainfo.record.port & AUDIO_CODEC_LOOPB_IN)) {
|
|
323 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_codec_button),
|
|
324 |
+ (ainfo.record.port & AUDIO_CODEC_LOOPB_IN));
|
|
325 |
+ }
|
|
326 |
+ }
|
|
327 |
+#endif
|
|
328 |
+
|
|
329 |
return (trkw->mute || trkw->record);
|
|
330 |
}
|
|
331 |
|
8142
|
332 |
@@ -181,6 +420,7 @@
|
7868
|
333 |
ctrl->table = table;
|
|
334 |
ctrl->pos = tab_pos;
|
|
335 |
ctrl->id = g_timeout_add (100, cb_check, ctrl);
|
|
336 |
+ ctrl->flagbuttonbox = NULL;
|
|
337 |
|
|
338 |
/* image (optional) */
|
|
339 |
for (i = 0; !found && pix[i].label != NULL; i++) {
|
8142
|
340 |
@@ -323,6 +563,99 @@
|
7558
|
341 |
/* mute button */
|
|
342 |
gnome_volume_control_track_put_switch (table, tab_pos, ctrl, appbar);
|
|
343 |
|
|
344 |
+#ifdef __sun
|
7868
|
345 |
+ /*
|
|
346 |
+ * Only create the flagbuttonbox once.
|
|
347 |
+ */
|
7558
|
348 |
+ if (out_switch_display == FALSE) {
|
|
349 |
+ audio_info_t ainfo;
|
|
350 |
+ const char *audiodev;
|
|
351 |
+
|
7868
|
352 |
+ out_switch_display = TRUE;
|
|
353 |
+ ctrl->flagbuttonbox = gtk_vbox_new (FALSE, 0);
|
7558
|
354 |
+
|
|
355 |
+ audiodev = g_getenv ("AUDIODEV");
|
|
356 |
+ if (audiodev == NULL) {
|
|
357 |
+ mixer_fd = open ("/dev/audioctl", O_RDWR | O_NONBLOCK);
|
|
358 |
+ } else {
|
|
359 |
+ gchar *device = g_strdup_printf ("/dev/%sctl", audiodev);
|
|
360 |
+ mixer_fd = open (device, O_RDWR | O_NONBLOCK);
|
|
361 |
+ g_free (device);
|
|
362 |
+ }
|
|
363 |
+
|
|
364 |
+ if (ioctl (mixer_fd, AUDIO_GETINFO, &ainfo) < 0)
|
|
365 |
+ g_warning ("Error setting audio device volume");
|
|
366 |
+
|
|
367 |
+ if (ainfo.play.avail_ports & AUDIO_SPEAKER) {
|
7868
|
368 |
+ out_speaker_button = gtk_check_button_new_with_mnemonic (_("_Built-in Speaker"));
|
|
369 |
+ gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), out_speaker_button,
|
7558
|
370 |
+ FALSE, FALSE, 0);
|
|
371 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_speaker_button),
|
|
372 |
+ ainfo.play.port & AUDIO_SPEAKER);
|
|
373 |
+ gtk_widget_show (out_speaker_button);
|
|
374 |
+ g_signal_connect (G_OBJECT (out_speaker_button), "toggled",
|
|
375 |
+ G_CALLBACK (sun_out_button_cb), NULL);
|
|
376 |
+ }
|
|
377 |
+
|
|
378 |
+ if (ainfo.play.avail_ports & AUDIO_HEADPHONE) {
|
7868
|
379 |
+ /* Set mnemonic to "P" since "H" is already used by Help menu item */
|
|
380 |
+ out_headphone_button = gtk_check_button_new_with_mnemonic (_("Head_phone"));
|
|
381 |
+ gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), out_headphone_button,
|
7558
|
382 |
+ FALSE, FALSE, 0);
|
|
383 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_headphone_button),
|
|
384 |
+ ainfo.play.port & AUDIO_HEADPHONE);
|
|
385 |
+ gtk_widget_show (out_headphone_button);
|
|
386 |
+ g_signal_connect (G_OBJECT (out_headphone_button), "toggled",
|
|
387 |
+ G_CALLBACK (sun_out_button_cb), NULL);
|
|
388 |
+ }
|
|
389 |
+
|
|
390 |
+ if (ainfo.play.avail_ports & AUDIO_LINE_OUT) {
|
7868
|
391 |
+ out_lineout_button = gtk_check_button_new_with_mnemonic (_("_Line Out"));
|
|
392 |
+ gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), out_lineout_button,
|
7558
|
393 |
+ FALSE, FALSE, 0);
|
|
394 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_lineout_button),
|
|
395 |
+ ainfo.play.port & AUDIO_LINE_OUT);
|
|
396 |
+ gtk_widget_show (out_lineout_button);
|
|
397 |
+ g_signal_connect (G_OBJECT (out_lineout_button), "toggled",
|
|
398 |
+ G_CALLBACK (sun_out_button_cb), NULL);
|
|
399 |
+ }
|
|
400 |
+
|
|
401 |
+ if (ainfo.play.avail_ports & AUDIO_SPDIF_OUT) {
|
7868
|
402 |
+ out_spdif_button = gtk_check_button_new_with_mnemonic (_("_SPDIF Out"));
|
|
403 |
+ gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), out_spdif_button,
|
7558
|
404 |
+ FALSE, FALSE, 0);
|
|
405 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_spdif_button),
|
|
406 |
+ ainfo.play.port & AUDIO_SPDIF_OUT);
|
|
407 |
+ gtk_widget_show (out_spdif_button);
|
|
408 |
+ g_signal_connect (G_OBJECT (out_spdif_button), "toggled",
|
|
409 |
+ G_CALLBACK (sun_out_button_cb), NULL);
|
|
410 |
+ }
|
|
411 |
+
|
|
412 |
+ if (ainfo.play.avail_ports & AUDIO_AUX1_OUT) {
|
7868
|
413 |
+ out_aux1_button = gtk_check_button_new_with_mnemonic (_("AUX_1 Out"));
|
|
414 |
+ gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), out_aux1_button,
|
7558
|
415 |
+ FALSE, FALSE, 0);
|
|
416 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_aux1_button),
|
|
417 |
+ ainfo.play.port & AUDIO_AUX1_OUT);
|
|
418 |
+ gtk_widget_show (out_aux1_button);
|
|
419 |
+ g_signal_connect (G_OBJECT (out_aux1_button), "toggled",
|
|
420 |
+ G_CALLBACK (sun_out_button_cb), NULL);
|
|
421 |
+ }
|
|
422 |
+
|
|
423 |
+ if (ainfo.play.avail_ports & AUDIO_AUX2_OUT) {
|
7868
|
424 |
+ out_aux2_button = gtk_check_button_new_with_mnemonic (_("AUX_2 Out"));
|
|
425 |
+ gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), out_aux2_button,
|
7558
|
426 |
+ FALSE, FALSE, 0);
|
|
427 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_aux2_button),
|
|
428 |
+ ainfo.play.port & AUDIO_AUX2_OUT);
|
|
429 |
+ gtk_widget_show (out_aux2_button);
|
|
430 |
+ g_signal_connect (G_OBJECT (out_aux2_button), "toggled",
|
|
431 |
+ G_CALLBACK (sun_out_button_cb), NULL);
|
|
432 |
+ }
|
7868
|
433 |
+ gtk_widget_show (ctrl->flagbuttonbox);
|
7558
|
434 |
+ }
|
|
435 |
+#endif
|
|
436 |
+
|
|
437 |
return ctrl;
|
|
438 |
}
|
|
439 |
|
8142
|
440 |
@@ -352,6 +685,7 @@
|
7558
|
441 |
* is always FALSE.
|
|
442 |
*/
|
|
443 |
|
|
444 |
+#ifndef __sun
|
|
445 |
/* only the record button here */
|
|
446 |
msg = g_strdup_printf (_("Toggle audio capture from %s"), ctrl->track->label);
|
|
447 |
button = gnome_volume_control_button_new (GNOME_VOLUME_CONTROL_STOCK_RECORD,
|
8142
|
448 |
@@ -379,6 +713,147 @@
|
7558
|
449 |
FALSE, FALSE, 0);
|
|
450 |
gtk_widget_show (button);
|
|
451 |
|
|
452 |
+#else
|
7868
|
453 |
+ /*
|
|
454 |
+ * Only create the flagbuttonbox once.
|
|
455 |
+ *
|
|
456 |
+ * Note that we do not want to show the record button on Solaris,
|
|
457 |
+ * since this is managed by the flagbuttons defined below.
|
|
458 |
+ */
|
7558
|
459 |
+ if (in_switch_display == FALSE) {
|
|
460 |
+ audio_info_t ainfo;
|
|
461 |
+ const char *audiodev;
|
|
462 |
+ GtkRadioButton *first_button = NULL;
|
|
463 |
+
|
7868
|
464 |
+ in_switch_display = TRUE;
|
|
465 |
+ ctrl->flagbuttonbox = gtk_vbox_new (FALSE, 0);
|
7558
|
466 |
+
|
|
467 |
+ audiodev = g_getenv ("AUDIODEV");
|
|
468 |
+ if (audiodev == NULL) {
|
|
469 |
+ mixer_fd = open ("/dev/audioctl", O_RDWR | O_NONBLOCK);
|
|
470 |
+ } else {
|
|
471 |
+ gchar *device = g_strdup_printf ("/dev/%sctl", audiodev);
|
|
472 |
+ mixer_fd = open (device, O_RDWR | O_NONBLOCK);
|
|
473 |
+ g_free (device);
|
|
474 |
+ }
|
|
475 |
+
|
|
476 |
+ if (ioctl (mixer_fd, AUDIO_GETINFO, &ainfo) < 0)
|
|
477 |
+ g_warning ("Error setting audio device volume");
|
|
478 |
+
|
|
479 |
+ if (ainfo.record.avail_ports & AUDIO_MICROPHONE) {
|
7868
|
480 |
+ in_microphone_button = gtk_radio_button_new_with_mnemonic (NULL, _("Micro_phone"));
|
7558
|
481 |
+ first_button = GTK_RADIO_BUTTON (in_microphone_button);
|
7868
|
482 |
+ gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_microphone_button,
|
7558
|
483 |
+ FALSE, FALSE, 0);
|
|
484 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_microphone_button),
|
|
485 |
+ ainfo.record.port & AUDIO_MICROPHONE);
|
|
486 |
+ gtk_widget_show (in_microphone_button);
|
|
487 |
+ g_signal_connect (G_OBJECT (in_microphone_button), "toggled",
|
|
488 |
+ G_CALLBACK (sun_in_button_cb), NULL);
|
|
489 |
+ }
|
|
490 |
+ if (ainfo.record.avail_ports & AUDIO_LINE_IN) {
|
|
491 |
+ if (first_button != NULL) {
|
7868
|
492 |
+ in_line_in_button = gtk_radio_button_new_with_mnemonic_from_widget
|
|
493 |
+ (first_button, _("_Line In"));
|
7558
|
494 |
+ } else {
|
7868
|
495 |
+ in_line_in_button = gtk_radio_button_new_with_mnemonic (NULL, _("_Line In"));
|
7558
|
496 |
+ first_button = GTK_RADIO_BUTTON (in_line_in_button);
|
|
497 |
+ }
|
|
498 |
+ first_button = GTK_RADIO_BUTTON (in_line_in_button);
|
7868
|
499 |
+ gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_line_in_button,
|
7558
|
500 |
+ FALSE, FALSE, 0);
|
|
501 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_line_in_button),
|
|
502 |
+ ainfo.record.port & AUDIO_LINE_IN);
|
|
503 |
+ gtk_widget_show (in_line_in_button);
|
|
504 |
+ g_signal_connect (G_OBJECT (in_line_in_button), "toggled",
|
|
505 |
+ G_CALLBACK (sun_in_button_cb), NULL);
|
|
506 |
+ }
|
|
507 |
+ if (ainfo.record.avail_ports & AUDIO_CD) {
|
|
508 |
+ if (first_button != NULL) {
|
7868
|
509 |
+ in_cd_button = gtk_radio_button_new_with_mnemonic_from_widget
|
|
510 |
+ (first_button, _("_Internal CD"));
|
7558
|
511 |
+ } else {
|
7868
|
512 |
+ in_cd_button = gtk_radio_button_new_with_mnemonic (NULL, _("_Internal CD"));
|
7558
|
513 |
+ first_button = GTK_RADIO_BUTTON (in_cd_button);
|
|
514 |
+ }
|
|
515 |
+ first_button = GTK_RADIO_BUTTON (in_cd_button);
|
7868
|
516 |
+ gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_cd_button,
|
7558
|
517 |
+ FALSE, FALSE, 0);
|
|
518 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_cd_button),
|
|
519 |
+ ainfo.record.port & AUDIO_CD);
|
|
520 |
+ gtk_widget_show (in_cd_button);
|
|
521 |
+ g_signal_connect (G_OBJECT (in_cd_button), "toggled",
|
|
522 |
+ G_CALLBACK (sun_in_button_cb), NULL);
|
|
523 |
+ }
|
|
524 |
+ if (ainfo.record.avail_ports & AUDIO_SPDIF_IN) {
|
|
525 |
+ if (first_button != NULL) {
|
7868
|
526 |
+ in_spdif_button = gtk_radio_button_new_with_mnemonic_from_widget
|
|
527 |
+ (first_button, _("_SPDIF In"));
|
7558
|
528 |
+ } else {
|
7868
|
529 |
+ in_spdif_button = gtk_radio_button_new_with_mnemonic (NULL, _("_SPDIF In"));
|
7558
|
530 |
+ first_button = GTK_RADIO_BUTTON (in_spdif_button);
|
|
531 |
+ }
|
|
532 |
+
|
7868
|
533 |
+ gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_spdif_button,
|
7558
|
534 |
+ FALSE, FALSE, 0);
|
|
535 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_spdif_button),
|
|
536 |
+ ainfo.record.port & AUDIO_SPDIF_IN);
|
|
537 |
+ gtk_widget_show (in_spdif_button);
|
|
538 |
+ g_signal_connect (G_OBJECT (in_spdif_button), "toggled",
|
|
539 |
+ G_CALLBACK (sun_in_button_cb), NULL);
|
|
540 |
+ }
|
|
541 |
+ if (ainfo.record.avail_ports & AUDIO_AUX1_IN) {
|
|
542 |
+ if (first_button != NULL) {
|
7868
|
543 |
+ in_aux1_button = gtk_radio_button_new_with_mnemonic_from_widget
|
|
544 |
+ (first_button, _("AUX_1 Input"));
|
7558
|
545 |
+ } else {
|
7868
|
546 |
+ in_aux1_button = gtk_radio_button_new_with_mnemonic (NULL, _("AUX_1 Input"));
|
7558
|
547 |
+ first_button = GTK_RADIO_BUTTON (in_aux1_button);
|
|
548 |
+ }
|
7868
|
549 |
+ gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_aux1_button,
|
7558
|
550 |
+ FALSE, FALSE, 0);
|
|
551 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_aux1_button),
|
|
552 |
+ ainfo.record.port & AUDIO_AUX1_IN);
|
|
553 |
+ gtk_widget_show (in_aux1_button);
|
|
554 |
+ g_signal_connect (G_OBJECT (in_aux1_button), "toggled",
|
|
555 |
+ G_CALLBACK (sun_in_button_cb), NULL);
|
|
556 |
+ }
|
|
557 |
+ if (ainfo.record.avail_ports & AUDIO_AUX2_IN) {
|
|
558 |
+ if (first_button != NULL) {
|
7868
|
559 |
+ in_aux2_button = gtk_radio_button_new_with_mnemonic_from_widget
|
|
560 |
+ (first_button, _("AUX_2 Input"));
|
7558
|
561 |
+ } else {
|
7868
|
562 |
+ in_aux2_button = gtk_radio_button_new_with_mnemonic (NULL, _("AUX_2 Input"));
|
7558
|
563 |
+ first_button = GTK_RADIO_BUTTON (in_aux2_button);
|
|
564 |
+ }
|
7868
|
565 |
+ gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_aux2_button,
|
7558
|
566 |
+ FALSE, FALSE, 0);
|
|
567 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_aux2_button),
|
|
568 |
+ ainfo.record.port & AUDIO_AUX2_IN);
|
|
569 |
+ gtk_widget_show (in_aux2_button);
|
|
570 |
+ g_signal_connect (G_OBJECT (in_aux2_button), "toggled",
|
|
571 |
+ G_CALLBACK (sun_in_button_cb), NULL);
|
|
572 |
+ }
|
|
573 |
+ if (ainfo.record.avail_ports & AUDIO_CODEC_LOOPB_IN) {
|
|
574 |
+ if (first_button != NULL) {
|
7868
|
575 |
+ in_codec_button = gtk_radio_button_new_with_mnemonic_from_widget
|
|
576 |
+ (first_button, _("_Codec Loopback"));
|
7558
|
577 |
+ } else {
|
7868
|
578 |
+ in_codec_button = gtk_radio_button_new_with_mnemonic (NULL, _("_Codec Loopback"));
|
7558
|
579 |
+ first_button = GTK_RADIO_BUTTON (in_codec_button);
|
|
580 |
+ }
|
7868
|
581 |
+ gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_codec_button,
|
7558
|
582 |
+ FALSE, FALSE, 0);
|
|
583 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_codec_button),
|
|
584 |
+ ainfo.record.port & AUDIO_CODEC_LOOPB_IN);
|
|
585 |
+ gtk_widget_show (in_codec_button);
|
|
586 |
+ g_signal_connect (G_OBJECT (in_codec_button), "toggled",
|
|
587 |
+ G_CALLBACK (sun_in_button_cb), NULL);
|
|
588 |
+ }
|
7868
|
589 |
+ gtk_widget_show (ctrl->flagbuttonbox);
|
7558
|
590 |
+ }
|
|
591 |
+#endif
|
|
592 |
+
|
|
593 |
return ctrl;
|
|
594 |
}
|
|
595 |
|
8139
|
596 |
diff -urN gnome-media-2.16.1/gst-mixer/src/track.h gnome-media-2.16.1-hacked/gst-mixer/src/track.h
|
|
597 |
--- gnome-media-2.16.1/gst-mixer/src/track.h 2006-01-20 12:52:21.000000000 +1300
|
|
598 |
+++ gnome-media-2.16.1-hacked/gst-mixer/src/track.h 2006-09-15 11:07:46.085891000 +1200
|
|
599 |
@@ -47,7 +47,8 @@
|
|
600 |
*sliderbox,
|
|
601 |
*buttonbox,
|
|
602 |
*toggle,
|
|
603 |
- *options;
|
|
604 |
+ *options,
|
|
605 |
+ *flagbuttonbox;
|
7868
|
606 |
|
8139
|
607 |
GnomeVolumeControlButton *mute, *record;
|
7868
|
608 |
|