Browse Source

Update to Rack 2.1.1

Signed-off-by: falkTX <falktx@falktx.com>
tags/22.06
falkTX 3 years ago
parent
commit
ed0a04a11c
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
9 changed files with 68 additions and 32 deletions
  1. +3
    -0
      src/CardinalPlugin.cpp
  2. +1
    -1
      src/Rack
  3. +1
    -1
      src/override/common.cpp
  4. +1
    -1
      src/override/diffs/MenuBar.cpp.diff
  5. +1
    -1
      src/override/diffs/Model.cpp.diff
  6. +1
    -1
      src/override/diffs/Window.cpp.diff
  7. +2
    -2
      src/override/diffs/common.cpp.diff
  8. +54
    -25
      src/override/diffs/plugin.cpp.diff
  9. +4
    -0
      src/override/plugin.cpp

+ 3
- 0
src/CardinalPlugin.cpp View File

@@ -248,6 +248,9 @@ struct Initializer
INFO("Destroying plugins");
plugin::destroyStaticPlugins();
INFO("Destroying settings");
settings::destroy();
INFO("Destroying logger");
logger::destroy();
}


+ 1
- 1
src/Rack

@@ -1 +1 @@
Subproject commit 30665d62801c2ced7260a37a2d0214edfe6528a9
Subproject commit b016cacb10c4fd66d814b924bc2774242f74c836

+ 1
- 1
src/override/common.cpp View File

@@ -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
- 1
src/override/diffs/MenuBar.cpp.diff View File

@@ -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
- 1
src/override/diffs/Model.cpp.diff View File

@@ -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
- 1
src/override/diffs/Window.cpp.diff View File

@@ -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


+ 2
- 2
src/override/diffs/common.cpp.diff View File

@@ -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


+ 54
- 25
src/override/diffs/plugin.cpp.diff View File

@@ -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);
-
- // 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());
- // Load modules manifest
- json_t* modulesJ = json_object_get(rootJ, "modules");
- plugin->modulesFromJson(modulesJ);
-
- // 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 @@
}


+ 4
- 0
src/override/plugin.cpp View File

@@ -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…
Cancel
Save