JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::AudioUnitPluginFormat Class Reference

Implements a plugin format manager for AudioUnits. More...

#include <juce_AudioUnitPluginFormat.h>

Inheritance diagram for juce::AudioUnitPluginFormat:
Collaboration diagram for juce::AudioUnitPluginFormat:

Public Types

using ARAFactoryCreationCallback = std::function< void(ARAFactoryResult)>
 A callback lambda that is passed to getARAFactory()
 
using PluginCreationCallback = std::function< void(std::unique_ptr< AudioPluginInstance >, const String &)>
 A callback lambda that is passed to createPluginInstanceAsync()
 

Public Member Functions

 AudioUnitPluginFormat ()
 
 ~AudioUnitPluginFormat () override
 
bool canScanForPlugins () const override
 Returns true if this format needs to run a scan to find its list of plugins.
 
void createARAFactoryAsync (const PluginDescription &, ARAFactoryCreationCallback callback) override
 Tries to create an ::ARAFactoryWrapper for this description.
 
std::unique_ptr< AudioPluginInstancecreateInstanceFromDescription (const PluginDescription &, double initialSampleRate, int initialBufferSize)
 Tries to recreate a type from a previously generated PluginDescription.
 
std::unique_ptr< AudioPluginInstancecreateInstanceFromDescription (const PluginDescription &, double initialSampleRate, int initialBufferSize, String &errorMessage)
 Same as above but with the possibility of returning an error message.
 
void createPluginInstanceAsync (const PluginDescription &description, double initialSampleRate, int initialBufferSize, PluginCreationCallback)
 Tries to recreate a type from a previously generated PluginDescription.
 
bool doesPluginStillExist (const PluginDescription &) override
 Checks whether this plugin could possibly be loaded.
 
bool fileMightContainThisPluginType (const String &fileOrIdentifier) override
 Should do a quick check to see if this file or directory might be a plugin of this format.
 
void findAllTypesForFile (OwnedArray< PluginDescription > &, const String &fileOrIdentifier) override
 This tries to create descriptions for all the plugin types available in a binary module file.
 
FileSearchPath getDefaultLocationsToSearch () override
 Returns the typical places to look for this kind of plugin.
 
String getName () const override
 Returns the format name.
 
String getNameOfPluginFromIdentifier (const String &fileOrIdentifier) override
 Returns a readable version of the name of the plugin that this identifier refers to.
 
bool isTrivialToScan () const override
 Should return true if this format is both safe and quick to scan - i.e.
 
bool pluginNeedsRescanning (const PluginDescription &) override
 Returns true if this plugin's version or date has changed and it should be re-checked.
 
StringArray searchPathsForPlugins (const FileSearchPath &, bool recursive, bool) override
 Searches a suggested set of directories for any plugins in this format.
 

Static Public Member Functions

static String getFormatName ()
 

Private Member Functions

void createPluginInstance (const PluginDescription &, double initialSampleRate, int initialBufferSize, PluginCreationCallback) override
 Implementors must override this function.
 
void handleMessage (const Message &) override
 This is the callback method that receives incoming messages.
 
void postMessage (Message *message) const
 Sends a message to the message queue, for asynchronous delivery to this listener later on.
 
bool requiresUnblockedMessageThreadDuringCreation (const PluginDescription &) const override
 Returns true if instantiation of this plugin type must be done from a non-message thread.
 

Private Attributes

WeakReference< MessageListener >::Master masterReference
 

Detailed Description

Implements a plugin format manager for AudioUnits.

@tags{Audio}

Member Typedef Documentation

◆ ARAFactoryCreationCallback

A callback lambda that is passed to getARAFactory()

◆ PluginCreationCallback

using juce::AudioPluginFormat::PluginCreationCallback = std::function<void (std::unique_ptr<AudioPluginInstance>, const String&)>
inherited

A callback lambda that is passed to createPluginInstanceAsync()

Constructor & Destructor Documentation

◆ AudioUnitPluginFormat()

juce::AudioUnitPluginFormat::AudioUnitPluginFormat ( )

◆ ~AudioUnitPluginFormat()

juce::AudioUnitPluginFormat::~AudioUnitPluginFormat ( )
override

Member Function Documentation

◆ canScanForPlugins()

bool juce::AudioUnitPluginFormat::canScanForPlugins ( ) const
inlineoverridevirtual

Returns true if this format needs to run a scan to find its list of plugins.

Implements juce::AudioPluginFormat.

◆ createARAFactoryAsync()

void juce::AudioUnitPluginFormat::createARAFactoryAsync ( const PluginDescription ,
ARAFactoryCreationCallback  callback 
)
overridevirtual

Tries to create an ::ARAFactoryWrapper for this description.

The result of the operation will be wrapped into an ARAFactoryResult, which will be passed to a callback object supplied by the caller.

See also
AudioPluginFormatManager::createARAFactoryAsync

Reimplemented from juce::AudioPluginFormat.

◆ createInstanceFromDescription() [1/2]

std::unique_ptr< AudioPluginInstance > juce::AudioPluginFormat::createInstanceFromDescription ( const PluginDescription ,
double  initialSampleRate,
int  initialBufferSize 
)
inherited

Tries to recreate a type from a previously generated PluginDescription.

See also
AudioPluginFormatManager::createInstance

◆ createInstanceFromDescription() [2/2]

std::unique_ptr< AudioPluginInstance > juce::AudioPluginFormat::createInstanceFromDescription ( const PluginDescription ,
double  initialSampleRate,
int  initialBufferSize,
String errorMessage 
)
inherited

Same as above but with the possibility of returning an error message.

See also
AudioPluginFormatManager::createInstance

◆ createPluginInstance()

void juce::AudioUnitPluginFormat::createPluginInstance ( const PluginDescription ,
double  initialSampleRate,
int  initialBufferSize,
PluginCreationCallback   
)
overrideprivatevirtual

Implementors must override this function.

This is guaranteed to be called on the message thread. You may call the callback on any thread.

Implements juce::AudioPluginFormat.

◆ createPluginInstanceAsync()

void juce::AudioPluginFormat::createPluginInstanceAsync ( const PluginDescription description,
double  initialSampleRate,
int  initialBufferSize,
PluginCreationCallback   
)
inherited

Tries to recreate a type from a previously generated PluginDescription.

When the plugin has been created, it will be passed to the caller via an asynchronous call to the PluginCreationCallback lambda that was provided.

See also
AudioPluginFormatManager::createPluginInstanceAsync

◆ doesPluginStillExist()

bool juce::AudioUnitPluginFormat::doesPluginStillExist ( const PluginDescription )
overridevirtual

Checks whether this plugin could possibly be loaded.

It doesn't actually need to load it, just to check whether the file or component still exists.

Implements juce::AudioPluginFormat.

◆ fileMightContainThisPluginType()

bool juce::AudioUnitPluginFormat::fileMightContainThisPluginType ( const String fileOrIdentifier)
overridevirtual

Should do a quick check to see if this file or directory might be a plugin of this format.

This is for searching for potential files, so it shouldn't actually try to load the plugin or do anything time-consuming.

Implements juce::AudioPluginFormat.

◆ findAllTypesForFile()

void juce::AudioUnitPluginFormat::findAllTypesForFile ( OwnedArray< PluginDescription > &  results,
const String fileOrIdentifier 
)
overridevirtual

This tries to create descriptions for all the plugin types available in a binary module file.

The file will be some kind of DLL or bundle.

Normally there will only be one type returned, but some plugins (e.g. VST shells) can use a single DLL to create a set of different plugin subtypes, so in that case, each subtype is returned as a separate object.

Implements juce::AudioPluginFormat.

◆ getDefaultLocationsToSearch()

FileSearchPath juce::AudioUnitPluginFormat::getDefaultLocationsToSearch ( )
overridevirtual

Returns the typical places to look for this kind of plugin.

Note that if this returns no paths, it means that the format doesn't search in files or folders, e.g. AudioUnits.

Implements juce::AudioPluginFormat.

◆ getFormatName()

static String juce::AudioUnitPluginFormat::getFormatName ( )
inlinestatic

◆ getName()

String juce::AudioUnitPluginFormat::getName ( ) const
inlineoverridevirtual

Returns the format name.

E.g. "VST", "AudioUnit", etc.

Implements juce::AudioPluginFormat.

◆ getNameOfPluginFromIdentifier()

String juce::AudioUnitPluginFormat::getNameOfPluginFromIdentifier ( const String fileOrIdentifier)
overridevirtual

Returns a readable version of the name of the plugin that this identifier refers to.

Implements juce::AudioPluginFormat.

◆ handleMessage()

void juce::AudioPluginFormat::handleMessage ( const Message message)
overrideprivatevirtualinherited

This is the callback method that receives incoming messages.

This is called by the MessageManager from its dispatch loop.

See also
postMessage

Implements juce::MessageListener.

◆ isTrivialToScan()

bool juce::AudioUnitPluginFormat::isTrivialToScan ( ) const
inlineoverridevirtual

Should return true if this format is both safe and quick to scan - i.e.

if a file can be scanned within a few milliseconds on a background thread, without actually needing to load an executable.

Implements juce::AudioPluginFormat.

◆ pluginNeedsRescanning()

bool juce::AudioUnitPluginFormat::pluginNeedsRescanning ( const PluginDescription )
overridevirtual

Returns true if this plugin's version or date has changed and it should be re-checked.

Implements juce::AudioPluginFormat.

◆ postMessage()

void juce::MessageListener::postMessage ( Message message) const
inherited

Sends a message to the message queue, for asynchronous delivery to this listener later on.

This method can be called safely by any thread.

Parameters
messagethe message object to send - this will be deleted automatically by the message queue, so make sure it's allocated on the heap, not the stack!
See also
handleMessage

◆ requiresUnblockedMessageThreadDuringCreation()

bool juce::AudioUnitPluginFormat::requiresUnblockedMessageThreadDuringCreation ( const PluginDescription ) const
overrideprivatevirtual

Returns true if instantiation of this plugin type must be done from a non-message thread.

Implements juce::AudioPluginFormat.

◆ searchPathsForPlugins()

StringArray juce::AudioUnitPluginFormat::searchPathsForPlugins ( const FileSearchPath directoriesToSearch,
bool  recursive,
bool  allowPluginsWhichRequireAsynchronousInstantiation 
)
overridevirtual

Searches a suggested set of directories for any plugins in this format.

The path might be ignored, e.g. by AUs, which are found by the OS rather than manually.

Parameters
directoriesToSearchThis specifies which directories shall be searched for plug-ins.
recursiveShould the search recursively traverse folders.
allowPluginsWhichRequireAsynchronousInstantiationIf this is false then plug-ins which require asynchronous creation will be excluded.

Implements juce::AudioPluginFormat.

Member Data Documentation

◆ masterReference

WeakReference<MessageListener>::Master juce::MessageListener::masterReference
privateinherited

The documentation for this class was generated from the following file: