|
@@ -519,7 +519,7 @@ void createLv2Files(const char* basename) |
|
|
|
|
|
|
|
|
std::cout << "Writing " << binary << ".ttl..."; std::cout.flush(); |
|
|
std::cout << "Writing " << binary << ".ttl..."; std::cout.flush(); |
|
|
std::fstream plugin(binaryTTL.toUTF8(), std::ios::out); |
|
|
std::fstream plugin(binaryTTL.toUTF8(), std::ios::out); |
|
|
plugin << makePluginFile(filter, JucePlugin_MaxNumInputChannels, JucePlugin_MaxNumOutputChannels) << std::endl; |
|
|
|
|
|
|
|
|
plugin << makePluginFile(filter, filter->getTotalNumInputChannels(), filter->getTotalNumOutputChannels()) << std::endl; |
|
|
plugin.close(); |
|
|
plugin.close(); |
|
|
std::cout << " done!" << std::endl; |
|
|
std::cout << " done!" << std::endl; |
|
|
|
|
|
|
|
@@ -873,8 +873,8 @@ public: |
|
|
#if JucePlugin_WantsLV2Latency |
|
|
#if JucePlugin_WantsLV2Latency |
|
|
controlPortOffset += 1; |
|
|
controlPortOffset += 1; |
|
|
#endif |
|
|
#endif |
|
|
controlPortOffset += JucePlugin_MaxNumInputChannels; |
|
|
|
|
|
controlPortOffset += JucePlugin_MaxNumOutputChannels; |
|
|
|
|
|
|
|
|
controlPortOffset += filter->getTotalNumInputChannels(); |
|
|
|
|
|
controlPortOffset += filter->getTotalNumOutputChannels(); |
|
|
|
|
|
|
|
|
lastProgramCount = filter->getNumPrograms(); |
|
|
lastProgramCount = filter->getNumPrograms(); |
|
|
} |
|
|
} |
|
@@ -1123,8 +1123,8 @@ class JuceLv2Wrapper : public AudioPlayHead |
|
|
public: |
|
|
public: |
|
|
//============================================================================== |
|
|
//============================================================================== |
|
|
JuceLv2Wrapper (double sampleRate_, const LV2_Feature* const* features) |
|
|
JuceLv2Wrapper (double sampleRate_, const LV2_Feature* const* features) |
|
|
: numInChans (JucePlugin_MaxNumInputChannels), |
|
|
|
|
|
numOutChans (JucePlugin_MaxNumOutputChannels), |
|
|
|
|
|
|
|
|
: numInChans (0), |
|
|
|
|
|
numOutChans (0), |
|
|
bufferSize (2048), |
|
|
bufferSize (2048), |
|
|
sampleRate (sampleRate_), |
|
|
sampleRate (sampleRate_), |
|
|
uridMap (nullptr), |
|
|
uridMap (nullptr), |
|
@@ -1152,6 +1152,14 @@ public: |
|
|
} |
|
|
} |
|
|
jassert (filter != nullptr); |
|
|
jassert (filter != nullptr); |
|
|
|
|
|
|
|
|
|
|
|
// LV2 does not support disabling buses: so always enable all of them |
|
|
|
|
|
filter->enableAllBuses(); |
|
|
|
|
|
|
|
|
|
|
|
findMaxTotalChannels (numInChans, numOutChans); |
|
|
|
|
|
|
|
|
|
|
|
// You must at least have some channels |
|
|
|
|
|
jassert (filter->isMidiEffect() || (numInChans > 0 || numOutChans > 0)); |
|
|
|
|
|
|
|
|
filter->setPlayConfigDetails (numInChans, numOutChans, 0, 0); |
|
|
filter->setPlayConfigDetails (numInChans, numOutChans, 0, 0); |
|
|
filter->setPlayHead (this); |
|
|
filter->setPlayHead (this); |
|
|
|
|
|
|
|
@@ -1168,11 +1176,8 @@ public: |
|
|
portLatency = nullptr; |
|
|
portLatency = nullptr; |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
for (int i=0; i < numInChans; ++i) |
|
|
|
|
|
portAudioIns[i] = nullptr; |
|
|
|
|
|
for (int i=0; i < numOutChans; ++i) |
|
|
|
|
|
portAudioOuts[i] = nullptr; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
portAudioIns.insertMultiple (0, nullptr, numInChans); |
|
|
|
|
|
portAudioOuts.insertMultiple (0, nullptr, numOutChans); |
|
|
portControls.insertMultiple (0, nullptr, filter->getNumParameters()); |
|
|
portControls.insertMultiple (0, nullptr, filter->getNumParameters()); |
|
|
|
|
|
|
|
|
for (int i=0; i < filter->getNumParameters(); ++i) |
|
|
for (int i=0; i < filter->getNumParameters(); ++i) |
|
@@ -1270,6 +1275,40 @@ public: |
|
|
lastControlValues.clear(); |
|
|
lastControlValues.clear(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================== |
|
|
|
|
|
void findMaxTotalChannels (int& maxTotalIns, int& maxTotalOuts) |
|
|
|
|
|
{ |
|
|
|
|
|
#ifdef JucePlugin_PreferredChannelConfigurations |
|
|
|
|
|
int configs[][2] = { JucePlugin_PreferredChannelConfigurations }; |
|
|
|
|
|
maxTotalIns = maxTotalOuts = 0; |
|
|
|
|
|
|
|
|
|
|
|
for (auto& config : configs) |
|
|
|
|
|
{ |
|
|
|
|
|
maxTotalIns = jmax (maxTotalIns, config[0]); |
|
|
|
|
|
maxTotalOuts = jmax (maxTotalOuts, config[1]); |
|
|
|
|
|
} |
|
|
|
|
|
#else |
|
|
|
|
|
auto numInputBuses = filter->getBusCount (true); |
|
|
|
|
|
auto numOutputBuses = filter->getBusCount (false); |
|
|
|
|
|
|
|
|
|
|
|
if (numInputBuses > 1 || numOutputBuses > 1) |
|
|
|
|
|
{ |
|
|
|
|
|
maxTotalIns = maxTotalOuts = 0; |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < numInputBuses; ++i) |
|
|
|
|
|
maxTotalIns += filter->getChannelCountOfBus (true, i); |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < numOutputBuses; ++i) |
|
|
|
|
|
maxTotalOuts += filter->getChannelCountOfBus (false, i); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
maxTotalIns = numInputBuses > 0 ? filter->getBus (true, 0)->getMaxSupportedChannels (64) : 0; |
|
|
|
|
|
maxTotalOuts = numOutputBuses > 0 ? filter->getBus (false, 0)->getMaxSupportedChannels (64) : 0; |
|
|
|
|
|
} |
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//============================================================================== |
|
|
//============================================================================== |
|
|
// LV2 core calls |
|
|
// LV2 core calls |
|
|
|
|
|
|
|
@@ -1311,7 +1350,7 @@ public: |
|
|
{ |
|
|
{ |
|
|
if (portId == index++) |
|
|
if (portId == index++) |
|
|
{ |
|
|
{ |
|
|
portAudioIns[i] = (float*)dataLocation; |
|
|
|
|
|
|
|
|
portAudioIns.set(i, (float*)dataLocation); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@@ -1320,7 +1359,7 @@ public: |
|
|
{ |
|
|
{ |
|
|
if (portId == index++) |
|
|
if (portId == index++) |
|
|
{ |
|
|
{ |
|
|
portAudioOuts[i] = (float*)dataLocation; |
|
|
|
|
|
|
|
|
portAudioOuts.set(i, (float*)dataLocation); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@@ -1908,8 +1947,8 @@ private: |
|
|
#if JucePlugin_WantsLV2Latency |
|
|
#if JucePlugin_WantsLV2Latency |
|
|
float* portLatency; |
|
|
float* portLatency; |
|
|
#endif |
|
|
#endif |
|
|
float* portAudioIns[JucePlugin_MaxNumInputChannels]; |
|
|
|
|
|
float* portAudioOuts[JucePlugin_MaxNumOutputChannels]; |
|
|
|
|
|
|
|
|
Array<float*> portAudioIns; |
|
|
|
|
|
Array<float*> portAudioOuts; |
|
|
Array<float*> portControls; |
|
|
Array<float*> portControls; |
|
|
|
|
|
|
|
|
uint32 bufferSize; |
|
|
uint32 bufferSize; |
|
|