1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-13 00:04:19 +00:00

Minor AU hosting changes.

This commit is contained in:
jules 2012-10-13 19:42:06 +01:00
parent b416ab6651
commit 019fbbb1d9

View file

@ -303,7 +303,7 @@ public:
audioUnit = (AudioUnit) OpenComponent (comp);
wantsMidiMessages = componentDesc.componentType == kAudioUnitType_MusicDevice
|| componentDesc.componentType == kAudioUnitType_MusicEffect;
|| componentDesc.componentType == kAudioUnitType_MusicEffect;
}
}
@ -323,7 +323,9 @@ public:
if (audioUnit != 0)
{
AudioUnitUninitialize (audioUnit);
if (prepared)
releaseResources();
CloseComponent (audioUnit);
audioUnit = 0;
}
@ -450,6 +452,7 @@ public:
wasPlaying = false;
prepared = (AudioUnitInitialize (audioUnit) == noErr);
jassert (prepared);
}
}
@ -1165,9 +1168,9 @@ class AudioUnitPluginWindowCocoa : public AudioProcessorEditor,
public Timer
{
public:
AudioUnitPluginWindowCocoa (AudioUnitPluginInstance& plugin_, const bool createGenericViewIfNeeded)
: AudioProcessorEditor (&plugin_),
plugin (plugin_)
AudioUnitPluginWindowCocoa (AudioUnitPluginInstance& p, const bool createGenericViewIfNeeded)
: AudioProcessorEditor (&p),
plugin (p)
{
addAndMakeVisible (&wrapper);
@ -1180,15 +1183,13 @@ public:
~AudioUnitPluginWindowCocoa()
{
const bool wasValid = isValid();
// NB: making the wrapper invisible before removing it causes
// strange internal crashes in some Apple AUs.
removeChildComponent (&wrapper);
wrapper.setView (nil);
if (wasValid)
if (isValid())
{
wrapper.setVisible (false);
removeChildComponent (&wrapper);
wrapper.setView (nil);
plugin.editorBeingDeleted (this);
}
}
bool isValid() const { return wrapper.getView() != nil; }
@ -1262,7 +1263,7 @@ private:
}
}
if (createGenericViewIfNeeded && (pluginView == 0))
if (createGenericViewIfNeeded && (pluginView == nil))
{
{
// This forces CoreAudio.component to be loaded, otherwise the AUGenericView will assert