From ce0cdd18a33a18a32247e1a6cea3f911e4df6a99 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 28 Mar 2020 12:53:32 -0400 Subject: [PATCH] Use one big menu in app::appendAudioMenu() instead of sub-menus. --- src/app/AudioWidget.cpp | 42 +++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/src/app/AudioWidget.cpp b/src/app/AudioWidget.cpp index 968cc12c..dd46d8e7 100644 --- a/src/app/AudioWidget.cpp +++ b/src/app/AudioWidget.cpp @@ -1,4 +1,5 @@ #include +#include #include @@ -304,21 +305,38 @@ void AudioWidget::setAudioPort(audio::Port* port) { void appendAudioMenu(ui::Menu* menu, audio::Port* port) { - AudioDriverItem* driverItem = createMenuItem("Audio driver", RIGHT_ARROW); - driverItem->port = port; - menu->addChild(driverItem); + menu->addChild(createMenuLabel("Audio driver")); + appendAudioDriverMenu(menu, port); - AudioDeviceItem* deviceItem = createMenuItem("Audio device", RIGHT_ARROW); - deviceItem->port = port; - menu->addChild(deviceItem); + menu->addChild(new ui::MenuSeparator); + menu->addChild(createMenuLabel("Audio device")); + appendAudioDeviceMenu(menu, port); - AudioSampleRateItem* sampleRateItem = createMenuItem("Sample rate", RIGHT_ARROW); - sampleRateItem->port = port; - menu->addChild(sampleRateItem); + menu->addChild(new ui::MenuSeparator); + menu->addChild(createMenuLabel("Sample rate")); + appendAudioSampleRateMenu(menu, port); - AudioBlockSizeItem* blockSizeItem = createMenuItem("Block size", RIGHT_ARROW); - blockSizeItem->port = port; - menu->addChild(blockSizeItem); + menu->addChild(new ui::MenuSeparator); + menu->addChild(createMenuLabel("Block size")); + appendAudioBlockSizeMenu(menu, port); + + // Uncomment this to use sub-menus instead of one big menu. + + // AudioDriverItem* driverItem = createMenuItem("Audio driver", RIGHT_ARROW); + // driverItem->port = port; + // menu->addChild(driverItem); + + // AudioDeviceItem* deviceItem = createMenuItem("Audio device", RIGHT_ARROW); + // deviceItem->port = port; + // menu->addChild(deviceItem); + + // AudioSampleRateItem* sampleRateItem = createMenuItem("Sample rate", RIGHT_ARROW); + // sampleRateItem->port = port; + // menu->addChild(sampleRateItem); + + // AudioBlockSizeItem* blockSizeItem = createMenuItem("Block size", RIGHT_ARROW); + // blockSizeItem->port = port; + // menu->addChild(blockSizeItem); }