Mercurial > audlegacy-plugins
comparison src/crossfade/configure.c @ 3062:192c9ab32c98
Remove almost all of the no longer hooked up config options.
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Fri, 24 Apr 2009 06:21:09 -0500 |
parents | 440cb96f005f |
children | c0ae2a5a15e8 |
comparison
equal
deleted
inserted
replaced
3061:440cb96f005f | 3062:192c9ab32c98 |
---|---|
31 #include "monitor.h" | 31 #include "monitor.h" |
32 | 32 |
33 #include "interface-2.0.h" | 33 #include "interface-2.0.h" |
34 #include "support-2.0.h" | 34 #include "support-2.0.h" |
35 | 35 |
36 #ifdef HAVE_OSS | |
37 # include "oss.h" | |
38 #endif | |
39 | |
40 #include <assert.h> | 36 #include <assert.h> |
41 #include <stdio.h> | 37 #include <stdio.h> |
42 #include <string.h> | 38 #include <string.h> |
43 #include <stdlib.h> | 39 #include <stdlib.h> |
44 #include <ctype.h> | 40 #include <ctype.h> |
45 | 41 |
46 #include <fcntl.h> | 42 #include <fcntl.h> |
47 #include <unistd.h> | 43 #include <unistd.h> |
48 #include <sys/ioctl.h> | 44 #include <sys/ioctl.h> |
49 #include <sys/stat.h> | 45 #include <sys/stat.h> |
50 | |
51 #ifdef HAVE_OSS | |
52 # ifdef HAVE_SYS_SOUNDCARD_H | |
53 # include <sys/soundcard.h> | |
54 # elif defined(HAVE_MACHINE_SOUNDCARD_H) | |
55 # include <machine/soundcard.h> | |
56 # endif | |
57 #endif | |
58 | 46 |
59 #ifdef HAVE_LIBSAMPLERATE | 47 #ifdef HAVE_LIBSAMPLERATE |
60 # include <samplerate.h> | 48 # include <samplerate.h> |
61 #endif | 49 #endif |
62 | 50 |
146 | 134 |
147 /* some helpers to keep track of the GUI's state */ | 135 /* some helpers to keep track of the GUI's state */ |
148 static gboolean checking = FALSE; | 136 static gboolean checking = FALSE; |
149 static gint op_index; | 137 static gint op_index; |
150 static plugin_config_t op_config; | 138 static plugin_config_t op_config; |
151 static gint ep_index; | |
152 | 139 |
153 /* from crossfade.c */ | 140 /* from crossfade.c */ |
154 extern MUTEX buffer_mutex; | 141 extern MUTEX buffer_mutex; |
155 | 142 |
156 /*** internal helpers ********************************************************/ | 143 /*** internal helpers ********************************************************/ |
200 | 187 |
201 /*** output method ***********************************************************/ | 188 /*** output method ***********************************************************/ |
202 | 189 |
203 /*-- callbacks --------------------------------------------------------------*/ | 190 /*-- callbacks --------------------------------------------------------------*/ |
204 | 191 |
205 void | |
206 on_output_oss_radio_toggled(GtkToggleButton *togglebutton, gpointer user_data) | |
207 { | |
208 SET_PAGE("output_notebook", 0); | |
209 xfg->output_method = OUTPUT_METHOD_BUILTIN_OSS; | |
210 } | |
211 | |
212 void | |
213 on_output_plugin_radio_toggled(GtkToggleButton *togglebutton, gpointer user_data) | |
214 { | |
215 SET_PAGE("output_notebook", 1); | |
216 xfg->output_method = OUTPUT_METHOD_PLUGIN; | |
217 } | |
218 | |
219 void | |
220 on_output_none_radio_toggled(GtkToggleButton *togglebutton, gpointer user_data) | |
221 { | |
222 SET_PAGE("output_notebook", 2); | |
223 xfg->output_method = OUTPUT_METHOD_BUILTIN_NULL; | |
224 } | |
225 | |
226 static void | 192 static void |
227 resampling_rate_cb(GtkWidget *widget, gint index) | 193 resampling_rate_cb(GtkWidget *widget, gint index) |
228 { | 194 { |
229 xfg->output_rate = index; | 195 xfg->output_rate = index; |
230 } | 196 } |
234 resampling_quality_cb(GtkWidget *widget, gint index) | 200 resampling_quality_cb(GtkWidget *widget, gint index) |
235 { | 201 { |
236 xfg->output_quality = index; | 202 xfg->output_quality = index; |
237 } | 203 } |
238 #endif | 204 #endif |
239 | |
240 /*** oss output **************************************************************/ | |
241 | |
242 static void | |
243 scan_devices(gchar *type, GtkWidget *option_menu, activate_func_t signal_f) | |
244 { | |
245 #ifdef HAVE_OSS | |
246 gchar buffer[256]; | |
247 FILE *file; | |
248 | |
249 GtkWidget *item; | |
250 gboolean found = FALSE; | |
251 gint type_len = strlen(type); | |
252 #endif | |
253 | |
254 GtkWidget *menu; | |
255 gint index = 0; | |
256 | |
257 menu = gtk_menu_new(); | |
258 | |
259 #ifdef HAVE_OSS | |
260 /* look for devices in /dev/sndstat or /proc/asound/sndstat (OSS style) */ | |
261 if ((file = fopen("/dev/sndstat", "r")) || | |
262 (file = fopen("/proc/asound/sndstat", "r")) || | |
263 (file = fopen("/proc/asound/oss/sndstat", "r"))) | |
264 { | |
265 while (fgets(buffer, sizeof(buffer), file)) | |
266 { | |
267 gint i = strlen(buffer) - 1; | |
268 while ((i >= 0) && isspace(buffer[i])) | |
269 buffer[i--] = 0; | |
270 | |
271 if (found) | |
272 { | |
273 if (!buffer[0] || !isdigit(buffer[0])) | |
274 break; | |
275 | |
276 if (index == 0) | |
277 { | |
278 gchar *label, *p = strchr(buffer, ':'); | |
279 if (p) | |
280 while (*++p == ' '); | |
281 else | |
282 p = buffer; | |
283 | |
284 label = g_strdup_printf("Default (%s)", p); | |
285 item = gtk_menu_item_new_with_label(label); | |
286 g_free(label); | |
287 } | |
288 else | |
289 item = gtk_menu_item_new_with_label(buffer); | |
290 | |
291 gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc)signal_f, (gpointer) index); | |
292 gtk_widget_show(item); | |
293 gtk_menu_append(GTK_MENU(menu), item); | |
294 index++; | |
295 } | |
296 else if (strcmp(buffer, type) == 0) | |
297 found = TRUE; | |
298 else if (strncmp(buffer, type, type_len) == 0) | |
299 DEBUG(("[crossfade] scan_devices: %s\n", buffer)); | |
300 } | |
301 fclose(file); | |
302 | |
303 if (!found) | |
304 DEBUG(("[crossfade] scan_devices: section \"%s\" not found!\n", type)); | |
305 } | |
306 else | |
307 { | |
308 DEBUG(("[crossfade] scan_devices: no sndstat found!\n")); | |
309 #ifdef SOUND_MIXER_INFO | |
310 /* from xmms-3dse7 by Frank Cornelis */ | |
311 DEBUG(("[crossfade] scan_devices: using alternate method...\n")); | |
312 for (;;) | |
313 { | |
314 gchar dev_name[32]; | |
315 int fd; | |
316 gint mixer = 0; | |
317 mixer_info info; | |
318 gchar *label; | |
319 | |
320 if (mixer != 0) | |
321 sprintf(dev_name, "/dev/mixer%d", mixer); | |
322 else | |
323 strcpy(dev_name, "/dev/mixer"); | |
324 | |
325 if ((fd = open(dev_name, O_RDONLY)) != -1) | |
326 { | |
327 if (ioctl(fd, SOUND_MIXER_INFO, &info) != -1) | |
328 { | |
329 label = g_strdup_printf(index ? "%s" : "Default (%s)", info.name); | |
330 add_menu_item(menu, label, signal_f, index, NULL); | |
331 g_free(label); | |
332 index++; | |
333 } | |
334 close(fd); | |
335 } | |
336 else | |
337 break; | |
338 mixer++; | |
339 } | |
340 #endif | |
341 } | |
342 #endif /* HAVE_OSS */ | |
343 | |
344 /* create default entry if no device(s) could be found */ | |
345 if (index == 0) | |
346 add_menu_item(menu, "Default", signal_f, 0, NULL); | |
347 | |
348 /* attach menu */ | |
349 gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); | |
350 } | |
351 | |
352 /*-- oss output callbacks ---------------------------------------------------*/ | |
353 | |
354 void | |
355 check_oss_dependencies() | |
356 { | |
357 if (checking) return; | |
358 checking = TRUE; | |
359 | |
360 SET_SENSITIVE("oss_adevice_optionmenu", !xfg->oss_use_alt_audio_device); | |
361 SET_SENSITIVE("oss_adevice_alt_entry", xfg->oss_use_alt_audio_device); | |
362 | |
363 SET_SENSITIVE("oss_mdevice_optionmenu", !xfg->oss_use_alt_mixer_device); | |
364 SET_SENSITIVE("oss_mdevice_alt_entry", xfg->oss_use_alt_mixer_device); | |
365 | |
366 SET_SENSITIVE("osshwb_fragments_label", !xfg->oss_maxbuf_enable); | |
367 SET_SENSITIVE("osshwb_fragments_spin", !xfg->oss_maxbuf_enable); | |
368 SET_SENSITIVE("osshwb_fragsize_label", !xfg->oss_maxbuf_enable); | |
369 SET_SENSITIVE("osshwb_fragsize_spin", !xfg->oss_maxbuf_enable); | |
370 | |
371 checking = FALSE; | |
372 } | |
373 | |
374 void | |
375 config_adevice_cb(GtkWidget *widget, gint device) | |
376 { | |
377 xfg->oss_audio_device = device; | |
378 } | |
379 | |
380 void | |
381 config_mdevice_cb(GtkWidget *widget, gint device) | |
382 { | |
383 xfg->oss_mixer_device = device; | |
384 } | |
385 | |
386 void | |
387 on_config_adevice_alt_check_toggled(GtkToggleButton *togglebutton, gpointer user_data) | |
388 { | |
389 if (checking) return; | |
390 xfg->oss_use_alt_audio_device = gtk_toggle_button_get_active(togglebutton); | |
391 check_oss_dependencies(); | |
392 } | |
393 | |
394 void | |
395 on_config_mdevice_alt_check_toggled(GtkToggleButton *togglebutton, gpointer user_data) | |
396 { | |
397 if (checking) return; | |
398 xfg->oss_use_alt_mixer_device = gtk_toggle_button_get_active(togglebutton); | |
399 check_oss_dependencies(); | |
400 } | |
401 | |
402 void | |
403 on_osshwb_maxbuf_check_toggled(GtkToggleButton *togglebutton, gpointer user_data) | |
404 { | |
405 if (checking) return; | |
406 xfg->oss_maxbuf_enable = gtk_toggle_button_get_active(togglebutton); | |
407 check_oss_dependencies(); | |
408 } | |
409 | 205 |
410 /*** plugin output ***********************************************************/ | 206 /*** plugin output ***********************************************************/ |
411 | 207 |
412 static void config_plugin_cb(GtkWidget *widget, gint index); | 208 static void config_plugin_cb(GtkWidget *widget, gint index); |
413 | 209 |
539 | 335 |
540 void | 336 void |
541 on_op_forcereopen_check_toggled(GtkToggleButton *togglebutton, gpointer user_data) | 337 on_op_forcereopen_check_toggled(GtkToggleButton *togglebutton, gpointer user_data) |
542 { | 338 { |
543 op_config.max_write_enable = gtk_toggle_button_get_active(togglebutton); | 339 op_config.max_write_enable = gtk_toggle_button_get_active(togglebutton); |
544 } | |
545 | |
546 /*** effects *****************************************************************/ | |
547 | |
548 static void config_effect_plugin_cb(GtkWidget *widget, gint index); | |
549 | |
550 static gint | |
551 scan_effect_plugins(GtkWidget *option_menu, gchar *selected) | |
552 { | |
553 assert(xfplayer_get_effect_list()); | |
554 | |
555 GtkWidget *menu = gtk_menu_new(); | |
556 GList *list = g_list_first(xfplayer_get_effect_list()); | |
557 gint index = 0; | |
558 gint sel_index = -1; | |
559 gint def_index = -1; | |
560 | |
561 /* sanity check */ | |
562 if (selected == NULL) | |
563 selected = ""; | |
564 | |
565 /* parse module list */ | |
566 while (list) | |
567 { | |
568 EffectPlugin *ep = (EffectPlugin *) list->data; | |
569 GtkWidget *item = gtk_menu_item_new_with_label(ep->description); | |
570 | |
571 if (def_index == -1) | |
572 def_index = index; | |
573 | |
574 if (ep->filename && !strcmp(g_basename(ep->filename), selected)) | |
575 sel_index = index; | |
576 | |
577 /* create menu item */ | |
578 gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc)config_effect_plugin_cb, (gpointer) index++); | |
579 gtk_widget_show(item); | |
580 gtk_menu_append(GTK_MENU(menu), item); | |
581 | |
582 /* advance to next module */ | |
583 list = g_list_next(list); | |
584 } | |
585 | |
586 /* attach menu */ | |
587 gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); | |
588 | |
589 if (sel_index == -1) | |
590 { | |
591 DEBUG(("[crossfade] scan_effect_plugins: plugin not found (\"%s\")\n", selected)); | |
592 return def_index; /* use default (first entry) */ | |
593 } | |
594 return sel_index; | |
595 } | |
596 | |
597 /*-- plugin output callbacks ------------------------------------------------*/ | |
598 | |
599 static void | |
600 config_effect_plugin_cb(GtkWidget *widget, gint index) | |
601 { | |
602 assert(xfplayer_get_effect_list()); | |
603 EffectPlugin *ep = g_list_nth_data(xfplayer_get_effect_list(), index); | |
604 | |
605 /* select new plugin */ | |
606 ep_index = index; | |
607 | |
608 /* get new plugin's name */ | |
609 if (xfg->ep_name) g_free(xfg->ep_name); | |
610 xfg->ep_name = (ep && ep->filename) ? g_strdup(g_basename(ep->filename)) : NULL; | |
611 | |
612 /* update gui */ | |
613 SET_SENSITIVE("ep_configure_button", ep && (ep->configure != NULL)); | |
614 SET_SENSITIVE("ep_about_button", ep && (ep->about != NULL)); | |
615 | |
616 /* 0.3.5: apply effect config immediatelly */ | |
617 if (config->ep_name) g_free(config->ep_name); | |
618 config->ep_name = g_strdup(xfg->ep_name); | |
619 } | |
620 | |
621 void | |
622 on_ep_configure_button_clicked(GtkButton *button, gpointer user_data) | |
623 { | |
624 assert(xfplayer_get_effect_list()); | |
625 | |
626 EffectPlugin *ep = g_list_nth_data(xfplayer_get_effect_list(), ep_index); | |
627 if ((ep == NULL) || (ep->configure == NULL)) | |
628 return; | |
629 | |
630 ep->configure(); | |
631 } | |
632 | |
633 void | |
634 on_ep_about_button_clicked(GtkButton *button, gpointer user_data) | |
635 { | |
636 assert(xfplayer_get_effect_list()); | |
637 | |
638 EffectPlugin *ep = g_list_nth_data(xfplayer_get_effect_list(), ep_index); | |
639 if ((ep == NULL) || (ep->about == NULL)) | |
640 return; | |
641 | |
642 ep->about(); | |
643 } | |
644 | |
645 void | |
646 on_ep_enable_check_toggled(GtkToggleButton *togglebutton, gpointer user_data) | |
647 { | |
648 /* 0.3.5: apply effect config immediatelly */ | |
649 config->ep_enable = xfg->ep_enable = GET_TOGGLE("ep_enable_check"); | |
650 } | |
651 | |
652 /*-- volume normalizer ------------------------------------------------------*/ | |
653 | |
654 void | |
655 check_effects_dependencies() | |
656 { | |
657 if (checking) return; | |
658 checking = TRUE; | |
659 | |
660 SET_SENSITIVE("volnorm_target_spin", xfg->volnorm_enable); | |
661 SET_SENSITIVE("volnorm_target_label", xfg->volnorm_enable); | |
662 SET_SENSITIVE("volnorm_quantaudio_check", xfg->volnorm_enable); | |
663 SET_SENSITIVE("volnorm_target_spin", xfg->volnorm_enable); | |
664 | |
665 checking = FALSE; | |
666 } | |
667 | |
668 void | |
669 on_volnorm_enable_check_toggled(GtkToggleButton *togglebutton, gpointer user_data) | |
670 { | |
671 if (checking) return; | |
672 xfg->volnorm_enable = gtk_toggle_button_get_active(togglebutton); | |
673 check_effects_dependencies(); | |
674 } | 340 } |
675 | 341 |
676 /*** crossfader **************************************************************/ | 342 /*** crossfader **************************************************************/ |
677 | 343 |
678 static void xf_config_cb(GtkWidget *widget, gint index); | 344 static void xf_config_cb(GtkWidget *widget, gint index); |
1343 | 1009 |
1344 /* output method: builtin OSS */ | 1010 /* output method: builtin OSS */ |
1345 if ((widget = lookup_widget(config_win, "output_oss_notebook"))) | 1011 if ((widget = lookup_widget(config_win, "output_oss_notebook"))) |
1346 xfg->oss_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(widget)); | 1012 xfg->oss_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(widget)); |
1347 | 1013 |
1348 if ((widget = lookup_widget(config_win, "oss_adevice_alt_entry"))) | |
1349 { | |
1350 if (xfg->oss_alt_audio_device) | |
1351 g_free(xfg->oss_alt_audio_device); | |
1352 xfg->oss_alt_audio_device = gtk_editable_get_chars(GTK_EDITABLE(widget), 0, -1); | |
1353 g_strstrip(xfg->oss_alt_audio_device); | |
1354 } | |
1355 | |
1356 if ((widget = lookup_widget(config_win, "oss_mdevice_alt_entry"))) | |
1357 { | |
1358 if (xfg->oss_alt_mixer_device) | |
1359 g_free(xfg->oss_alt_mixer_device); | |
1360 xfg->oss_alt_mixer_device = gtk_editable_get_chars(GTK_EDITABLE(widget), 0, -1); | |
1361 g_strstrip(xfg->oss_alt_mixer_device); | |
1362 } | |
1363 | |
1364 xfg->oss_buffer_size_ms = GET_SPIN("ossbuf_buffer_spin"); | 1014 xfg->oss_buffer_size_ms = GET_SPIN("ossbuf_buffer_spin"); |
1365 xfg->oss_preload_size_ms = GET_SPIN("ossbuf_preload_spin"); | 1015 xfg->oss_preload_size_ms = GET_SPIN("ossbuf_preload_spin"); |
1366 | 1016 |
1367 xfg->oss_fragments = GET_SPIN("osshwb_fragments_spin"); | 1017 xfg->oss_fragments = GET_SPIN("osshwb_fragments_spin"); |
1368 xfg->oss_fragment_size = GET_SPIN("osshwb_fragsize_spin"); | 1018 xfg->oss_fragment_size = GET_SPIN("osshwb_fragsize_spin"); |
1381 /* output method: none: */ | 1031 /* output method: none: */ |
1382 | 1032 |
1383 /* effects: pre-mixing effect plugin */ | 1033 /* effects: pre-mixing effect plugin */ |
1384 | 1034 |
1385 /* effects: volume normalizer */ | 1035 /* effects: volume normalizer */ |
1386 xfg->volnorm_target = GET_SPIN("volnorm_target_spin"); | |
1387 xfg->volnorm_use_qa = GET_TOGGLE("volnorm_quantaudio_check"); | |
1388 | 1036 |
1389 /* crossfader */ | 1037 /* crossfader */ |
1390 xfg->mix_size_auto = GET_TOGGLE("xf_autobuf_check"); | 1038 xfg->mix_size_auto = GET_TOGGLE("xf_autobuf_check"); |
1391 | 1039 |
1392 /* gap killer */ | 1040 /* gap killer */ |
1489 /* go to remembered notebook page */ | 1137 /* go to remembered notebook page */ |
1490 if ((widget = lookup_widget(config_win, "config_notebook"))) | 1138 if ((widget = lookup_widget(config_win, "config_notebook"))) |
1491 gtk_notebook_set_page(GTK_NOTEBOOK(widget), config->page); | 1139 gtk_notebook_set_page(GTK_NOTEBOOK(widget), config->page); |
1492 | 1140 |
1493 /* output: method */ | 1141 /* output: method */ |
1494 #ifdef HAVE_OSS | |
1495 SET_SENSITIVE("output_oss_radio", TRUE); | |
1496 #else | |
1497 SET_SENSITIVE("output_oss_radio", FALSE); | |
1498 #endif | |
1499 | |
1500 switch (xfg->output_method) | |
1501 { | |
1502 case OUTPUT_METHOD_BUILTIN_OSS: | |
1503 widget = lookup_widget(config_win, "output_oss_radio"); | |
1504 break; | |
1505 | |
1506 case OUTPUT_METHOD_PLUGIN: | |
1507 widget = lookup_widget(config_win, "output_plugin_radio"); | |
1508 break; | |
1509 | |
1510 case OUTPUT_METHOD_BUILTIN_NULL: | |
1511 widget = lookup_widget(config_win, "output_none_radio"); | |
1512 break; | |
1513 | |
1514 default: | |
1515 widget = NULL; | |
1516 } | |
1517 if (widget) | |
1518 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE); | |
1519 | |
1520 if ((widget = lookup_widget(config_win, "output_notebook"))) | 1142 if ((widget = lookup_widget(config_win, "output_notebook"))) |
1521 gtk_notebook_set_page(GTK_NOTEBOOK(widget), xfg->output_method); | 1143 gtk_notebook_set_page(GTK_NOTEBOOK(widget), xfg->output_method); |
1522 | 1144 |
1523 /* output: resampling rate */ | 1145 /* output: resampling rate */ |
1524 if ((widget = lookup_widget(config_win, "resampling_rate_optionmenu"))) | 1146 if ((widget = lookup_widget(config_win, "resampling_rate_optionmenu"))) |
1582 #else | 1204 #else |
1583 HIDE("resampling_quality_hbox"); | 1205 HIDE("resampling_quality_hbox"); |
1584 HIDE("resampling_quality_optionmenu"); | 1206 HIDE("resampling_quality_optionmenu"); |
1585 #endif | 1207 #endif |
1586 | 1208 |
1587 /* output method: builtin OSS */ | |
1588 if ((widget = lookup_widget(config_win, "output_oss_notebook"))) | |
1589 gtk_notebook_set_page(GTK_NOTEBOOK(widget), xfg->oss_page); | |
1590 | |
1591 if ((widget = lookup_widget(config_win, "oss_adevice_optionmenu"))) | |
1592 { | |
1593 scan_devices("Audio devices:", widget, config_adevice_cb); | |
1594 gtk_option_menu_set_history(GTK_OPTION_MENU(widget), xfg->oss_audio_device); | |
1595 gtk_widget_set_sensitive(widget, !xfg->oss_use_alt_audio_device); | |
1596 } | |
1597 SET_TOGGLE("oss_adevice_alt_check", xfg->oss_use_alt_audio_device); | |
1598 if ((widget = lookup_widget(config_win, "oss_adevice_alt_entry"))) | |
1599 { | |
1600 gtk_entry_set_text(GTK_ENTRY(widget), xfg->oss_alt_audio_device ? xfg->oss_alt_audio_device : DEFAULT_OSS_ALT_AUDIO_DEVICE); | |
1601 gtk_widget_set_sensitive(widget, xfg->oss_use_alt_audio_device); | |
1602 } | |
1603 | |
1604 if ((widget = lookup_widget(config_win, "oss_mdevice_optionmenu"))) | |
1605 { | |
1606 scan_devices("Mixers:", widget, config_mdevice_cb); | |
1607 gtk_option_menu_set_history(GTK_OPTION_MENU(widget), xfg->oss_mixer_device); | |
1608 gtk_widget_set_sensitive(widget, !xfg->oss_use_alt_mixer_device); | |
1609 } | |
1610 SET_TOGGLE("oss_mdevice_alt_check", xfg->oss_use_alt_mixer_device); | |
1611 if ((widget = lookup_widget(config_win, "oss_mdevice_alt_entry"))) | |
1612 { | |
1613 gtk_entry_set_text(GTK_ENTRY(widget), xfg->oss_alt_mixer_device ? xfg->oss_alt_mixer_device : DEFAULT_OSS_ALT_MIXER_DEVICE); | |
1614 gtk_widget_set_sensitive(widget, xfg->oss_use_alt_mixer_device); | |
1615 } | |
1616 | |
1617 SET_SPIN("ossbuf_buffer_spin", xfg->oss_buffer_size_ms); | |
1618 SET_SPIN("ossbuf_preload_spin", xfg->oss_preload_size_ms); | |
1619 | |
1620 SET_SPIN("osshwb_fragments_spin", xfg->oss_fragments); | |
1621 SET_SPIN("osshwb_fragsize_spin", xfg->oss_fragment_size); | |
1622 SET_TOGGLE("osshwb_maxbuf_check", xfg->oss_maxbuf_enable); | |
1623 | |
1624 SET_TOGGLE("ossmixer_pcm_check", xfg->oss_mixer_use_master); | |
1625 | |
1626 check_oss_dependencies(); | |
1627 | |
1628 /* output method: plugin */ | 1209 /* output method: plugin */ |
1629 xfade_load_plugin_config(xfg->op_config_string, xfg->op_name, &op_config); | 1210 xfade_load_plugin_config(xfg->op_config_string, xfg->op_name, &op_config); |
1630 SET_TOGGLE ("op_throttle_check", op_config.throttle_enable); | 1211 SET_TOGGLE ("op_throttle_check", op_config.throttle_enable); |
1631 SET_TOGGLE ("op_maxblock_check", op_config.max_write_enable); | 1212 SET_TOGGLE ("op_maxblock_check", op_config.max_write_enable); |
1632 SET_SPIN ("op_maxblock_spin", op_config.max_write_len); | 1213 SET_SPIN ("op_maxblock_spin", op_config.max_write_len); |
1642 op = g_list_nth_data(xfplayer_get_output_list(), op_index); | 1223 op = g_list_nth_data(xfplayer_get_output_list(), op_index); |
1643 } | 1224 } |
1644 SET_SENSITIVE("op_configure_button", op && (op->configure != NULL)); | 1225 SET_SENSITIVE("op_configure_button", op && (op->configure != NULL)); |
1645 SET_SENSITIVE("op_about_button", op && (op->about != NULL)); | 1226 SET_SENSITIVE("op_about_button", op && (op->about != NULL)); |
1646 } | 1227 } |
1647 | |
1648 /* output method: none */ | |
1649 | |
1650 /* effects: pre-mixing effect plugin */ | |
1651 if (!xfplayer_get_effect_list()) | |
1652 HIDE("config_effects_page") | |
1653 else if ((widget = lookup_widget(config_win, "ep_plugin_optionmenu"))) | |
1654 { | |
1655 EffectPlugin *ep = NULL; | |
1656 if ((ep_index = scan_effect_plugins(widget, xfg->ep_name)) >= 0) | |
1657 { | |
1658 gtk_option_menu_set_history(GTK_OPTION_MENU(widget), ep_index); | |
1659 ep = g_list_nth_data(xfplayer_get_effect_list(), ep_index); | |
1660 } | |
1661 SET_SENSITIVE("ep_configure_button", ep && (ep->configure != NULL)); | |
1662 SET_SENSITIVE("ep_about_button", ep && (ep->about != NULL)); | |
1663 SET_TOGGLE ("ep_enable_check", xfg->ep_enable); | |
1664 SET_SENSITIVE("ep_enable_check", ep_index != -1); | |
1665 SET_SENSITIVE("ep_plugin_optionmenu", ep_index != -1); | |
1666 } | |
1667 | |
1668 /* effects: volume normalizer */ | |
1669 SET_TOGGLE("volnorm_enable_check", xfg->volnorm_enable); | |
1670 SET_TOGGLE("volnorm_quantaudio_check", xfg->volnorm_use_qa); | |
1671 SET_SPIN ("volnorm_target_spin", xfg->volnorm_target); | |
1672 | |
1673 check_effects_dependencies(); | |
1674 | 1228 |
1675 /* crossfader */ | 1229 /* crossfader */ |
1676 create_crossfader_config_menu(); | 1230 create_crossfader_config_menu(); |
1677 | 1231 |
1678 if ((xfg->xf_index < 0) || (xfg->xf_index >= MAX_FADE_CONFIGS)) | 1232 if ((xfg->xf_index < 0) || (xfg->xf_index >= MAX_FADE_CONFIGS)) |