715 |
|
static char fbdev_name[256]; |
716 |
|
#endif |
717 |
|
|
718 |
+ |
static GtkWidget *w_dspdevice_file, *w_mixerdevice_file; |
719 |
+ |
|
720 |
|
// Hide/show graphics widgets |
721 |
|
static void hide_show_graphics_widgets(void) |
722 |
|
{ |
763 |
|
static void mn_60hz(...) {PrefsReplaceInt32("frameskip", 1);} |
764 |
|
static void mn_dynamic(...) {PrefsReplaceInt32("frameskip", 0);} |
765 |
|
|
766 |
+ |
// Set sensitivity of widgets |
767 |
+ |
static void set_graphics_sensitive(void) |
768 |
+ |
{ |
769 |
+ |
const bool sound_enabled = !PrefsFindBool("nosound"); |
770 |
+ |
gtk_widget_set_sensitive(w_dspdevice_file, sound_enabled); |
771 |
+ |
gtk_widget_set_sensitive(w_mixerdevice_file, sound_enabled); |
772 |
+ |
} |
773 |
+ |
|
774 |
|
// "Disable Sound Output" button toggled |
775 |
|
static void tb_nosound(GtkWidget *widget) |
776 |
|
{ |
777 |
|
PrefsReplaceBool("nosound", GTK_TOGGLE_BUTTON(widget)->active); |
778 |
+ |
set_graphics_sensitive(); |
779 |
|
} |
780 |
|
|
781 |
|
// Read graphics preferences |
838 |
|
else |
839 |
|
PrefsRemoveItem("fbdevicefile"); |
840 |
|
#endif |
841 |
+ |
PrefsReplaceString("dsp", get_file_entry_path(w_dspdevice_file)); |
842 |
+ |
PrefsReplaceString("mixer", get_file_entry_path(w_mixerdevice_file)); |
843 |
|
} |
844 |
|
|
845 |
|
// Create "Graphics/Sound" pane |
960 |
|
|
961 |
|
make_separator(box); |
962 |
|
make_checkbox(box, STR_NOSOUND_CTRL, "nosound", GTK_SIGNAL_FUNC(tb_nosound)); |
963 |
+ |
w_dspdevice_file = make_file_entry(box, STR_DSPDEVICE_FILE_CTRL, "dsp"); |
964 |
+ |
w_mixerdevice_file = make_file_entry(box, STR_MIXERDEVICE_FILE_CTRL, "mixer"); |
965 |
+ |
|
966 |
+ |
set_graphics_sensitive(); |
967 |
|
|
968 |
|
hide_show_graphics_widgets(); |
969 |
|
} |