diff options
Diffstat (limited to 'src/frontend/mame/ui/sndmenu.cpp')
-rw-r--r-- | src/frontend/mame/ui/sndmenu.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/frontend/mame/ui/sndmenu.cpp b/src/frontend/mame/ui/sndmenu.cpp index 8eff1ed1b92..b1842969f8f 100644 --- a/src/frontend/mame/ui/sndmenu.cpp +++ b/src/frontend/mame/ui/sndmenu.cpp @@ -9,12 +9,16 @@ *********************************************************************/ #include "emu.h" -#include "ui/ui.h" #include "ui/sndmenu.h" + #include "ui/selector.h" +#include "ui/ui.h" + #include "../osd/modules/lib/osdobj_common.h" // TODO: remove + namespace ui { + const int menu_sound_options::m_sound_rate[] = { 11025, 22050, 44100, 48000 }; //------------------------------------------------- @@ -70,19 +74,17 @@ menu_sound_options::~menu_sound_options() // handle //------------------------------------------------- -void menu_sound_options::handle() +void menu_sound_options::handle(event const *ev) { bool changed = false; // process the menu - const event *menu_event = process(0); - - if (menu_event != nullptr && menu_event->itemref != nullptr) + if (ev && ev->itemref) { - switch ((uintptr_t)menu_event->itemref) + switch ((uintptr_t)ev->itemref) { case ENABLE_SOUND: - if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT || menu_event->iptkey == IPT_UI_SELECT) + if (ev->iptkey == IPT_UI_LEFT || ev->iptkey == IPT_UI_RIGHT || ev->iptkey == IPT_UI_SELECT) { m_sound = !m_sound; changed = true; @@ -90,7 +92,7 @@ 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) + if (ev->iptkey == IPT_UI_LEFT || ev->iptkey == IPT_UI_RIGHT || ev->iptkey == IPT_UI_SELECT) { m_compressor = !m_compressor; changed = true; @@ -98,12 +100,12 @@ void menu_sound_options::handle() break; case SAMPLE_RATE: - if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) + if (ev->iptkey == IPT_UI_LEFT || ev->iptkey == IPT_UI_RIGHT) { - (menu_event->iptkey == IPT_UI_LEFT) ? m_cur_rates-- : m_cur_rates++; + (ev->iptkey == IPT_UI_LEFT) ? m_cur_rates-- : m_cur_rates++; changed = true; } - else if (menu_event->iptkey == IPT_UI_SELECT) + else if (ev->iptkey == IPT_UI_SELECT) { int total = std::size(m_sound_rate); std::vector<std::string> s_sel(total); @@ -121,7 +123,7 @@ void menu_sound_options::handle() break; case ENABLE_SAMPLES: - if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT || menu_event->iptkey == IPT_UI_SELECT) + if (ev->iptkey == IPT_UI_LEFT || ev->iptkey == IPT_UI_RIGHT || ev->iptkey == IPT_UI_SELECT) { m_samples = !m_samples; changed = true; |