|
|
|
@@ -15,6 +15,10 @@ |
|
|
|
* For a full copy of the GNU General Public License see the doc/GPL.txt file. |
|
|
|
*/ |
|
|
|
|
|
|
|
#ifndef CARLA_PLUGIN_PATCHBAY |
|
|
|
# error CARLA_PLUGIN_PATCHBAY undefined |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifndef CARLA_PLUGIN_SYNTH |
|
|
|
# error CARLA_PLUGIN_SYNTH undefined |
|
|
|
#endif |
|
|
|
@@ -727,15 +731,25 @@ static intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t |
|
|
|
if (d_lastSampleRate <= 0.0) |
|
|
|
d_lastSampleRate = 44100.0; |
|
|
|
|
|
|
|
const NativePluginDescriptor* pluginDesc = nullptr; |
|
|
|
#if CARLA_PLUGIN_PATCHBAY |
|
|
|
# ifdef CARLA_PLUGIN_16CH |
|
|
|
const char* const pluginLabel = "carlapatchbay16"; |
|
|
|
# else |
|
|
|
const char* const pluginLabel = "carlapatchbay"; |
|
|
|
# endif |
|
|
|
#else |
|
|
|
const char* const pluginLabel = "carlarack"; |
|
|
|
#endif |
|
|
|
|
|
|
|
PluginListManager& plm(PluginListManager::getInstance()); |
|
|
|
const NativePluginDescriptor* pluginDesc = nullptr; |
|
|
|
|
|
|
|
for (LinkedList<const NativePluginDescriptor*>::Itenerator it = plm.descs.begin2(); it.valid(); it.next()) |
|
|
|
{ |
|
|
|
const NativePluginDescriptor* const& tmpDesc(it.getValue(nullptr)); |
|
|
|
CARLA_SAFE_ASSERT_CONTINUE(tmpDesc != nullptr); |
|
|
|
|
|
|
|
if (std::strcmp(tmpDesc->label, "carlarack") == 0) |
|
|
|
if (std::strcmp(tmpDesc->label, pluginLabel) == 0) |
|
|
|
{ |
|
|
|
pluginDesc = tmpDesc; |
|
|
|
break; |
|
|
|
@@ -783,10 +797,22 @@ static intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t |
|
|
|
case effGetEffectName: |
|
|
|
if (char* const cptr = (char*)ptr) |
|
|
|
{ |
|
|
|
#if CARLA_PLUGIN_SYNTH |
|
|
|
std::strncpy(cptr, "CarlaRack", 32); |
|
|
|
#if CARLA_PLUGIN_PATCHBAY |
|
|
|
# if CARLA_PLUGIN_SYNTH |
|
|
|
# ifdef CARLA_PLUGIN_16CH |
|
|
|
std::strncpy(cptr, "Carla-Patchbay16", 32); |
|
|
|
# else |
|
|
|
std::strncpy(cptr, "Carla-Patchbay", 32); |
|
|
|
# endif |
|
|
|
# else |
|
|
|
std::strncpy(cptr, "Carla-PatchbayFX", 32); |
|
|
|
# endif |
|
|
|
#else |
|
|
|
std::strncpy(cptr, "CarlaRackFX", 32); |
|
|
|
# if CARLA_PLUGIN_SYNTH |
|
|
|
std::strncpy(cptr, "Carla-Rack", 32); |
|
|
|
# else |
|
|
|
std::strncpy(cptr, "Carla-RackFX", 32); |
|
|
|
# endif |
|
|
|
#endif |
|
|
|
return 1; |
|
|
|
} |
|
|
|
@@ -803,10 +829,22 @@ static intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t |
|
|
|
case effGetProductString: |
|
|
|
if (char* const cptr = (char*)ptr) |
|
|
|
{ |
|
|
|
#if CARLA_PLUGIN_SYNTH |
|
|
|
std::strncpy(cptr, "CarlaRack", 32); |
|
|
|
#if CARLA_PLUGIN_PATCHBAY |
|
|
|
# if CARLA_PLUGIN_SYNTH |
|
|
|
# ifdef CARLA_PLUGIN_16CH |
|
|
|
std::strncpy(cptr, "CarlaPatchbay16", 32); |
|
|
|
# else |
|
|
|
std::strncpy(cptr, "CarlaPatchbay", 32); |
|
|
|
# endif |
|
|
|
# else |
|
|
|
std::strncpy(cptr, "CarlaPatchbayFX", 32); |
|
|
|
# endif |
|
|
|
#else |
|
|
|
# if CARLA_PLUGIN_SYNTH |
|
|
|
std::strncpy(cptr, "CarlaRack", 32); |
|
|
|
# else |
|
|
|
std::strncpy(cptr, "CarlaRackFX", 32); |
|
|
|
# endif |
|
|
|
#endif |
|
|
|
return 1; |
|
|
|
} |
|
|
|
@@ -882,16 +920,33 @@ const AEffect* VSTPluginMain(audioMasterCallback audioMaster) |
|
|
|
|
|
|
|
static const int32_t uniqueId = CCONST('C', 'r', 'l', 'a'); |
|
|
|
#if CARLA_PLUGIN_SYNTH |
|
|
|
# if CARLA_PLUGIN_PATCHBAY |
|
|
|
# ifdef CARLA_PLUGIN_16CH |
|
|
|
effect->uniqueID = uniqueId+5; |
|
|
|
# else |
|
|
|
effect->uniqueID = uniqueId+4; |
|
|
|
# endif |
|
|
|
# else |
|
|
|
effect->uniqueID = uniqueId+3; |
|
|
|
# endif |
|
|
|
#else |
|
|
|
# if CARLA_PLUGIN_PATCHBAY |
|
|
|
effect->uniqueID = uniqueId+2; |
|
|
|
# else |
|
|
|
effect->uniqueID = uniqueId+1; |
|
|
|
# endif |
|
|
|
#endif |
|
|
|
|
|
|
|
// plugin fields |
|
|
|
effect->numParams = 0; |
|
|
|
effect->numPrograms = 0; |
|
|
|
#ifdef CARLA_PLUGIN_16CH |
|
|
|
effect->numInputs = 16; |
|
|
|
effect->numOutputs = 16; |
|
|
|
#else |
|
|
|
effect->numInputs = 2; |
|
|
|
effect->numOutputs = 2; |
|
|
|
#endif |
|
|
|
|
|
|
|
// plugin flags |
|
|
|
effect->flags |= effFlagsCanReplacing; |
|
|
|
|