Make preset save/load actions work, requires rebuild

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2021-12-12 01:40:01 +00:00
parent 6be9bac686
commit 18f6e9a9b4
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
7 changed files with 374 additions and 0 deletions

View file

@ -0,0 +1,40 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#pragma once
#ifdef BUILDING_PLUGIN_MODULES
# include <plugin/Model.hpp>
# undef ModuleWidget
#endif
#include_next <app/ModuleWidget.hpp>
#ifdef BUILDING_PLUGIN_MODULES
namespace rack {
namespace app {
struct CardinalModuleWidget : ModuleWidget {
CardinalModuleWidget() : ModuleWidget() {}
DEPRECATED CardinalModuleWidget(engine::Module* module) : ModuleWidget() {
setModule(module);
}
void onButton(const ButtonEvent& e) override;
};
}
}
# define ModuleWidget CardinalModuleWidget
#endif

View file

@ -0,0 +1,28 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#pragma once
#ifdef BUILDING_PLUGIN_MODULES
# undef ModuleWidget
#endif
#include_next <app/RackWidget.hpp>
#ifdef BUILDING_PLUGIN_MODULES
# define ModuleWidget CardinalModuleWidget
#endif

View file

@ -17,6 +17,7 @@
#pragma once
// check if PRIVATE is defined already before including any headers
#ifdef PRIVATE
# define PRIVATE_WAS_DEFINED
#endif
@ -34,10 +35,12 @@
#define BINARY_END(sym) ((const void*) sym + sym##_len)
#define BINARY_SIZE(sym) (sym##_len)
// undefine PRIVATE if needed
#if defined(PRIVATE) && !defined(PRIVATE_WAS_DEFINED)
# undef PRIVATE
#endif
// and also our flag
#undef PRIVATE_WAS_DEFINED
// Cardinal specific API

29
include/plugin/Model.hpp Normal file
View file

@ -0,0 +1,29 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#pragma once
#ifdef BUILDING_PLUGIN_MODULES
namespace rack {
namespace app {
struct CardinalModuleWidget;
}
}
# define ModuleWidget CardinalModuleWidget
#endif
#include_next <plugin/Model.hpp>