1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-22 01:34:21 +00:00

Avoid unnecessary calls to AudioUnitInitialize.

This commit is contained in:
tpoole 2016-08-10 14:48:44 +01:00
parent 0159102e10
commit aa1acb3fed

View file

@ -399,18 +399,7 @@ public:
(int) (numOutputBusChannels * numOutputBusses),
rate, blockSize);
setLatencySamples (0);
if (parameters.size() == 0)
{
// some plugins crash if initialiseAudioUnit() is called too soon (sigh..), so we'll
// only call it here if it seems like they it's one of the awkward plugins that can
// only create their parameters after it has been initialised.
if (! initialiseAudioUnit())
return false;
refreshParameterList();
}
refreshParameterList();
setPluginCallbacks();
return true;
}
@ -532,7 +521,7 @@ public:
resetBusses();
jassert (! prepared);
initialiseAudioUnit();
prepared = (AudioUnitInitialize (audioUnit) == noErr);
}
}
@ -552,14 +541,6 @@ public:
incomingMidi.clear();
}
bool initialiseAudioUnit()
{
if (! prepared)
prepared = (AudioUnitInitialize (audioUnit) == noErr);
return prepared;
}
void resetBusses()
{
for (AudioUnitElement i = 0; i < numInputBusses; ++i) AudioUnitReset (audioUnit, kAudioUnitScope_Input, i);
@ -873,8 +854,6 @@ public:
if (propertyList != 0)
{
initialiseAudioUnit();
AudioUnitSetProperty (audioUnit, kAudioUnitProperty_ClassInfo, kAudioUnitScope_Global,
0, &propertyList, sizeof (propertyList));
@ -1545,9 +1524,6 @@ private:
bool createView (const bool createGenericViewIfNeeded)
{
if (! plugin.initialiseAudioUnit())
return false;
JUCE_IOS_MAC_VIEW* pluginView = nil;
UInt32 dataSize = 0;
Boolean isWritable = false;