diff options
Diffstat (limited to 'src/frontend/mame/ui/sndmenu.cpp')
-rw-r--r-- | src/frontend/mame/ui/sndmenu.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/frontend/mame/ui/sndmenu.cpp b/src/frontend/mame/ui/sndmenu.cpp index a3c65e7f6c9..52948c8bca2 100644 --- a/src/frontend/mame/ui/sndmenu.cpp +++ b/src/frontend/mame/ui/sndmenu.cpp @@ -28,6 +28,7 @@ menu_sound_options::menu_sound_options(mame_ui_manager &mui, render_container &c m_sample_rate = mui.machine().options().sample_rate(); m_sound = (strcmp(options.sound(), OSDOPTVAL_NONE) && strcmp(options.sound(), "0")); m_samples = mui.machine().options().samples(); + m_compressor = mui.machine().options().compressor(); int total = std::size(m_sound_rate); @@ -47,15 +48,19 @@ menu_sound_options::~menu_sound_options() { emu_options &moptions = machine().options(); - if (strcmp(moptions.value(OSDOPTION_SOUND),m_sound ? OSDOPTVAL_AUTO : OSDOPTVAL_NONE)!=0) + if (strcmp(moptions.value(OSDOPTION_SOUND), m_sound ? OSDOPTVAL_AUTO : OSDOPTVAL_NONE) != 0) { moptions.set_value(OSDOPTION_SOUND, m_sound ? OSDOPTVAL_AUTO : OSDOPTVAL_NONE, OPTION_PRIORITY_CMDLINE); } - if (moptions.int_value(OPTION_SAMPLERATE)!=m_sound_rate[m_cur_rates]) + if (moptions.bool_value(OPTION_COMPRESSOR) != m_compressor) + { + moptions.set_value(OPTION_COMPRESSOR, m_compressor, OPTION_PRIORITY_CMDLINE); + } + if (moptions.int_value(OPTION_SAMPLERATE) != m_sound_rate[m_cur_rates]) { moptions.set_value(OPTION_SAMPLERATE, m_sound_rate[m_cur_rates], OPTION_PRIORITY_CMDLINE); } - if (moptions.bool_value(OPTION_SAMPLES)!=m_samples) + if (moptions.bool_value(OPTION_SAMPLES) != m_samples) { moptions.set_value(OPTION_SAMPLES, m_samples, OPTION_PRIORITY_CMDLINE); } @@ -84,6 +89,14 @@ void menu_sound_options::handle() } break; + case ENABLE_COMPRESSOR: + if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT || menu_event->iptkey == IPT_UI_SELECT) + { + m_compressor = !m_compressor; + changed = true; + } + break; + case SAMPLE_RATE: if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) { @@ -133,6 +146,7 @@ void menu_sound_options::populate(float &customtop, float &custombottom) // add options items item_append_on_off(_("Sound"), m_sound, 0, (void *)(uintptr_t)ENABLE_SOUND); + item_append_on_off(_("Compressor"), m_compressor, 0, (void *)(uintptr_t)ENABLE_COMPRESSOR); item_append(_("Sample Rate"), string_format("%d", m_sample_rate), arrow_flags, (void *)(uintptr_t)SAMPLE_RATE); item_append_on_off(_("Use External Samples"), m_samples, 0, (void *)(uintptr_t)ENABLE_SAMPLES); item_append(menu_item_type::SEPARATOR); |