Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Protected Member Functions | List of all members
om::sound::plugins::PluginTypeManager Class Referenceabstract

An interface for a class that manages a collection of plugins of a particular type. More...

#include <omSoundPluginTypeManager.h>

Inheritance diagram for om::sound::plugins::PluginTypeManager:
om::sound::au::AudioUnitManager om::sound::plugins::FilterManager

Public Member Functions

 PluginTypeManager ()
 Create a new plugin type manager, initially empty without any plugins. More...
 
 PluginTypeManager (const PluginTypeManager &other)
 Create a new plugin type manager, copying all plugin information from the another manager. More...
 
virtual ~PluginTypeManager ()
 Destroy this plugin type manager and release all of its internal resources. More...
 
PluginTypeManageroperator= (const PluginTypeManager &other)
 Copy the entire state of one plugin type manager to this one, replacing all previous plugins. More...
 
virtual const PluginTypegetType () const =0
 Return the type of plugin that this manager handles. More...
 
virtual void rescan ()=0
 Rescan the system for available plugins of this manager's type. More...
 
Size getPluginCount () const
 Return the total number of plugins that are available to this plugin type manager. More...
 
const PluginIDgetPluginID (Index pluginIndex) const
 Return the plugin ID for the plugin at the specified index. More...
 
const UTF8String & getPluginName (Index pluginIndex) const
 Return a string representing the name for the plugin at the specified index. More...
 
Bool getPluginIndex (const PluginID &pluginID, Index &pluginIndex) const
 Get the index of the plugin in this manager with the specified ID. More...
 
Bool hasPlugin (const PluginID &pluginID) const
 Return whether or not there exists a plugin in this plugin manager with the specified manufacturer and name. More...
 
Bool addPlugin (const PluginID &pluginID, const PluginDelegate &delegate, void *userData=((void *) 0))
 Add a new kind of plugin to this plugin manager. More...
 
Bool removePlugin (Index pluginIndex)
 Remove the plugin at the specified index from this plugin manager. More...
 
void clearPlugins ()
 Remove all registered plugins from this plugin type manager. More...
 
SoundFiltercreatePlugin (Index pluginIndex) const
 Create a new plugin of this manager's type for the specified plugin kind index. More...
 
SoundFiltercreatePlugin (const PluginID &pluginID) const
 Create a new plugin of this manager's type with the given manufacturer and plugin names. More...
 
SoundFilterView * createPluginView (Index pluginIndex, SoundFilter *filter) const
 Create a new plugin view of this manager's type for the specified plugin kind index. More...
 
SoundFilterView * createPluginView (const PluginID &pluginID, SoundFilter *filter) const
 Create a new plugin view of this manager's type with the given manufacturer and plugin names. More...
 

Protected Member Functions

Bool addPluginInternal (const PluginID &id, const PluginDelegate &delegate, void *userData=((void *) 0))
 Add a new kind of plugin to this plugin manager. More...
 
Bool removePluginInternal (Index pluginIndex)
 Remove the plugin at the specified index from this plugin manager. More...
 
void clearPluginsInternal ()
 Remove all registered plugins from this plugin type manager. More...
 

Detailed Description

An interface for a class that manages a collection of plugins of a particular type.

Constructor & Destructor Documentation

om::sound::plugins::PluginTypeManager::PluginTypeManager ( )

Create a new plugin type manager, initially empty without any plugins.

om::sound::plugins::PluginTypeManager::PluginTypeManager ( const PluginTypeManager other)

Create a new plugin type manager, copying all plugin information from the another manager.

virtual om::sound::plugins::PluginTypeManager::~PluginTypeManager ( )
virtual

Destroy this plugin type manager and release all of its internal resources.

Member Function Documentation

PluginTypeManager& om::sound::plugins::PluginTypeManager::operator= ( const PluginTypeManager other)

Copy the entire state of one plugin type manager to this one, replacing all previous plugins.

virtual const PluginType& om::sound::plugins::PluginTypeManager::getType ( ) const
pure virtual

Return the type of plugin that this manager handles.

Examples of plugin types include 'AU', 'VST', and 'Filter'. Subclasses should implement this method to return the type of plugin that they handle.

Implemented in om::sound::au::AudioUnitManager, and om::sound::plugins::FilterManager.

virtual void om::sound::plugins::PluginTypeManager::rescan ( )
pure virtual

Rescan the system for available plugins of this manager's type.

This method has the effect of updating the internal list of plugins with any newly detected plugins while retaining all previously existing plugins, as long as their presence on the system is retained. If a plugin no longer exists, it is removed from the internal list of plugins.

This method is called the first time that the user accesses the plugins for this plugin type manager, and can be called afterward by the user if necessary. Subclasses should implement this method to function properly for those situations.

This method invalidates all plugin indices for this manager.

Implemented in om::sound::au::AudioUnitManager, and om::sound::plugins::FilterManager.

Size om::sound::plugins::PluginTypeManager::getPluginCount ( ) const

Return the total number of plugins that are available to this plugin type manager.

const PluginID& om::sound::plugins::PluginTypeManager::getPluginID ( Index  pluginIndex) const

Return the plugin ID for the plugin at the specified index.

If the plugin index is invalid, an undefined ID is returned.

const UTF8String& om::sound::plugins::PluginTypeManager::getPluginName ( Index  pluginIndex) const

Return a string representing the name for the plugin at the specified index.

If the plugin index is invalid, the empty string is returned.

Bool om::sound::plugins::PluginTypeManager::getPluginIndex ( const PluginID pluginID,
Index pluginIndex 
) const

Get the index of the plugin in this manager with the specified ID.

The plugin index is returned in the output index parameter, and a boolean value is returned indicating whether or not the index for the given plugin was successfully retrieved.

Bool om::sound::plugins::PluginTypeManager::hasPlugin ( const PluginID pluginID) const

Return whether or not there exists a plugin in this plugin manager with the specified manufacturer and name.

Bool om::sound::plugins::PluginTypeManager::addPlugin ( const PluginID pluginID,
const PluginDelegate delegate,
void *  userData = ((void *) 0) 
)

Add a new kind of plugin to this plugin manager.

This method adds a new plugin kind with the specified ID and delegate to this plugin type manager. The method allows the user to provide a pointer to data that is passed into the factory function when a plugin with this description is created.

If the new plugin was able to be registered, TRUE is returned. Otherwise, if there is an error, FALSE is returned and the method has no effect.

Bool om::sound::plugins::PluginTypeManager::removePlugin ( Index  pluginIndex)

Remove the plugin at the specified index from this plugin manager.

The method returns whether or not the specified plugin was removed from this manager. If the method succeeds, it invalidates all plugin indices for this manager.

void om::sound::plugins::PluginTypeManager::clearPlugins ( )

Remove all registered plugins from this plugin type manager.

This method invalidates all plugin indices for this manager.

SoundFilter* om::sound::plugins::PluginTypeManager::createPlugin ( Index  pluginIndex) const

Create a new plugin of this manager's type for the specified plugin kind index.

If there is an error in creating the new plugin, a NULL pointer is returned. This can happen if the specified plugin index is invalid, or if an error occurred within the plugin's factory function.

SoundFilter* om::sound::plugins::PluginTypeManager::createPlugin ( const PluginID pluginID) const

Create a new plugin of this manager's type with the given manufacturer and plugin names.

If there is an error in creating the new plugin, a NULL pointer is returned. This can happen if there is no plugin registered with the given manufacturer and plugin name, or if an error occurred within the plugin's factory function. The manufacturer and plugin name comparisons are case-insensitive.

SoundFilterView* om::sound::plugins::PluginTypeManager::createPluginView ( Index  pluginIndex,
SoundFilter filter 
) const

Create a new plugin view of this manager's type for the specified plugin kind index.

If there is an error in creating the new plugin view, a NULL pointer is returned. This can happen if the specified plugin index is invalid, or if an error occurred within the plugin's factory function.

SoundFilterView* om::sound::plugins::PluginTypeManager::createPluginView ( const PluginID pluginID,
SoundFilter filter 
) const

Create a new plugin view of this manager's type with the given manufacturer and plugin names.

If there is an error in creating the new plugin view, a NULL pointer is returned. This can happen if there is no plugin registered with the given manufacturer and plugin name, or if an error occurred within the plugin's factory function. The manufacturer and plugin name comparisons are case-insensitive.

Bool om::sound::plugins::PluginTypeManager::addPluginInternal ( const PluginID id,
const PluginDelegate delegate,
void *  userData = ((void *) 0) 
)
protected

Add a new kind of plugin to this plugin manager.

This method adds a new plugin kind with the specified manufacturer name, plugin name, and delegate to this plugin type manager. The method allows the user to provide a pointer to data that is passed into the factory function when a plugin with this description is created.

If the new plugin was able to be registered, TRUE is returned. Otherwise, if there is an error, FALSE is returned and the method has no effect.

Subclasses should use this method to register new plugins to the base class.

Bool om::sound::plugins::PluginTypeManager::removePluginInternal ( Index  pluginIndex)
protected

Remove the plugin at the specified index from this plugin manager.

The method returns whether or not the specified plugin was removed from this manager. If the method succeeds, it invalidates all plugin indices for this manager.

Subclasses should use this method to remove plugins from the base class when they are disconnected and unable to be used.

void om::sound::plugins::PluginTypeManager::clearPluginsInternal ( )
protected

Remove all registered plugins from this plugin type manager.

This method invalidates all plugin indices for this manager.

Subclasses should use this method to cheaply remove all previously present plugins from the plugin manager.


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