Signed-off-by: falkTX <falktx@falktx.com>tags/22.11
| @@ -15,25 +15,7 @@ | |||||
| * For a full copy of the GNU General Public License see the LICENSE file. | * For a full copy of the GNU General Public License see the LICENSE file. | ||||
| */ | */ | ||||
| #ifndef PLUGIN_BRAND | |||||
| # error PLUGIN_BRAND undefined | |||||
| #endif | |||||
| #ifndef PLUGIN_LABEL | |||||
| # error PLUGIN_LABEL undefined | |||||
| #endif | |||||
| #ifndef PLUGIN_MODEL | |||||
| # error PLUGIN_MODEL undefined | |||||
| #endif | |||||
| #ifndef PLUGIN_CV_INPUTS | |||||
| # error PLUGIN_CV_INPUTS undefined | |||||
| #endif | |||||
| #ifndef PLUGIN_CV_OUTPUTS | |||||
| # error PLUGIN_CV_OUTPUTS undefined | |||||
| #endif | |||||
| #include "lv2plugin.hpp" | |||||
| #include <cstdio> | #include <cstdio> | ||||
| @@ -15,26 +15,7 @@ | |||||
| * For a full copy of the GNU General Public License see the LICENSE file. | * For a full copy of the GNU General Public License see the LICENSE file. | ||||
| */ | */ | ||||
| #ifndef PLUGIN_MODEL | |||||
| # error PLUGIN_MODEL undefined | |||||
| #endif | |||||
| #ifndef PLUGIN_CV_INPUTS | |||||
| # error PLUGIN_CV_INPUTS undefined | |||||
| #endif | |||||
| #ifndef PLUGIN_CV_OUTPUTS | |||||
| # error PLUGIN_CV_OUTPUTS undefined | |||||
| #endif | |||||
| enum PortType { | |||||
| Audio = 0, | |||||
| Bi = 1, | |||||
| Uni = 2, | |||||
| }; | |||||
| static constexpr const int kCvInputs[] = PLUGIN_CV_INPUTS; | |||||
| static constexpr const int kCvOutputs[] = PLUGIN_CV_OUTPUTS; | |||||
| #include "lv2plugin.hpp" | |||||
| #include "src/lv2/buf-size.h" | #include "src/lv2/buf-size.h" | ||||
| #include "src/lv2/options.h" | #include "src/lv2/options.h" | ||||
| @@ -185,21 +166,19 @@ static LV2_Handle lv2_instantiate(const LV2_Descriptor*, double sampleRate, cons | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| #define instancePtr ((PluginLv2*)instance) | |||||
| static void lv2_connect_port(LV2_Handle instance, uint32_t port, void* dataLocation) | static void lv2_connect_port(LV2_Handle instance, uint32_t port, void* dataLocation) | ||||
| { | { | ||||
| instancePtr->lv2_connect_port(port, dataLocation); | |||||
| static_cast<PluginLv2*>(instance)->lv2_connect_port(port, dataLocation); | |||||
| } | } | ||||
| static void lv2_run(LV2_Handle instance, uint32_t sampleCount) | static void lv2_run(LV2_Handle instance, uint32_t sampleCount) | ||||
| { | { | ||||
| instancePtr->lv2_run(sampleCount); | |||||
| static_cast<PluginLv2*>(instance)->lv2_run(sampleCount); | |||||
| } | } | ||||
| static void lv2_cleanup(LV2_Handle instance) | static void lv2_cleanup(LV2_Handle instance) | ||||
| { | { | ||||
| delete instancePtr; | |||||
| delete static_cast<PluginLv2*>(instance); | |||||
| } | } | ||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| @@ -209,8 +188,6 @@ static const void* lv2_extension_data(const char* uri) | |||||
| return nullptr; | return nullptr; | ||||
| } | } | ||||
| #undef instancePtr | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| static const LV2_Descriptor sLv2Descriptor = { | static const LV2_Descriptor sLv2Descriptor = { | ||||
| @@ -0,0 +1,47 @@ | |||||
| /* | |||||
| * DISTRHO Cardinal Plugin | |||||
| * Copyright (C) 2021-2022 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 | |||||
| #ifndef PLUGIN_BRAND | |||||
| # error PLUGIN_BRAND undefined | |||||
| #endif | |||||
| #ifndef PLUGIN_LABEL | |||||
| # error PLUGIN_LABEL undefined | |||||
| #endif | |||||
| #ifndef PLUGIN_MODEL | |||||
| # error PLUGIN_MODEL undefined | |||||
| #endif | |||||
| #ifndef PLUGIN_CV_INPUTS | |||||
| # error PLUGIN_CV_INPUTS undefined | |||||
| #endif | |||||
| #ifndef PLUGIN_CV_OUTPUTS | |||||
| # error PLUGIN_CV_OUTPUTS undefined | |||||
| #endif | |||||
| enum PortType { | |||||
| Audio = 0, | |||||
| Bi = 1, | |||||
| Uni = 2, | |||||
| }; | |||||
| static constexpr const PortType kCvInputs[] = PLUGIN_CV_INPUTS; | |||||
| static constexpr const PortType kCvOutputs[] = PLUGIN_CV_OUTPUTS; | |||||
| @@ -55,8 +55,8 @@ | |||||
| #define PLUGIN_BRAND "AudibleInstruments" | #define PLUGIN_BRAND "AudibleInstruments" | ||||
| #define PLUGIN_LABEL "Macro Osc 2" | #define PLUGIN_LABEL "Macro Osc 2" | ||||
| #define PLUGIN_MODEL modelPlaits | #define PLUGIN_MODEL modelPlaits | ||||
| #define PLUGIN_CV_INPUTS {1,1,1,1,1,1,1,1} | |||||
| #define PLUGIN_CV_OUTPUTS {0,0} | |||||
| #define PLUGIN_CV_INPUTS {Bi,Bi,Bi,Bi,Bi,Bi,Bi,Bi} | |||||
| #define PLUGIN_CV_OUTPUTS {Audio,Audio} | |||||
| #define PLUGIN_LV2_CATEGORY "lv2:GeneratorPlugin" | #define PLUGIN_LV2_CATEGORY "lv2:GeneratorPlugin" | ||||
| #include "lv2plugin.cpp" | #include "lv2plugin.cpp" | ||||
| @@ -35,8 +35,8 @@ | |||||
| #define PLUGIN_BRAND "AudibleInstruments" | #define PLUGIN_BRAND "AudibleInstruments" | ||||
| #define PLUGIN_LABEL "Macro Osc" | #define PLUGIN_LABEL "Macro Osc" | ||||
| #define PLUGIN_MODEL modelBraids | #define PLUGIN_MODEL modelBraids | ||||
| #define PLUGIN_CV_INPUTS {1,1,1,1,1} | |||||
| #define PLUGIN_CV_OUTPUTS {0} | |||||
| #define PLUGIN_CV_INPUTS {Bi,Bi,Bi,Bi,Bi} | |||||
| #define PLUGIN_CV_OUTPUTS {Audio} | |||||
| #define PLUGIN_LV2_CATEGORY "lv2:GeneratorPlugin" | #define PLUGIN_LV2_CATEGORY "lv2:GeneratorPlugin" | ||||
| #include "lv2plugin.cpp" | #include "lv2plugin.cpp" | ||||
| @@ -20,8 +20,8 @@ | |||||
| #define PLUGIN_BRAND "MSM" | #define PLUGIN_BRAND "MSM" | ||||
| #define PLUGIN_LABEL "Phaser" | #define PLUGIN_LABEL "Phaser" | ||||
| #define PLUGIN_MODEL modelPhaserModule | #define PLUGIN_MODEL modelPhaserModule | ||||
| #define PLUGIN_CV_INPUTS {1,1,1,0} | |||||
| #define PLUGIN_CV_OUTPUTS {0} | |||||
| #define PLUGIN_CV_INPUTS {Bi,Bi,Bi,Audio} | |||||
| #define PLUGIN_CV_OUTPUTS {Audio} | |||||
| #define PLUGIN_LV2_CATEGORY "lv2:DistortionPlugin" | #define PLUGIN_LV2_CATEGORY "lv2:DistortionPlugin" | ||||
| #include "lv2plugin.cpp" | #include "lv2plugin.cpp" | ||||
| @@ -20,8 +20,8 @@ | |||||
| #define PLUGIN_BRAND "Rackwindows" | #define PLUGIN_BRAND "Rackwindows" | ||||
| #define PLUGIN_LABEL "MV" | #define PLUGIN_LABEL "MV" | ||||
| #define PLUGIN_MODEL modelMv | #define PLUGIN_MODEL modelMv | ||||
| #define PLUGIN_CV_INPUTS {1,1,1,1,0,0} | |||||
| #define PLUGIN_CV_OUTPUTS {0,0} | |||||
| #define PLUGIN_CV_INPUTS {Bi,Bi,Bi,Bi,Audio,Audio} | |||||
| #define PLUGIN_CV_OUTPUTS {Audio,Audio} | |||||
| #define PLUGIN_LV2_CATEGORY "lv2:ReverbPlugin" | #define PLUGIN_LV2_CATEGORY "lv2:ReverbPlugin" | ||||
| #include "lv2plugin.cpp" | #include "lv2plugin.cpp" | ||||
| @@ -20,8 +20,8 @@ | |||||
| #define PLUGIN_BRAND "Rackwindows" | #define PLUGIN_BRAND "Rackwindows" | ||||
| #define PLUGIN_LABEL "Vibrato" | #define PLUGIN_LABEL "Vibrato" | ||||
| #define PLUGIN_MODEL modelVibrato | #define PLUGIN_MODEL modelVibrato | ||||
| #define PLUGIN_CV_INPUTS {1,1,1,1,1,0} | |||||
| #define PLUGIN_CV_OUTPUTS {1,0,1} | |||||
| #define PLUGIN_CV_INPUTS {Bi,Bi,Bi,Bi,Bi,Audio} | |||||
| #define PLUGIN_CV_OUTPUTS {Bi,Audio,Bi} | |||||
| #define PLUGIN_LV2_CATEGORY "lv2:DynamicsPlugin" | #define PLUGIN_LV2_CATEGORY "lv2:DynamicsPlugin" | ||||
| #include "lv2plugin.cpp" | #include "lv2plugin.cpp" | ||||
| @@ -23,8 +23,8 @@ | |||||
| #define PLUGIN_BRAND "Valley Audio" | #define PLUGIN_BRAND "Valley Audio" | ||||
| #define PLUGIN_LABEL "Plateau" | #define PLUGIN_LABEL "Plateau" | ||||
| #define PLUGIN_MODEL modelPlateau | #define PLUGIN_MODEL modelPlateau | ||||
| #define PLUGIN_CV_INPUTS {0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} | |||||
| #define PLUGIN_CV_OUTPUTS {0,0} | |||||
| #define PLUGIN_CV_INPUTS {Audio,Audio,Bi,Bi,Bi,Bi,Bi,Bi,Bi,Bi,Bi,Bi,Bi,Bi,Bi,Bi,Bi} | |||||
| #define PLUGIN_CV_OUTPUTS {Audio,Audio} | |||||
| #define PLUGIN_LV2_CATEGORY "lv2:ReverbPlugin" | #define PLUGIN_LV2_CATEGORY "lv2:ReverbPlugin" | ||||
| #include "lv2plugin.cpp" | #include "lv2plugin.cpp" | ||||