Plugs an "add-on" into the standard stream and sample creation functions.
HPLUGIN BASS_PluginLoad( char *file, DWORD flags );
file | Filename of the add-on/plugin. | ||
flags | A combination of these flags.
|
BASS_ERROR_FILEOPEN | The file could not be opened. |
BASS_ERROR_FILEFORM | The file is not a plugin. |
BASS_ERROR_VERSION | The plugin requires a different BASS version. Due to the use of the "stdcall" calling-convention, and so risk of stack faults from unexpected API differences, an add-on won't load at all on Windows if the BASS version is unsupported, and a BASS_ERROR_FILEFORM error will be generated instead of this. |
BASS_ERROR_ALREADY | The plugin is already loaded. |
As well as the stream creation functions, plugins also add their additional format support to BASS_SampleLoad.
Information on what file formats a plugin supports is available via the BASS_PluginGetInfo function.
When using multiple plugins, the stream/sample creation functions will try each of them in the order that they were loaded via this function, until one that accepts the file is found.
When an add-on is already loaded (eg. if you are using functions from it), the plugin system will use the same instance (the reference count will just be incremented); there will not be 2 copies of the add-on in memory.
#ifdef _WIN32 // Windows/CE BASS_PluginLoad("bassflac.dll", 0); #elif __linux__ // Linux BASS_PluginLoad("libbassflac.so", 0); #elif TARGET_OS_IPHONE // iOS extern void BASSFLACplugin; BASS_PluginLoad(&BASSFLACplugin, 0); #else // OSX BASS_PluginLoad("libbassflac.dylib", 0); #endif