Tweak default wasm buffer size, allow to change it via menu

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-07-11 18:11:42 +01:00
parent e3a7a5ccb8
commit 63afbaacd8
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
4 changed files with 16 additions and 3 deletions

View file

@ -631,6 +631,19 @@ struct EngineButton : MenuButton {
requestMIDI();
}));
}
if (supportsBufferSizeChanges()) {
static const std::vector<uint32_t> 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
}
};