mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
AU Client: Use ScopedJuceInitialiser_GUI to ensure the MessageManager exists
This makes the AU Client compatible with other classes also using the ScopedJuceInitialiser_GUI, specifically the ARADocumentController.
This commit is contained in:
parent
7650c85ba5
commit
4f4ddf9733
2 changed files with 8 additions and 14 deletions
|
|
@ -89,18 +89,14 @@ template <> struct ContainerDeletePolicy<const __CFString> { static void destr
|
|||
// make sure the audio processor is initialized before the AUBase class
|
||||
struct AudioProcessorHolder
|
||||
{
|
||||
AudioProcessorHolder (bool initialiseGUI)
|
||||
AudioProcessorHolder()
|
||||
{
|
||||
if (initialiseGUI)
|
||||
initialiseJuce_GUI();
|
||||
|
||||
juceFilter = createPluginFilterOfType (AudioProcessor::wrapperType_AudioUnit);
|
||||
|
||||
// audio units do not have a notion of enabled or un-enabled buses
|
||||
juceFilter->enableAllBuses();
|
||||
}
|
||||
|
||||
std::unique_ptr<AudioProcessor> juceFilter;
|
||||
ScopedJuceInitialiser_GUI scopedInitialiser;
|
||||
std::unique_ptr<AudioProcessor> juceFilter { createPluginFilterOfType (AudioProcessor::wrapperType_AudioUnit) };
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -111,8 +107,7 @@ class JuceAU final : public AudioProcessorHolder,
|
|||
{
|
||||
public:
|
||||
JuceAU (AudioUnit component)
|
||||
: AudioProcessorHolder (activePlugins.size() + activeUIs.size() == 0),
|
||||
MusicDeviceBase (component,
|
||||
: MusicDeviceBase (component,
|
||||
(UInt32) AudioUnitHelpers::getBusCountForWrapper (*juceFilter, true),
|
||||
(UInt32) AudioUnitHelpers::getBusCountForWrapper (*juceFilter, false))
|
||||
{
|
||||
|
|
@ -173,9 +168,6 @@ public:
|
|||
|
||||
jassert (activePlugins.contains (this));
|
||||
activePlugins.removeFirstMatchingValue (this);
|
||||
|
||||
if (activePlugins.size() + activeUIs.size() == 0)
|
||||
shutdownJuce_GUI();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -1723,6 +1715,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
ScopedJuceInitialiser_GUI scopedInitialiser;
|
||||
Rectangle<int> lastBounds;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE (EditorCompHolder)
|
||||
|
|
@ -1823,8 +1816,6 @@ public:
|
|||
// there's some kind of component currently modal, but the host
|
||||
// is trying to delete our plugin..
|
||||
jassert (Component::getCurrentlyModalComponent() == nullptr);
|
||||
|
||||
shutdownJuce_GUI();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -74,6 +74,9 @@ public:
|
|||
|
||||
/** The destructor simply calls shutdownJuce_GUI(). */
|
||||
~ScopedJuceInitialiser_GUI();
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE (ScopedJuceInitialiser_GUI)
|
||||
JUCE_DECLARE_NON_MOVEABLE (ScopedJuceInitialiser_GUI)
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue