Update custom patches

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2023-07-13 17:05:59 +02:00
parent 5c88ac16e6
commit 0ddffa6c77
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
12 changed files with 260 additions and 180 deletions

View file

@ -1,5 +1,5 @@
--- ../Rack/src/engine/Engine.cpp 2023-05-20 17:03:33.006081772 +0200
+++ Engine.cpp 2023-05-20 19:35:00.711346791 +0200
--- ../Rack/src/engine/Engine.cpp 2023-06-11 21:02:02.644002965 +0200
+++ Engine.cpp 2023-06-11 20:56:09.472002797 +0200
@@ -1,3 +1,30 @@
+/*
+ * DISTRHO Cardinal Plugin

View file

@ -1,5 +1,5 @@
--- ../Rack/src/app/MenuBar.cpp 2023-05-20 17:03:33.005081737 +0200
+++ MenuBar.cpp 2023-05-20 19:32:57.019576570 +0200
--- ../Rack/src/app/MenuBar.cpp 2023-06-11 21:02:02.640002965 +0200
+++ MenuBar.cpp 2023-07-11 19:18:16.204016531 +0200
@@ -1,8 +1,33 @@
+/*
+ * DISTRHO Cardinal Plugin
@ -44,7 +44,7 @@
#include <window/Window.hpp>
#include <asset.hpp>
#include <context.hpp>
@@ -25,8 +51,26 @@
@@ -25,8 +51,28 @@
#include <patch.hpp>
#include <library.hpp>
@ -53,6 +53,11 @@
+#include "DistrhoPlugin.hpp"
+#include "DistrhoStandaloneUtils.hpp"
+
+#ifdef DISTRHO_OS_WASM
+# include <emscripten/emscripten.h>
+# undef HAVE_LIBLO
+#endif
+
+#ifdef HAVE_LIBLO
+# include <lo/lo.h>
+#endif
@ -64,14 +69,11 @@
+namespace engine {
+void Engine_setRemoteDetails(Engine*, remoteUtils::RemoteDetails*);
+}
+namespace plugin {
+void updateStaticPluginsDarkMode();
+}
+
namespace app {
namespace menuBar {
@@ -48,79 +92,180 @@
@@ -48,79 +94,238 @@
};
@ -97,6 +99,32 @@
+ const bool isStandalone;
+ std::vector<std::string> demoPatches;
+
+#ifdef DISTRHO_OS_WASM
+ static void WebBrowserDataSaved(const int err)
+ {
+ err ? async_dialog_message("Error, could not save web browser data!")
+ : async_dialog_message("Web browser data saved!");
+ }
+
+ static void wasmSaveAs()
+ {
+ async_dialog_text_input("Filename", nullptr, [](char* const filename) {
+ if (filename == nullptr)
+ return;
+
+ APP->patch->path = asset::user("patches");
+ system::createDirectories(APP->patch->path);
+
+ APP->patch->path += filename;
+ if (rack::system::getExtension(filename) != ".vcv")
+ APP->patch->path += ".vcv";
+
+ patchUtils::saveDialog(APP->patch->path);
+ std::free(filename);
+ });
+ }
+#endif
+
+ FileButton(const bool standalone)
+ : MenuButton(), isStandalone(standalone)
+ {
@ -122,6 +150,11 @@
- menu->addChild(createMenuItem("New", RACK_MOD_CTRL_NAME "+N", []() {
- APP->patch->loadTemplateDialog();
- }));
-
- menu->addChild(createMenuItem("Open", RACK_MOD_CTRL_NAME "+O", []() {
- APP->patch->loadDialog();
- }));
+#ifndef DISTRHO_OS_WASM
+ constexpr const char* const NewShortcut = RACK_MOD_CTRL_NAME "+N";
+#else
@ -132,16 +165,29 @@
+ }));
+
+#if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
+#ifndef DISTRHO_OS_WASM
+ menu->addChild(createMenuItem("New (factory template)", "", []() {
+ patchUtils::loadTemplateDialog(true);
}));
- menu->addChild(createMenuItem("Open", RACK_MOD_CTRL_NAME "+O", []() {
- APP->patch->loadDialog();
+ menu->addChild(createMenuItem("Open / Import...", RACK_MOD_CTRL_NAME "+O", []() {
+ }));
+
+#ifndef DISTRHO_OS_WASM
+ constexpr const char* const OpenName = "Open...";
+#else
+ constexpr const char* const OpenName = "Import patch...";
+#endif
+ menu->addChild(createMenuItem(OpenName, RACK_MOD_CTRL_NAME "+O", []() {
+ patchUtils::loadDialog();
}));
+ }));
+
+ const std::string patchesDir = asset::user("patches");
+ const std::vector<std::string> patches = system::isDirectory(patchesDir) ? system::getEntries(patchesDir) : std::vector<std::string>();
+ menu->addChild(createSubmenuItem("Open local patch", "", [patches](ui::Menu* menu) {
+ for (const std::string& path : patches) {
+ std::string name = system::getStem(path);
+ menu->addChild(createMenuItem(name, "", [=]() {
+ patchUtils::loadPathDialog(path, false);
+ }));
+ }
+ }, patches.empty()));
menu->addChild(createSubmenuItem("Open recent", "", [](ui::Menu* menu) {
for (const std::string& path : settings::recentPatchPaths) {
@ -152,105 +198,11 @@
}));
}
}, settings::recentPatchPaths.empty()));
menu->addChild(createMenuItem("Save", RACK_MOD_CTRL_NAME "+S", []() {
- APP->patch->saveDialog();
+ // NOTE: will do nothing if path is empty, intentionally
+ patchUtils::saveDialog(APP->patch->path);
+ }, APP->patch->path.empty()));
+
+ menu->addChild(createMenuItem("Save as / Export...", RACK_MOD_CTRL_NAME "+Shift+S", []() {
+ patchUtils::saveAsDialog();
+ }));
+#else
+ menu->addChild(createMenuItem("Import patch...", RACK_MOD_CTRL_NAME "+O", []() {
+ patchUtils::loadDialog();
}));
- menu->addChild(createMenuItem("Save as", RACK_MOD_CTRL_NAME "+Shift+S", []() {
- APP->patch->saveAsDialog();
+ menu->addChild(createMenuItem("Import selection...", "", [=]() {
+ patchUtils::loadSelectionDialog();
+ }, false, true));
+
+ menu->addChild(createMenuItem("Save and download compressed", RACK_MOD_CTRL_NAME "+Shift+S", []() {
+ patchUtils::saveAsDialog();
}));
- menu->addChild(createMenuItem("Save a copy", "", []() {
- APP->patch->saveAsDialog(false);
+ menu->addChild(createMenuItem("Save and download uncompressed", "", []() {
+ patchUtils::saveAsDialogUncompressed();
}));
+#endif
+#endif
menu->addChild(createMenuItem("Revert", RACK_MOD_CTRL_NAME "+" RACK_MOD_SHIFT_NAME "+O", []() {
- APP->patch->revertDialog();
- }, APP->patch->path == ""));
+ patchUtils::revertDialog();
+ }, APP->patch->path.empty()));
menu->addChild(createMenuItem("Overwrite template", "", []() {
- APP->patch->saveTemplateDialog();
+ patchUtils::saveTemplateDialog();
}));
+#if defined(HAVE_LIBLO) || ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
+#ifdef __MOD_DEVICES__
+#define REMOTE_NAME "MOD"
+#else
+#define REMOTE_NAME "Remote"
+#endif
menu->addChild(new ui::MenuSeparator);
- // Load selection
- menu->addChild(createMenuItem("Import selection", "", [=]() {
- APP->scene->rack->loadSelectionDialog();
- }, false, true));
+ remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote();
+
+ if (remoteDetails != nullptr && remoteDetails->connected) {
+ menu->addChild(createMenuItem("Deploy to " REMOTE_NAME, "F7", [remoteDetails]() {
+ remoteUtils::sendFullPatchToRemote(remoteDetails);
+ }));
+ menu->addChild(createCheckMenuItem("Auto deploy to " REMOTE_NAME, "",
+ [remoteDetails]() {return remoteDetails->autoDeploy;},
+ [remoteDetails]() {
+ remoteDetails->autoDeploy = !remoteDetails->autoDeploy;
+ Engine_setRemoteDetails(APP->engine, remoteDetails->autoDeploy ? remoteDetails : nullptr);
+ }
+ ));
+ } else {
+ menu->addChild(createMenuItem("Connect to " REMOTE_NAME, "", []() {
+ DISTRHO_SAFE_ASSERT(remoteUtils::connectToRemote());
+ }));
+ }
+#endif
+
+#if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
+#ifndef DISTRHO_OS_WASM
menu->addChild(new ui::MenuSeparator);
- menu->addChild(createMenuItem("Quit", RACK_MOD_CTRL_NAME "+Q", []() {
- APP->window->close();
+ // Load selection
+ menu->addChild(createMenuItem("Import selection...", "", [=]() {
+ patchUtils::loadSelectionDialog();
+ }, false, true));
+
+ menu->addChild(createMenuItem("Export uncompressed json...", "", []() {
+ patchUtils::saveAsDialogUncompressed();
}));
+#endif
+#endif
+
+ if (!demoPatches.empty())
+ {
+ menu->addChild(new ui::MenuSeparator);
+
+ menu->addChild(createSubmenuItem("Open Demo / Example project", "", [=](ui::Menu* const menu) {
+ menu->addChild(createSubmenuItem("Open demo / example project", "", [=](ui::Menu* const menu) {
+ for (std::string path : demoPatches) {
+ std::string label = system::getStem(path);
+
@ -265,13 +217,126 @@
+ }
+
+ menu->addChild(new ui::MenuSeparator);
+
+ menu->addChild(createMenuItem("Open PatchStorage.com for more patches", "", []() {
+ menu->addChild(createMenuItem("Open patchstorage.com for more patches", "", []() {
+ patchUtils::openBrowser("https://patchstorage.com/platform/cardinal/");
+ }));
+ }));
+ }
+
+#if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
+ menu->addChild(createMenuItem("Import selection...", "", [=]() {
+ patchUtils::loadSelectionDialog();
+ }, false, true));
+
+ menu->addChild(new ui::MenuSeparator);
+
+#ifndef DISTRHO_OS_WASM
menu->addChild(createMenuItem("Save", RACK_MOD_CTRL_NAME "+S", []() {
- APP->patch->saveDialog();
+ // NOTE: for plugin versions it will do nothing if path is empty, intentionally
+ patchUtils::saveDialog(APP->patch->path);
+ }, APP->patch->path.empty() && !isStandalone));
+
+ menu->addChild(createMenuItem("Save as / Export...", RACK_MOD_CTRL_NAME "+Shift+S", []() {
+ patchUtils::saveAsDialog();
+ }));
+#else
+ menu->addChild(createMenuItem("Save", "", []() {
+ if (APP->patch->path.empty())
+ wasmSaveAs();
+ else
+ patchUtils::saveDialog(APP->patch->path);
}));
- menu->addChild(createMenuItem("Save as", RACK_MOD_CTRL_NAME "+Shift+S", []() {
- APP->patch->saveAsDialog();
+ menu->addChild(createMenuItem("Save as...", "", []() {
+ wasmSaveAs();
}));
- menu->addChild(createMenuItem("Save a copy", "", []() {
- APP->patch->saveAsDialog(false);
+ menu->addChild(createMenuItem("Save and download compressed", "", []() {
+ patchUtils::saveAsDialog();
}));
+ menu->addChild(createMenuItem("Save and download uncompressed", "", []() {
+ patchUtils::saveAsDialogUncompressed();
+ }));
+#endif
+#endif
+
menu->addChild(createMenuItem("Revert", RACK_MOD_CTRL_NAME "+" RACK_MOD_SHIFT_NAME "+O", []() {
- APP->patch->revertDialog();
- }, APP->patch->path == ""));
+ patchUtils::revertDialog();
+ }, APP->patch->path.empty()));
+#if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
menu->addChild(createMenuItem("Overwrite template", "", []() {
- APP->patch->saveTemplateDialog();
+ patchUtils::saveTemplateDialog();
}));
+#ifdef DISTRHO_OS_WASM
menu->addChild(new ui::MenuSeparator);
- // Load selection
- menu->addChild(createMenuItem("Import selection", "", [=]() {
- APP->scene->rack->loadSelectionDialog();
- }, false, true));
-
+ menu->addChild(createMenuItem("Save persistent browser data", "", []() {
+ settings::save();
+ EM_ASM({
+ Module.FS.syncfs(false, function(err){ dynCall('vi', $0, [!!err]) });
+ }, WebBrowserDataSaved);
+ }));
+#endif
+#endif
+
+#if defined(HAVE_LIBLO) || ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
+#ifdef __MOD_DEVICES__
+#define REMOTE_NAME "MOD"
+#else
+#define REMOTE_NAME "Remote"
+#endif
menu->addChild(new ui::MenuSeparator);
- menu->addChild(createMenuItem("Quit", RACK_MOD_CTRL_NAME "+Q", []() {
- APP->window->close();
- }));
+ remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote();
+
+ if (remoteDetails != nullptr && remoteDetails->connected) {
+ menu->addChild(createMenuItem("Deploy to " REMOTE_NAME, "F7", [remoteDetails]() {
+ remoteUtils::sendFullPatchToRemote(remoteDetails);
+ }));
+
+ menu->addChild(createCheckMenuItem("Auto deploy to " REMOTE_NAME, "",
+ [remoteDetails]() {return remoteDetails->autoDeploy;},
+ [remoteDetails]() {
+ remoteDetails->autoDeploy = !remoteDetails->autoDeploy;
+ Engine_setRemoteDetails(APP->engine, remoteDetails->autoDeploy ? remoteDetails : nullptr);
+ }
+ ));
+#ifndef __MOD_DEVICES__
+ } else {
+ menu->addChild(createMenuItem("Connect to " REMOTE_NAME "...", "", [remoteDetails]() {
+ const std::string url = remoteDetails != nullptr ? remoteDetails->url : CARDINAL_DEFAULT_REMOTE_URL;
+ async_dialog_text_input("Remote:", url.c_str(), [](char* const url) {
+ if (url == nullptr)
+ return;
+
+ DISTRHO_SAFE_ASSERT(remoteUtils::connectToRemote(url));
+ std::free(url);
+ });
+ }));
+#endif
+ }
+#endif
+
+#ifndef DISTRHO_OS_WASM
+ if (isStandalone) {
+ menu->addChild(new ui::MenuSeparator);
@ -284,7 +349,7 @@
}
};
@@ -166,7 +311,7 @@
@@ -166,7 +371,7 @@
menu->addChild(new ui::MenuSeparator);
@ -293,7 +358,7 @@
}
};
@@ -256,7 +401,7 @@
@@ -256,7 +461,7 @@
return settings::cableTension;
}
float getDefaultValue() override {
@ -302,10 +367,11 @@
}
float getDisplayValue() override {
return getValue() * 100;
@@ -393,49 +538,36 @@
@@ -393,49 +598,39 @@
};
+#if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
+static void setAllFramebufferWidgetsDirty(widget::Widget* const widget)
+{
+ for (widget::Widget* child : widget->children)
@ -318,6 +384,7 @@
+ setAllFramebufferWidgetsDirty(child);
+ }
+}
+#endif
+
+
struct ViewButton : MenuButton {
@ -363,18 +430,19 @@
- ui::refreshTheme();
- }
- ));
+#if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
+ std::string darkModeText;
+ if (settings::darkMode)
+ darkModeText = CHECKMARK_STRING;
+ menu->addChild(createMenuItem("Dark Mode", darkModeText, []() {
+ switchDarkMode(!settings::darkMode);
+ plugin::updateStaticPluginsDarkMode();
+ setAllFramebufferWidgetsDirty(APP->scene);
+ }));
+#endif
menu->addChild(createBoolPtrMenuItem("Show tooltips", "", &settings::tooltips));
@@ -460,9 +592,18 @@
@@ -460,9 +655,18 @@
menu->addChild(haloBrightnessSlider);
menu->addChild(new ui::MenuSeparator);
@ -393,7 +461,7 @@
static const std::vector<std::string> knobModeLabels = {
"Linear",
@@ -487,11 +628,34 @@
@@ -487,11 +691,34 @@
menu->addChild(knobScrollSensitivitySlider);
menu->addChild(new ui::MenuSeparator);
@ -410,10 +478,10 @@
+ APP->window->setFullScreen(!fullscreen);
+ }));
+#endif
+
+ menu->addChild(createBoolPtrMenuItem("Invert zoom", "", &settings::invertZoom));
- 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",
@ -431,7 +499,7 @@
}
};
@@ -501,47 +665,6 @@
@@ -501,47 +728,6 @@
////////////////////
@ -479,7 +547,7 @@
struct EngineButton : MenuButton {
void onAction(const ActionEvent& e) override {
ui::Menu* menu = createMenu();
@@ -555,268 +678,46 @@
@@ -555,268 +741,46 @@
settings::cpuMeter ^= true;
}));
@ -638,7 +706,7 @@
-
- MenuItem::step();
- }
-
- void onAction(const ActionEvent& e) override {
- std::thread t([=] {
- library::syncUpdate(slug);
@ -701,7 +769,7 @@
- addChild(createMenuItem("Browse VCV Library", "", [=]() {
- system::openBrowser("https://library.vcvrack.com/");
- }));
-
- SyncUpdatesItem* syncItem = new SyncUpdatesItem;
- syncItem->text = "Update all";
- addChild(syncItem);
@ -730,7 +798,7 @@
-
-struct LibraryButton : MenuButton {
- NotificationIcon* notification;
-
- LibraryButton() {
- notification = new NotificationIcon;
- addChild(notification);
@ -747,7 +815,7 @@
- });
- t.detach();
- }
-
- void step() override {
- notification->box.pos = math::Vec(0, 0);
- notification->visible = library::hasUpdates();
@ -781,7 +849,7 @@
}
};
@@ -827,32 +728,17 @@
@@ -827,63 +791,30 @@
struct HelpButton : MenuButton {
@ -818,7 +886,9 @@
}));
menu->addChild(new ui::MenuSeparator);
@@ -861,29 +747,9 @@
+#ifndef DISTRHO_OS_WASM
menu->addChild(createMenuItem("Open user folder", "", [=]() {
system::openDirectory(asset::user(""));
}));
@ -841,6 +911,7 @@
- }
- }
+ menu->addChild(new ui::MenuSeparator);
+#endif
- void step() override {
- notification->box.pos = math::Vec(0, 0);
@ -850,7 +921,7 @@
}
};
@@ -926,15 +792,19 @@
@@ -926,15 +857,19 @@
text = "";
@ -873,7 +944,7 @@
Label::step();
}
@@ -944,7 +814,9 @@
@@ -944,7 +879,9 @@
struct MenuBar : widget::OpaqueWidget {
InfoLabel* infoLabel;
@ -884,7 +955,7 @@
const float margin = 5;
box.size.y = BND_WIDGET_HEIGHT + 2 * margin;
@@ -953,7 +825,7 @@
@@ -953,7 +890,7 @@
layout->spacing = math::Vec(0, 0);
addChild(layout);
@ -893,7 +964,7 @@
fileButton->text = "File";
layout->addChild(fileButton);
@@ -965,13 +837,11 @@
@@ -965,13 +902,11 @@
viewButton->text = "View";
layout->addChild(viewButton);
@ -909,7 +980,7 @@
HelpButton* helpButton = new HelpButton;
helpButton->text = "Help";
@@ -1003,7 +873,7 @@
@@ -1003,7 +938,7 @@
widget::Widget* createMenuBar() {

View file

@ -1,5 +1,5 @@
--- ../Rack/src/plugin/Model.cpp 2023-05-20 17:03:33.007081806 +0200
+++ Model.cpp 2023-05-20 18:29:51.484669742 +0200
--- ../Rack/src/plugin/Model.cpp 2023-06-11 21:02:02.644002965 +0200
+++ Model.cpp 2023-06-11 20:56:09.472002797 +0200
@@ -1,3 +1,30 @@
+/*
+ * DISTRHO Cardinal Plugin

View file

@ -1,5 +1,5 @@
--- ../Rack/src/app/ModuleWidget.cpp 2023-05-20 17:03:33.005081737 +0200
+++ ModuleWidget.cpp 2023-05-20 18:40:08.948302802 +0200
--- ../Rack/src/app/ModuleWidget.cpp 2023-06-11 21:02:02.640002965 +0200
+++ ModuleWidget.cpp 2023-06-11 20:56:09.476002797 +0200
@@ -1,8 +1,35 @@
+/*
+ * DISTRHO Cardinal Plugin

View file

@ -1,5 +1,5 @@
--- ../Rack/src/widget/OpenGlWidget.cpp 2022-09-21 20:49:12.201540766 +0200
+++ OpenGlWidget.cpp 2023-05-20 18:41:22.249200486 +0200
--- ../Rack/src/widget/OpenGlWidget.cpp 2023-06-11 21:02:02.644002965 +0200
+++ OpenGlWidget.cpp 2023-06-11 20:56:09.476002797 +0200
@@ -1,3 +1,30 @@
+/*
+ * DISTRHO Cardinal Plugin

View file

@ -1,5 +1,5 @@
--- ../Rack/src/app/Scene.cpp 2022-09-21 20:49:12.199540706 +0200
+++ Scene.cpp 2023-05-20 18:44:57.551491858 +0200
--- ../Rack/src/app/Scene.cpp 2023-06-11 21:02:02.640002965 +0200
+++ Scene.cpp 2023-06-11 20:56:09.476002797 +0200
@@ -1,12 +1,36 @@
-#include <thread>
-
@ -224,7 +224,7 @@
e.consume(this);
}
if (e.keyName == "q" && (e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) {
@@ -180,19 +269,22 @@
@@ -180,19 +269,25 @@
e.consume(this);
}
if (e.keyName == "o" && (e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) {
@ -237,21 +237,24 @@
+ patchUtils::revertDialog();
e.consume(this);
}
+#ifndef DISTRHO_OS_WASM
if (e.keyName == "s" && (e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) {
- APP->patch->saveDialog();
+ // NOTE: will do nothing if path is empty, intentionally
+ // NOTE: for plugin versions it will do nothing if path is empty, intentionally
+ if (APP->patch->path.empty()) {
+ if (isStandalone())
+ patchUtils::saveAsDialog();
+ } else {
+ patchUtils::saveDialog(APP->patch->path);
+ }
e.consume(this);
}
+#endif
if (e.keyName == "s" && (e.mods & RACK_MOD_MASK) == (RACK_MOD_CTRL | GLFW_MOD_SHIFT)) {
- APP->patch->saveAsDialog();
+ patchUtils::saveAsDialog();
e.consume(this);
}
if (e.keyName == "z" && (e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) {
@@ -220,24 +312,42 @@
@@ -220,24 +315,42 @@
APP->scene->rackScroll->setZoom(std::pow(2.f, zoom));
e.consume(this);
}
@ -296,7 +299,7 @@
// Module selections
if (e.keyName == "a" && (e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) {
@@ -326,13 +436,6 @@
@@ -326,13 +439,6 @@
// Key commands that can be overridden by children
if (e.action == GLFW_PRESS || e.action == GLFW_REPEAT) {
@ -310,7 +313,7 @@
if (e.keyName == "v" && (e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) {
rack->pasteClipboardAction();
e.consume(this);
@@ -351,7 +454,7 @@
@@ -351,7 +457,7 @@
std::string extension = system::getExtension(path);
if (extension == ".vcv") {

View file

@ -1,5 +1,5 @@
--- ../Rack/src/window/Window.cpp 2023-05-20 17:03:33.007081806 +0200
+++ Window.cpp 2023-05-20 19:01:25.266135825 +0200
--- ../Rack/src/window/Window.cpp 2023-06-11 21:02:02.648002965 +0200
+++ Window.cpp 2023-07-13 17:01:53.848000425 +0200
@@ -1,33 +1,94 @@
+/*
+ * DISTRHO Cardinal Plugin
@ -978,7 +978,7 @@
// t5 = system::getTime();
// DEBUG("pre-step %6.1f step %6.1f draw %6.1f nvgEndFrame %6.1f glfwSwapBuffers %6.1f total %6.1f",
// (t1 - frameTime) * 1e3f,
@@ -526,163 +705,124 @@
@@ -526,163 +705,130 @@
// (t5 - t4) * 1e3f,
// (t5 - frameTime) * 1e3f
// );
@ -1181,19 +1181,23 @@
void Window::setFullScreen(bool fullScreen) {
- if (!fullScreen) {
- glfwSetWindowMonitor(win, NULL, internal->lastWindowX, internal->lastWindowY, internal->lastWindowWidth, internal->lastWindowHeight, GLFW_DONT_CARE);
- }
+#ifdef DISTRHO_OS_WASM
+ if (fullScreen)
+ {
+ try {
+ emscripten_request_fullscreen(internal->tlw->getWindow().getApp().getClassName(), false);
+ } DISTRHO_SAFE_EXCEPTION("fullscreen");
}
- else {
- glfwGetWindowPos(win, &internal->lastWindowX, &internal->lastWindowY);
- glfwGetWindowSize(win, &internal->lastWindowWidth, &internal->lastWindowHeight);
- GLFWmonitor* monitor = glfwGetPrimaryMonitor();
- const GLFWvidmode* mode = glfwGetVideoMode(monitor);
- glfwSetWindowMonitor(win, monitor, 0, 0, mode->width, mode->height, mode->refreshRate);
- }
+#ifdef DISTRHO_OS_WASM
+ if (fullScreen)
+ emscripten_request_fullscreen(internal->tlw->getWindow().getApp().getClassName(), false);
+ else
+ {
+ emscripten_exit_fullscreen();
}
+#endif
}
@ -1214,7 +1218,7 @@
}
@@ -702,7 +842,7 @@
@@ -702,7 +848,7 @@
double Window::getFrameDurationRemaining() {
@ -1223,7 +1227,7 @@
return frameDuration - (system::getTime() - internal->frameTime);
}
@@ -713,14 +853,15 @@
@@ -713,14 +859,15 @@
return pair->second;
// Load font
@ -1242,7 +1246,7 @@
}
internal->fontCache[filename] = font;
return font;
@@ -733,14 +874,15 @@
@@ -733,14 +880,15 @@
return pair->second;
// Load image
@ -1261,7 +1265,7 @@
}
internal->imageCache[filename] = image;
return image;
@@ -757,28 +899,156 @@
@@ -757,28 +905,156 @@
}

View file

@ -1,5 +1,5 @@
--- ../Rack/dep/oui-blendish/blendish.c 2022-09-21 20:49:29.973066921 +0200
+++ blendish.c 2022-09-21 20:41:45.883648777 +0200
--- ../Rack/dep/oui-blendish/blendish.c 2023-06-11 21:02:28.136002978 +0200
+++ blendish.c 2023-06-11 20:56:09.476002797 +0200
@@ -61,7 +61,7 @@
}

View file

@ -1,5 +1,5 @@
--- ../Rack/src/common.cpp 2023-05-20 17:03:33.006081772 +0200
+++ common.cpp 2023-05-20 17:51:04.675045244 +0200
--- ../Rack/src/common.cpp 2023-06-11 21:02:02.640002965 +0200
+++ common.cpp 2023-06-11 20:56:09.476002797 +0200
@@ -1,12 +1,57 @@
+/*
+ * DISTRHO Cardinal Plugin
@ -60,7 +60,7 @@
}
#endif
@@ -14,12 +59,11 @@
@@ -14,30 +59,21 @@
namespace rack {
@ -76,21 +76,23 @@
+const std::string APP_VERSION = "2.3.0";
#if defined ARCH_WIN
const std::string APP_OS = "win";
const std::string APP_OS_NAME = "Windows";
@@ -29,15 +73,10 @@
- const std::string APP_OS_NAME = "Windows";
#elif defined ARCH_MAC
const std::string APP_OS = "mac";
- const std::string APP_OS_NAME = "macOS";
#elif defined ARCH_LIN
const std::string APP_OS = "lin";
const std::string APP_OS_NAME = "Linux";
+#else
+ #error ARCH_LIN undefined
#endif
- const std::string APP_OS_NAME = "Linux";
-#endif
-#if defined ARCH_X64
- const std::string APP_CPU = "x64";
- const std::string APP_CPU_NAME = "x64";
-#elif defined ARCH_ARM64
- const std::string APP_CPU = "arm64";
- const std::string APP_CPU_NAME = "ARM64";
-#endif
+#else
+ #error ARCH_LIN undefined
#endif
-const std::string API_URL = "https://api.vcvrack.com";
+const std::string API_URL = "";

View file

@ -1,5 +1,5 @@
--- ../Rack/src/context.cpp 2023-05-20 17:03:33.006081772 +0200
+++ context.cpp 2023-05-20 18:08:56.497736615 +0200
--- ../Rack/src/context.cpp 2023-06-11 21:02:02.640002965 +0200
+++ context.cpp 2023-06-11 20:56:09.476002797 +0200
@@ -1,14 +1,44 @@
+/*
+ * DISTRHO Cardinal Plugin

View file

@ -1,5 +1,5 @@
--- ../Rack/src/dsp/minblep.cpp 2022-09-21 20:49:12.200540736 +0200
+++ minblep.cpp 2023-05-20 18:21:44.019059009 +0200
--- ../Rack/src/dsp/minblep.cpp 2023-06-11 21:02:02.644002965 +0200
+++ minblep.cpp 2023-06-11 20:56:09.476002797 +0200
@@ -1,3 +1,30 @@
+/*
+ * DISTRHO Cardinal Plugin

View file

@ -1,5 +1,5 @@
--- ../Rack/src/plugin.cpp 2023-05-20 17:03:33.006081772 +0200
+++ plugin.cpp 2023-05-20 18:43:27.496323540 +0200
--- ../Rack/src/plugin.cpp 2023-06-11 21:02:02.644002965 +0200
+++ plugin.cpp 2023-06-11 20:56:09.476002797 +0200
@@ -1,356 +1,46 @@
-#include <thread>
-#include <map>