diff --git a/dpf b/dpf index ad3c5da..ab2cde1 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit ad3c5dae30b548134635873ee05e021d18da2e5e +Subproject commit ab2cde1758d457bf481747e720f245c879ef678d diff --git a/src/override/MenuBar.cpp b/src/override/MenuBar.cpp index e990546..f49147f 100644 --- a/src/override/MenuBar.cpp +++ b/src/override/MenuBar.cpp @@ -52,15 +52,12 @@ #include #include "../CardinalCommon.hpp" +#include "DistrhoStandaloneUtils.hpp" #ifdef HAVE_LIBLO # include #endif -#ifdef DISTRHO_OS_WASM -# include "DistrhoStandaloneUtils.hpp" -#endif - void switchDarkMode(bool darkMode); namespace rack { @@ -645,42 +642,42 @@ struct EngineButton : MenuButton { settings::cpuMeter ^= true; })); -#ifdef DISTRHO_OS_WASM - if (supportsAudioInput()) { - const bool enabled = isAudioInputEnabled(); - std::string rightText; - if (enabled) - rightText = CHECKMARK_STRING; - menu->addChild(createMenuItem("Enable Audio Input", rightText, [enabled]() { - if (!enabled) - requestAudioInput(); - })); - } + if (isUsingNativeAudio()) { + if (supportsAudioInput()) { + const bool enabled = isAudioInputEnabled(); + std::string rightText; + if (enabled) + rightText = CHECKMARK_STRING; + menu->addChild(createMenuItem("Enable Audio Input", rightText, [enabled]() { + if (!enabled) + requestAudioInput(); + })); + } - if (supportsMIDI()) { - const bool enabled = isMIDIEnabled(); - std::string rightText; - if (enabled) - rightText = CHECKMARK_STRING; - menu->addChild(createMenuItem("Enable MIDI", rightText, [enabled]() { - if (!enabled) - requestMIDI(); - })); - } + if (supportsMIDI()) { + const bool enabled = isMIDIEnabled(); + std::string rightText; + if (enabled) + rightText = CHECKMARK_STRING; + menu->addChild(createMenuItem("Enable MIDI", rightText, [enabled]() { + if (!enabled) + requestMIDI(); + })); + } - if (supportsBufferSizeChanges()) { - static const std::vector bufferSizes = {256, 512, 1024, 2048, 4096, 8192, 16384}; - const uint32_t currentBufferSize = getBufferSize(); - menu->addChild(createSubmenuItem("Buffer Size", std::to_string(currentBufferSize), [=](ui::Menu* menu) { - for (uint32_t bufferSize : bufferSizes) { - menu->addChild(createCheckMenuItem(std::to_string(bufferSize), "", - [=]() {return currentBufferSize == bufferSize;}, - [=]() {requestBufferSizeChange(bufferSize);} - )); - } - })); + if (supportsBufferSizeChanges()) { + static const std::vector bufferSizes = {256, 512, 1024, 2048, 4096, 8192, 16384}; + const uint32_t currentBufferSize = getBufferSize(); + menu->addChild(createSubmenuItem("Buffer Size", std::to_string(currentBufferSize), [=](ui::Menu* menu) { + for (uint32_t bufferSize : bufferSizes) { + menu->addChild(createCheckMenuItem(std::to_string(bufferSize), "", + [=]() {return currentBufferSize == bufferSize;}, + [=]() {requestBufferSizeChange(bufferSize);} + )); + } + })); + } } -#endif } };