2010-02-09 06:58:27 +01:00
|
|
|
#ifndef IAUDIOPLUGIN_H_INCLUDED
|
|
|
|
#define IAUDIOPLUGIN_H_INCLUDED
|
|
|
|
|
|
|
|
namespace cAudio
|
|
|
|
{
|
2010-02-10 05:46:00 +01:00
|
|
|
class IAudioManager;
|
|
|
|
class IAudioCapture;
|
|
|
|
class ILogger;
|
|
|
|
|
2010-02-09 06:58:27 +01:00
|
|
|
//Class that abstracts a particular plugin implementation
|
|
|
|
//Plugins must have the following functions:
|
|
|
|
/*
|
2010-02-10 05:46:00 +01:00
|
|
|
//Will be called on initial install of the plugin, use this for any first time initialization. A reference to the logger is passed in for convenience.
|
|
|
|
bool installPlugin(ILogger* logger);
|
2010-02-09 06:58:27 +01:00
|
|
|
|
|
|
|
//Must return a unique name that identifies this plugin.
|
|
|
|
const char* getPluginName();
|
|
|
|
|
|
|
|
//Will be called on when cAudio uninstalls this plugin, use this for any final cleanup.
|
|
|
|
void uninstallPlugin();
|
|
|
|
|
|
|
|
//Optional Functions, implement one if you want to support that feature of the library
|
|
|
|
|
|
|
|
//Will be called when an Audio Manager is created. Use the passed in pointer to register any decoders or event handlers.
|
|
|
|
void onCreateAudioManager(IAudioManager* manager);
|
|
|
|
|
|
|
|
//Will be called when an Audio Capture Device is created. Use the passed in pointer to register any event handlers.
|
|
|
|
void onCreateAudioCapture(IAudioCapture* capture);
|
|
|
|
|
|
|
|
//Will be called when an Audio Manager is destroyed. Use the passed in pointer to remove any decoders or event handlers.
|
|
|
|
void onDestroyAudioManager(IAudioManager* manager);
|
|
|
|
|
|
|
|
//Will be called when an Audio Capture Device is destroyed. Use the passed in pointer to remove any event handlers.
|
|
|
|
void onDestroyAudioCapture(IAudioCapture* capture);
|
|
|
|
|
|
|
|
*/
|
|
|
|
class IAudioPlugin
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
IAudioPlugin() { }
|
|
|
|
~IAudioPlugin() { }
|
|
|
|
|
2010-02-10 05:59:10 +01:00
|
|
|
virtual bool installPlugin(ILogger* logger, const char* version) = 0;
|
2010-02-09 06:58:27 +01:00
|
|
|
virtual const char* getPluginName() = 0;
|
|
|
|
virtual void uninstallPlugin() = 0;
|
|
|
|
|
|
|
|
virtual void onCreateAudioManager(IAudioManager* manager) = 0;
|
|
|
|
virtual void onCreateAudioCapture(IAudioCapture* capture) = 0;
|
|
|
|
|
|
|
|
virtual void onDestroyAudioManager(IAudioManager* manager) = 0;
|
|
|
|
virtual void onDestoryAudioCapture(IAudioCapture* capture) = 0;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //! IAUDIOPLUGIN_H_INCLUDED
|