546 |
|
|
547 |
|
static GtkWidget *w_frameskip; |
548 |
|
|
549 |
+ |
static GtkWidget *w_dspdevice_file, *w_mixerdevice_file; |
550 |
+ |
|
551 |
|
// "5 Hz".."60Hz" selected |
552 |
|
static void mn_5hz(...) {PrefsReplaceInt32("frameskip", 12);} |
553 |
|
static void mn_7hz(...) {PrefsReplaceInt32("frameskip", 8);} |
621 |
|
PrefsReplaceInt32("screenmodes", PrefsFindInt32("screenmodes") & ~32); |
622 |
|
} |
623 |
|
|
624 |
+ |
// Set sensitivity of widgets |
625 |
+ |
static void set_graphics_sensitive(void) |
626 |
+ |
{ |
627 |
+ |
const bool sound_enabled = !PrefsFindBool("nosound"); |
628 |
+ |
gtk_widget_set_sensitive(w_dspdevice_file, sound_enabled); |
629 |
+ |
gtk_widget_set_sensitive(w_mixerdevice_file, sound_enabled); |
630 |
+ |
} |
631 |
+ |
|
632 |
|
// "Disable Sound Output" button toggled |
633 |
|
static void tb_nosound(GtkWidget *widget) |
634 |
|
{ |
635 |
|
PrefsReplaceBool("nosound", GTK_TOGGLE_BUTTON(widget)->active); |
636 |
+ |
set_graphics_sensitive(); |
637 |
|
} |
638 |
|
|
639 |
|
// Read settings from widgets and set preferences |
640 |
|
static void read_graphics_settings(void) |
641 |
|
{ |
642 |
+ |
PrefsReplaceString("dsp", get_file_entry_path(w_dspdevice_file)); |
643 |
+ |
PrefsReplaceString("mixer", get_file_entry_path(w_mixerdevice_file)); |
644 |
|
} |
645 |
|
|
646 |
|
// Create "Graphics/Sound" pane |
688 |
|
make_checkbox(vbox, STR_1280x1024_CTRL, PrefsFindInt32("screenmodes") & 16, GTK_SIGNAL_FUNC(tb_fs1280x1024)); |
689 |
|
make_checkbox(vbox, STR_1600x1200_CTRL, PrefsFindInt32("screenmodes") & 32, GTK_SIGNAL_FUNC(tb_fs1600x1200)); |
690 |
|
|
691 |
+ |
make_separator(box); |
692 |
|
make_checkbox(box, STR_NOSOUND_CTRL, "nosound", GTK_SIGNAL_FUNC(tb_nosound)); |
693 |
+ |
w_dspdevice_file = make_entry(box, STR_DSPDEVICE_FILE_CTRL, "dsp"); |
694 |
+ |
w_mixerdevice_file = make_entry(box, STR_MIXERDEVICE_FILE_CTRL, "mixer"); |
695 |
+ |
|
696 |
+ |
set_graphics_sensitive(); |
697 |
|
} |
698 |
|
|
699 |
|
|