1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-04 03:40:07 +00:00

AAX: plugin is now recognised and loaded by PT (but doesn't yet play correctly)

This commit is contained in:
jules 2012-07-09 13:18:09 +01:00
parent b20b5f9276
commit 6f28207e87

View file

@ -182,7 +182,7 @@ struct AAXClasses
numChans = numOuts;
}
AudioSampleBuffer buffer (renderingChannels, numChans, bufferSize);
AudioSampleBuffer buffer (renderingChannels, jmax (1, numChans), bufferSize);
// XXX need to do midi..
midiBuffer.clear();
@ -215,6 +215,8 @@ struct AAXClasses
AudioProcessor* pluginInstance;
MidiBuffer midiBuffer;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PluginInstanceInfo);
};
//==============================================================================
@ -375,6 +377,7 @@ struct AAXClasses
// add other params..
preparePlugin();
return AAX_SUCCESS;
}
@ -398,23 +401,7 @@ struct AAXClasses
case JUCEAlgorithmIDs::preparedFlag:
{
AAX_CSampleRate sampleRate;
check (Controller()->GetSampleRate (&sampleRate));
AAX_EStemFormat inputStemFormat = AAX_eStemFormat_None;
check (Controller()->GetInputStemFormat (&inputStemFormat));
const int numberOfInputChannels = getNumChannelsForStemFormat (inputStemFormat);
AAX_EStemFormat outputStemFormat = AAX_eStemFormat_None;
check (Controller()->GetOutputStemFormat (&outputStemFormat));
const int numberOfOutputChannels = getNumChannelsForStemFormat (outputStemFormat);
int32_t bufferSize = 0;
check (Controller()->GetSignalLatency (&bufferSize));
AudioProcessor* audioProcessor = getPluginInstance();
audioProcessor->setPlayConfigDetails (numberOfInputChannels, numberOfOutputChannels, sampleRate, bufferSize);
audioProcessor->prepareToPlay (sampleRate, bufferSize);
preparePlugin();
const size_t numObjects = dataSize / sizeof (uint32_t);
uint32_t* const objects = static_cast <uint32_t*> (data);
@ -450,6 +437,27 @@ struct AAXClasses
mPacketDispatcher.RegisterPacket (bypassID.CString(), JUCEAlgorithmIDs::bypass);
}
void preparePlugin() const
{
AAX_CSampleRate sampleRate;
check (Controller()->GetSampleRate (&sampleRate));
AAX_EStemFormat inputStemFormat = AAX_eStemFormat_None;
check (Controller()->GetInputStemFormat (&inputStemFormat));
const int numberOfInputChannels = getNumChannelsForStemFormat (inputStemFormat);
AAX_EStemFormat outputStemFormat = AAX_eStemFormat_None;
check (Controller()->GetOutputStemFormat (&outputStemFormat));
const int numberOfOutputChannels = getNumChannelsForStemFormat (outputStemFormat);
int32_t bufferSize = 0;
check (Controller()->GetSignalLatency (&bufferSize));
AudioProcessor* audioProcessor = getPluginInstance();
audioProcessor->setPlayConfigDetails (numberOfInputChannels, numberOfOutputChannels, sampleRate, bufferSize);
audioProcessor->prepareToPlay (sampleRate, bufferSize);
}
JUCELibraryRefCount juceCount;
ScopedPointer<AudioProcessor> pluginInstance;
@ -493,7 +501,7 @@ struct AAXClasses
properties->AddProperty (AAX_eProperty_InputStemFormat, getFormatForChans (numInputs));
properties->AddProperty (AAX_eProperty_OutputStemFormat, getFormatForChans (numOutputs));
properties->AddProperty (AAX_eProperty_PlugInID_Native, JucePlugin_AAXPluginId);
properties->AddProperty (AAX_eProperty_PlugInID_Native, JucePlugin_AAXPluginId + (numInputs + 256 * numOutputs));
check (desc.AddProcessProc_Native (algorithmProcessCallback, properties));
}