Update to Rack 2.1.1
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
5eba049074
commit
ed0a04a11c
9 changed files with 67 additions and 31 deletions
|
@ -248,6 +248,9 @@ struct Initializer
|
|||
INFO("Destroying plugins");
|
||||
plugin::destroyStaticPlugins();
|
||||
|
||||
INFO("Destroying settings");
|
||||
settings::destroy();
|
||||
|
||||
INFO("Destroying logger");
|
||||
logger::destroy();
|
||||
}
|
||||
|
|
2
src/Rack
2
src/Rack
|
@ -1 +1 @@
|
|||
Subproject commit 30665d62801c2ced7260a37a2d0214edfe6528a9
|
||||
Subproject commit b016cacb10c4fd66d814b924bc2774242f74c836
|
|
@ -50,7 +50,7 @@ const std::string APP_NAME = "Cardinal";
|
|||
const std::string APP_EDITION = getPluginFormatName();
|
||||
const std::string APP_EDITION_NAME = "Audio Plugin";
|
||||
const std::string APP_VERSION_MAJOR = "2";
|
||||
const std::string APP_VERSION = "2.1";
|
||||
const std::string APP_VERSION = "2.1.1";
|
||||
#if defined ARCH_WIN
|
||||
const std::string APP_OS = "win";
|
||||
#elif defined ARCH_MAC
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--- ../Rack/src/app/MenuBar.cpp 2022-02-26 23:08:06.697192725 +0000
|
||||
+++ MenuBar.cpp 2022-04-27 17:30:16.653341980 +0100
|
||||
+++ MenuBar.cpp 2022-04-27 18:17:16.790097058 +0100
|
||||
@@ -1,8 +1,33 @@
|
||||
+/*
|
||||
+ * DISTRHO Cardinal Plugin
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--- ../Rack/src/plugin/Model.cpp 2021-10-17 13:57:23.257633662 +0100
|
||||
+++ Model.cpp 2022-04-27 17:55:57.362107553 +0100
|
||||
+++ Model.cpp 2022-04-27 18:17:16.790097058 +0100
|
||||
@@ -1,3 +1,30 @@
|
||||
+/*
|
||||
+ * DISTRHO Cardinal Plugin
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--- ../Rack/src/window/Window.cpp 2022-02-09 15:35:19.238863170 +0000
|
||||
+++ Window.cpp 2022-04-27 16:53:59.743671091 +0100
|
||||
+++ Window.cpp 2022-05-15 12:05:26.430956655 +0100
|
||||
@@ -1,33 +1,83 @@
|
||||
+/*
|
||||
+ * DISTRHO Cardinal Plugin
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--- ../Rack/src/common.cpp 2021-11-23 19:57:23.719015894 +0000
|
||||
+++ common.cpp 2022-03-14 23:25:17.492322806 +0000
|
||||
+++ common.cpp 2022-05-21 22:13:36.682680714 +0100
|
||||
@@ -1,6 +1,38 @@
|
||||
+/*
|
||||
+ * DISTRHO Cardinal Plugin
|
||||
|
@ -52,7 +52,7 @@
|
|||
+const std::string APP_EDITION_NAME = "Audio Plugin";
|
||||
const std::string APP_VERSION_MAJOR = "2";
|
||||
-const std::string APP_VERSION = TOSTRING(_APP_VERSION);
|
||||
+const std::string APP_VERSION = "2.1";
|
||||
+const std::string APP_VERSION = "2.1.1";
|
||||
#if defined ARCH_WIN
|
||||
const std::string APP_OS = "win";
|
||||
-#elif ARCH_MAC
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- ../Rack/src/plugin.cpp 2022-02-05 22:30:09.265393248 +0000
|
||||
+++ plugin.cpp 2022-01-30 00:24:49.375329910 +0000
|
||||
@@ -1,308 +1,40 @@
|
||||
--- ../Rack/src/plugin.cpp 2022-05-21 22:03:14.887288742 +0100
|
||||
+++ plugin.cpp 2022-05-21 22:14:18.180931534 +0100
|
||||
@@ -1,336 +1,41 @@
|
||||
-#include <thread>
|
||||
-#include <map>
|
||||
-#include <stdexcept>
|
||||
|
@ -72,6 +72,18 @@
|
|||
-// private API
|
||||
-////////////////////
|
||||
-
|
||||
-
|
||||
-static void* getSymbol(void* handle, const char* name) {
|
||||
- if (!handle)
|
||||
- return NULL;
|
||||
-
|
||||
-#if defined ARCH_WIN
|
||||
- return (void*) GetProcAddress((HMODULE) handle, name);
|
||||
-#else
|
||||
- return dlsym(handle, name);
|
||||
-#endif
|
||||
-}
|
||||
-
|
||||
-/** Returns library handle */
|
||||
-static void* loadLibrary(std::string libraryPath) {
|
||||
-#if defined ARCH_WIN
|
||||
|
@ -131,12 +143,7 @@
|
|||
- plugin->handle = loadLibrary(libraryPath);
|
||||
-
|
||||
- // Get plugin's init() function
|
||||
- InitCallback initCallback;
|
||||
-#if defined ARCH_WIN
|
||||
- initCallback = (InitCallback) GetProcAddress((HMODULE) plugin->handle, "init");
|
||||
-#else
|
||||
- initCallback = (InitCallback) dlsym(plugin->handle, "init");
|
||||
-#endif
|
||||
- InitCallback initCallback = (InitCallback) getSymbol(plugin->handle, "init");
|
||||
- if (!initCallback)
|
||||
- throw Exception("Failed to read init() symbol in %s", libraryPath.c_str());
|
||||
-
|
||||
|
@ -183,6 +190,14 @@
|
|||
- throw Exception("JSON parsing error at %s %d:%d %s", manifestFilename.c_str(), error.line, error.column, error.text);
|
||||
- DEFER({json_decref(rootJ);});
|
||||
-
|
||||
- // Load manifest
|
||||
- plugin->fromJson(rootJ);
|
||||
-
|
||||
- // Reject plugin if slug already exists
|
||||
- Plugin* existingPlugin = getPlugin(plugin->slug);
|
||||
- if (existingPlugin)
|
||||
- throw Exception("Plugin %s is already loaded, not attempting to load it again", plugin->slug.c_str());
|
||||
-
|
||||
- // Call init callback
|
||||
- InitCallback initCallback;
|
||||
- if (path == "") {
|
||||
|
@ -193,13 +208,18 @@
|
|||
- }
|
||||
- initCallback(plugin);
|
||||
-
|
||||
- // Load manifest
|
||||
- plugin->fromJson(rootJ);
|
||||
- // Load modules manifest
|
||||
- json_t* modulesJ = json_object_get(rootJ, "modules");
|
||||
- plugin->modulesFromJson(modulesJ);
|
||||
-
|
||||
- // Reject plugin if slug already exists
|
||||
- Plugin* existingPlugin = getPlugin(plugin->slug);
|
||||
- if (existingPlugin)
|
||||
- throw Exception("Plugin %s is already loaded, not attempting to load it again", plugin->slug.c_str());
|
||||
- // Call settingsFromJson() if exists
|
||||
- // Returns NULL for Core.
|
||||
- auto settingsFromJson = (decltype(&::settingsFromJson)) getSymbol(plugin->handle, "settingsFromJson");
|
||||
- if (settingsFromJson) {
|
||||
- json_t* settingsJ = json_object_get(settings::pluginSettingsJ, plugin->slug.c_str());
|
||||
- if (settingsJ)
|
||||
- settingsFromJson(settingsJ);
|
||||
- }
|
||||
- }
|
||||
- catch (Exception& e) {
|
||||
- WARN("Could not load plugin %s: %s", path.c_str(), e.what());
|
||||
|
@ -296,11 +316,7 @@
|
|||
- typedef void (*DestroyCallback)();
|
||||
- DestroyCallback destroyCallback = NULL;
|
||||
- if (handle) {
|
||||
-#if defined ARCH_WIN
|
||||
- destroyCallback = (DestroyCallback) GetProcAddress((HMODULE) handle, "destroy");
|
||||
-#else
|
||||
- destroyCallback = (DestroyCallback) dlsym(handle, "destroy");
|
||||
-#endif
|
||||
- destroyCallback = (DestroyCallback) getSymbol(handle, "destroy");
|
||||
- }
|
||||
- if (destroyCallback) {
|
||||
- try {
|
||||
|
@ -334,10 +350,23 @@
|
|||
-}
|
||||
-
|
||||
-
|
||||
-void settingsMergeJson(json_t* rootJ) {
|
||||
- for (Plugin* plugin : plugins) {
|
||||
- auto settingsToJson = (decltype(&::settingsToJson)) getSymbol(plugin->handle, "settingsToJson");
|
||||
- if (settingsToJson) {
|
||||
- json_t* settingsJ = settingsToJson();
|
||||
- json_object_set_new(rootJ, plugin->slug.c_str(), settingsJ);
|
||||
- }
|
||||
- else {
|
||||
- json_object_del(rootJ, plugin->slug.c_str());
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
+void settingsMergeJson(json_t*) {}
|
||||
|
||||
|
||||
/** Given slug => fallback slug.
|
||||
Correctly handles bidirectional fallbacks.
|
||||
To request fallback slugs to be added to this list, open a GitHub issue.
|
||||
@@ -352,8 +84,19 @@
|
||||
@@ -383,8 +88,19 @@
|
||||
*/
|
||||
using PluginModuleSlug = std::tuple<std::string, std::string>;
|
||||
static const std::map<PluginModuleSlug, PluginModuleSlug> moduleSlugFallbacks = {
|
||||
|
@ -358,7 +387,7 @@
|
|||
// {{"", ""}, {"", ""}},
|
||||
};
|
||||
|
||||
@@ -441,7 +184,6 @@
|
||||
@@ -472,7 +188,6 @@
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -35,6 +35,9 @@ namespace rack {
|
|||
namespace plugin {
|
||||
|
||||
|
||||
void settingsMergeJson(json_t*) {}
|
||||
|
||||
|
||||
/** Given slug => fallback slug.
|
||||
Correctly handles bidirectional fallbacks.
|
||||
To request fallback slugs to be added to this list, open a GitHub issue.
|
||||
|
@ -43,6 +46,7 @@ static const std::map<std::string, std::string> pluginSlugFallbacks = {
|
|||
{"VultModulesFree", "VultModules"},
|
||||
{"VultModules", "VultModulesFree"},
|
||||
{"AudibleInstrumentsPreview", "AudibleInstruments"},
|
||||
{"SequelSequencers", "DanielDavies"},
|
||||
// {"", ""},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue