mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
Workarounds in AU hosting for plugins that fail to initialise correctly.
This commit is contained in:
parent
56b458b0da
commit
7fecba7265
1 changed files with 15 additions and 12 deletions
|
|
@ -478,8 +478,8 @@ public:
|
|||
|
||||
resetBusses();
|
||||
|
||||
prepared = (AudioUnitInitialize (audioUnit) == noErr);
|
||||
jassert (prepared);
|
||||
jassert (! prepared);
|
||||
initialiseAudioUnit();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -499,6 +499,14 @@ public:
|
|||
incomingMidi.clear();
|
||||
}
|
||||
|
||||
bool initialiseAudioUnit()
|
||||
{
|
||||
if (! prepared)
|
||||
prepared = (AudioUnitInitialize (audioUnit) == noErr);
|
||||
|
||||
return prepared;
|
||||
}
|
||||
|
||||
void resetBusses()
|
||||
{
|
||||
for (int i = 0; i < numInputBusses; ++i) AudioUnitReset (audioUnit, kAudioUnitScope_Input, i);
|
||||
|
|
@ -1351,12 +1359,13 @@ private:
|
|||
|
||||
bool createView (const bool createGenericViewIfNeeded)
|
||||
{
|
||||
if (! plugin.initialiseAudioUnit())
|
||||
return false;
|
||||
|
||||
NSView* pluginView = nil;
|
||||
UInt32 dataSize = 0;
|
||||
Boolean isWritable = false;
|
||||
|
||||
AudioUnitInitialize (plugin.audioUnit);
|
||||
|
||||
if (AudioUnitGetPropertyInfo (plugin.audioUnit, kAudioUnitProperty_CocoaUI, kAudioUnitScope_Global,
|
||||
0, &dataSize, &isWritable) == noErr
|
||||
&& dataSize != 0
|
||||
|
|
@ -1523,16 +1532,10 @@ private:
|
|||
|
||||
Float32Point pos = { 0, 0 };
|
||||
Float32Point size = { 250, 200 };
|
||||
|
||||
HIViewRef pluginView = 0;
|
||||
|
||||
AudioUnitCarbonViewCreate (carbonView,
|
||||
owner.getAudioUnit(),
|
||||
windowRef,
|
||||
rootView,
|
||||
&pos,
|
||||
&size,
|
||||
(ControlRef*) &pluginView);
|
||||
AudioUnitCarbonViewCreate (carbonView, owner.getAudioUnit(), windowRef, rootView,
|
||||
&pos, &size, (ControlRef*) &pluginView);
|
||||
|
||||
return pluginView;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue