Enable full wasm build
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
3c5d7a4e0e
commit
d7d85606f4
14 changed files with 451 additions and 241 deletions
|
@ -1,5 +1,5 @@
|
|||
--- ../Rack/src/app/MenuBar.cpp 2022-07-07 00:16:13.700491991 +0100
|
||||
+++ MenuBar.cpp 2022-07-08 12:33:18.481979775 +0100
|
||||
--- ../Rack/src/app/MenuBar.cpp 2022-07-12 09:46:20.716165650 +0100
|
||||
+++ MenuBar.cpp 2022-07-12 09:45:31.518663160 +0100
|
||||
@@ -1,8 +1,33 @@
|
||||
+/*
|
||||
+ * DISTRHO Cardinal Plugin
|
||||
|
@ -36,15 +36,19 @@
|
|||
#include <app/MenuBar.hpp>
|
||||
#include <app/TipWindow.hpp>
|
||||
#include <widget/OpaqueWidget.hpp>
|
||||
@@ -25,8 +50,17 @@
|
||||
@@ -25,8 +50,21 @@
|
||||
#include <patch.hpp>
|
||||
#include <library.hpp>
|
||||
|
||||
+#include "../CardinalCommon.hpp"
|
||||
+
|
||||
+#ifdef HAVE_LIBLO
|
||||
+# include <lo/lo.h>
|
||||
+#endif
|
||||
+
|
||||
+#include "../CardinalCommon.hpp"
|
||||
+#ifdef DISTRHO_OS_WASM
|
||||
+# include "DistrhoStandaloneUtils.hpp"
|
||||
+#endif
|
||||
|
||||
namespace rack {
|
||||
+namespace asset {
|
||||
|
@ -54,7 +58,7 @@
|
|||
namespace app {
|
||||
namespace menuBar {
|
||||
|
||||
@@ -48,79 +82,135 @@
|
||||
@@ -48,79 +86,140 @@
|
||||
};
|
||||
|
||||
|
||||
|
@ -99,8 +103,14 @@
|
|||
menu->cornerFlags = BND_CORNER_TOP;
|
||||
menu->box.pos = getAbsoluteOffset(math::Vec(0, box.size.y));
|
||||
|
||||
menu->addChild(createMenuItem("New", RACK_MOD_CTRL_NAME "+N", []() {
|
||||
- menu->addChild(createMenuItem("New", RACK_MOD_CTRL_NAME "+N", []() {
|
||||
- APP->patch->loadTemplateDialog();
|
||||
+#ifndef DISTRHO_OS_WASM
|
||||
+ const char* const NewShortcut = RACK_MOD_CTRL_NAME "+N";
|
||||
+#else
|
||||
+ const char* const NewShortcut = "";
|
||||
+#endif
|
||||
+ menu->addChild(createMenuItem("New", NewShortcut, []() {
|
||||
+ patchUtils::loadTemplateDialog();
|
||||
}));
|
||||
|
||||
|
@ -162,7 +172,7 @@
|
|||
- }));
|
||||
+#ifdef HAVE_LIBLO
|
||||
+ menu->addChild(new ui::MenuSeparator);
|
||||
|
||||
+
|
||||
+ if (patchUtils::isRemoteConnected()) {
|
||||
+ menu->addChild(createMenuItem("Deploy to MOD", "F7", []() {
|
||||
+ patchUtils::deployToRemote();
|
||||
|
@ -179,7 +189,7 @@
|
|||
+ }));
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
|
||||
+#ifndef DISTRHO_OS_WASM
|
||||
menu->addChild(new ui::MenuSeparator);
|
||||
|
||||
|
@ -231,7 +241,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
@@ -166,7 +256,7 @@
|
||||
@@ -166,7 +265,7 @@
|
||||
|
||||
menu->addChild(new ui::MenuSeparator);
|
||||
|
||||
|
@ -240,7 +250,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
@@ -256,7 +346,7 @@
|
||||
@@ -256,7 +355,7 @@
|
||||
return settings::cableTension;
|
||||
}
|
||||
float getDefaultValue() override {
|
||||
|
@ -249,7 +259,7 @@
|
|||
}
|
||||
float getDisplayValue() override {
|
||||
return getValue() * 100;
|
||||
@@ -399,28 +489,6 @@
|
||||
@@ -399,28 +498,6 @@
|
||||
menu->cornerFlags = BND_CORNER_TOP;
|
||||
menu->box.pos = getAbsoluteOffset(math::Vec(0, box.size.y));
|
||||
|
||||
|
@ -278,7 +288,7 @@
|
|||
menu->addChild(createMenuLabel("Appearance"));
|
||||
|
||||
menu->addChild(createBoolPtrMenuItem("Show tooltips", "", &settings::tooltips));
|
||||
@@ -446,9 +514,16 @@
|
||||
@@ -446,9 +523,18 @@
|
||||
menu->addChild(haloBrightnessSlider);
|
||||
|
||||
menu->addChild(new ui::MenuSeparator);
|
||||
|
@ -291,12 +301,13 @@
|
|||
+ menu->addChild(new ui::MenuSeparator);
|
||||
menu->addChild(createMenuLabel("Parameters"));
|
||||
|
||||
- menu->addChild(createBoolPtrMenuItem("Lock cursor while dragging", "", &settings::allowCursorLock));
|
||||
+ // menu->addChild(createBoolPtrMenuItem("Lock cursor while dragging", "", &settings::allowCursorLock));
|
||||
+#ifdef DISTRHO_OS_WASM
|
||||
menu->addChild(createBoolPtrMenuItem("Lock cursor while dragging", "", &settings::allowCursorLock));
|
||||
+#endif
|
||||
|
||||
static const std::vector<std::string> knobModeLabels = {
|
||||
"Linear",
|
||||
@@ -473,11 +548,24 @@
|
||||
@@ -473,11 +559,34 @@
|
||||
menu->addChild(knobScrollSensitivitySlider);
|
||||
|
||||
menu->addChild(new ui::MenuSeparator);
|
||||
|
@ -304,9 +315,19 @@
|
|||
+ menu->addChild(createMenuLabel("Window"));
|
||||
|
||||
- menu->addChild(createBoolPtrMenuItem("Lock positions", "", &settings::lockModules));
|
||||
+ menu->addChild(createBoolPtrMenuItem("Invert zoom", "", &settings::invertZoom));
|
||||
+#ifdef DISTRHO_OS_WASM
|
||||
+ const bool fullscreen = APP->window->isFullScreen();
|
||||
+ std::string fullscreenText = "F11";
|
||||
+ if (fullscreen)
|
||||
+ fullscreenText += " " CHECKMARK_STRING;
|
||||
+ menu->addChild(createMenuItem("Fullscreen", fullscreenText, [=]() {
|
||||
+ APP->window->setFullScreen(!fullscreen);
|
||||
+ }));
|
||||
+#endif
|
||||
|
||||
- menu->addChild(createBoolPtrMenuItem("Auto-squeeze algorithm (experimental)", "", &settings::squeezeModules));
|
||||
+ menu->addChild(createBoolPtrMenuItem("Invert zoom", "", &settings::invertZoom));
|
||||
+
|
||||
+ static const std::vector<std::string> rateLimitLabels = {
|
||||
+ "None",
|
||||
+ "2x",
|
||||
|
@ -324,7 +345,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
@@ -487,47 +575,6 @@
|
||||
@@ -487,47 +596,6 @@
|
||||
////////////////////
|
||||
|
||||
|
||||
|
@ -372,11 +393,10 @@
|
|||
struct EngineButton : MenuButton {
|
||||
void onAction(const ActionEvent& e) override {
|
||||
ui::Menu* menu = createMenu();
|
||||
@@ -540,269 +587,6 @@
|
||||
menu->addChild(createMenuItem("Performance meters", cpuMeterText, [=]() {
|
||||
@@ -541,268 +609,42 @@
|
||||
settings::cpuMeter ^= true;
|
||||
}));
|
||||
-
|
||||
|
||||
- menu->addChild(createMenuItem<SampleRateItem>("Sample rate", RIGHT_ARROW));
|
||||
-
|
||||
- menu->addChild(createSubmenuItem("Threads", string::f("%d", settings::threadCount), [=](ui::Menu* menu) {
|
||||
|
@ -558,7 +578,16 @@
|
|||
- else if (!library::isLoggedIn()) {
|
||||
- addChild(createMenuItem("Register VCV account", "", [=]() {
|
||||
- system::openBrowser("https://vcvrack.com/login");
|
||||
- }));
|
||||
+#ifdef DISTRHO_OS_WASM
|
||||
+ if (supportsAudioInput()) {
|
||||
+ const bool enabled = isAudioInputEnabled();
|
||||
+ std::string text = "Enable Audio Input";
|
||||
+ if (enabled)
|
||||
+ text += " " CHECKMARK_STRING;
|
||||
+ menu->addChild(createMenuItem(text, "", [enabled]() {
|
||||
+ if (!enabled)
|
||||
+ requestAudioInput();
|
||||
}));
|
||||
-
|
||||
- ui::TextField* emailField = new ui::TextField;
|
||||
- emailField->placeholder = "Email";
|
||||
|
@ -577,15 +606,23 @@
|
|||
- logInItem->passwordField = passwordField;
|
||||
- passwordField->logInItem = logInItem;
|
||||
- addChild(logInItem);
|
||||
- }
|
||||
}
|
||||
- else {
|
||||
- addChild(createMenuItem("Log out", "", [=]() {
|
||||
- library::logOut();
|
||||
- }));
|
||||
-
|
||||
|
||||
- addChild(createMenuItem("Browse VCV Library", "", [=]() {
|
||||
- system::openBrowser("https://library.vcvrack.com/");
|
||||
- }));
|
||||
+ if (supportsMIDI()) {
|
||||
+ const bool enabled = isMIDIEnabled();
|
||||
+ std::string text = "Enable MIDI";
|
||||
+ if (enabled)
|
||||
+ text += " " CHECKMARK_STRING;
|
||||
+ menu->addChild(createMenuItem(text, "", [enabled]() {
|
||||
+ if (!enabled)
|
||||
+ requestMIDI();
|
||||
}));
|
||||
-
|
||||
- SyncUpdatesItem* syncItem = new SyncUpdatesItem;
|
||||
- syncItem->text = "Update all";
|
||||
|
@ -601,11 +638,11 @@
|
|||
- addChild(updateItem);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
}
|
||||
- }
|
||||
-};
|
||||
-
|
||||
-
|
||||
|
||||
-struct LibraryButton : MenuButton {
|
||||
- NotificationIcon* notification;
|
||||
-
|
||||
|
@ -636,13 +673,25 @@
|
|||
- if (osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, "All plugins have been downloaded. Close and re-launch Rack to load new updates.")) {
|
||||
- APP->window->close();
|
||||
- }
|
||||
- }
|
||||
+ 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);}
|
||||
+ ));
|
||||
+ }
|
||||
+ }));
|
||||
}
|
||||
-
|
||||
- MenuButton::step();
|
||||
+#endif
|
||||
}
|
||||
};
|
||||
|
||||
@@ -813,65 +597,23 @@
|
||||
@@ -813,65 +655,23 @@
|
||||
|
||||
|
||||
struct HelpButton : MenuButton {
|
||||
|
@ -714,18 +763,18 @@
|
|||
}
|
||||
};
|
||||
|
||||
@@ -921,7 +663,9 @@
|
||||
@@ -921,7 +721,9 @@
|
||||
struct MenuBar : widget::OpaqueWidget {
|
||||
MeterLabel* meterLabel;
|
||||
|
||||
- MenuBar() {
|
||||
+ MenuBar(const bool isStandalone)
|
||||
+ : widget::OpaqueWidget()
|
||||
+ {
|
||||
+ {
|
||||
const float margin = 5;
|
||||
box.size.y = BND_WIDGET_HEIGHT + 2 * margin;
|
||||
|
||||
@@ -930,7 +674,7 @@
|
||||
@@ -930,7 +732,7 @@
|
||||
layout->spacing = math::Vec(0, 0);
|
||||
addChild(layout);
|
||||
|
||||
|
@ -734,7 +783,7 @@
|
|||
fileButton->text = "File";
|
||||
layout->addChild(fileButton);
|
||||
|
||||
@@ -946,10 +690,6 @@
|
||||
@@ -946,10 +748,6 @@
|
||||
engineButton->text = "Engine";
|
||||
layout->addChild(engineButton);
|
||||
|
||||
|
@ -745,7 +794,7 @@
|
|||
HelpButton* helpButton = new HelpButton;
|
||||
helpButton->text = "Help";
|
||||
layout->addChild(helpButton);
|
||||
@@ -984,7 +724,11 @@
|
||||
@@ -984,7 +782,11 @@
|
||||
|
||||
|
||||
widget::Widget* createMenuBar() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue