spBase
Loading...
Searching...
No Matches
spPlugin.h File Reference
#include <sp/spDefs.h>
#include <sp/spOption.h>
Include dependency graph for spPlugin.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SP_PLUGIN_CHECK_VERSION(version, revision, update)
 
#define SP_PLUGIN_SUPPORTED_VERSION_ID   /*SP_PLUGIN_VERSION_ID*/1003
 
#define SP_PLUGIN_PRIORITY_HIGHEST   0
 
#define SP_PLUGIN_PRIORITY_HIGHER   1
 
#define SP_PLUGIN_PRIORITY_MIDDLE   2
 
#define SP_PLUGIN_PRIORITY_LOWER   3
 
#define SP_PLUGIN_PRIORITY_LOWEST   4
 
#define SP_PLUGIN_PRIORITY_NULL   5
 
#define SP_PLUGIN_ERROR_SUCCESS   SP_TRUE
 
#define SP_PLUGIN_ERROR_FAILURE   SP_FALSE
 
#define SP_PLUGIN_ERROR_NO_ERROR   SP_TRUE
 
#define SP_PLUGIN_ERROR_WRONG_PLUGIN   (-1)
 
#define SP_PLUGIN_ERROR_OPEN   (-2)
 
#define SP_PLUGIN_ERROR_READ   (-3)
 
#define SP_PLUGIN_ERROR_WRITE   (-4)
 
#define SP_PLUGIN_ERROR_LOAD   (-5)
 
#define SP_PLUGIN_ERROR_SUITABLE_NOT_FOUND   (-6)
 
#define SP_PLUGIN_ERROR_MULTIPLE_INSTANCE   (-7)
 
#define SP_PLUGIN_ERROR_INSTANTIATE   (-8)
 
#define SP_PLUGIN_ERROR_BOGUS_FILE   (-10)
 
#define SP_PLUGIN_ERROR_FILE_TYPE   (-11)
 
#define SP_PLUGIN_ERROR_SAMP_RATE   (-12)
 
#define SP_PLUGIN_ERROR_SAMP_BIT   (-13)
 
#define SP_PLUGIN_ERROR_NUM_CHANNEL   (-14)
 
#define SP_PLUGIN_ERROR_OTHER_INFO   (-15)
 
#define SP_PLUGIN_ERROR_TOTAL_LENGTH_REQUIRED   (-16)
 
#define SP_PLUGIN_ERROR_UNKNOWN_DEVICE   (-20)
 
#define SP_PLUGIN_ERROR_USER   (-256)
 
#define SP_PLUGIN_CAPS_THREAD_SAFE   (1<<1)
 
#define SP_PLUGIN_CAPS_NEED_LOCK   (1<<2)
 
#define SP_PLUGIN_CAPS_MEMORY_SAFE   (1<<3)
 
#define SP_PLUGIN_CAPS_KEEP_IN_MEMORY   (1<<4)
 
#define SP_PLUGIN_CAPS_CUSTOM_OPTION_DIALOG   (1<<5)
 
#define SP_PLUGIN_CAPS_THREAD_BY_THREAD_SAFE   (1<<6)
 

Typedefs

typedef int spPluginError
 

Enumerations

enum  spPluginCallbackReason { }
 
enum  spPluginState { SP_PLUGIN_STATE_ERROR = -1 , SP_PLUGIN_STATE_STOP = 0 , SP_PLUGIN_STATE_START = 1 , SP_PLUGIN_STATE_PAUSE }
 
enum  spPluginDeviceType {
  SP_PLUGIN_DEVICE_UNKNOWN = -1 , SP_PLUGIN_DEVICE_FILE = 0 , SP_PLUGIN_DEVICE_AUDIO = 1 , SP_PLUGIN_DEVICE_CD = 2 ,
  SP_PLUGIN_DEVICE_MIXER = 3 , SP_PLUGIN_DEVICE_OTHERS = 4
}
 

Functions

const char * spGetPluginSearchPath (void)
 
void spSetPluginSearchPath (const char *pathlist)
 
spBool spAppendPluginSearchPath (const char *pathlist)
 
spBool spPrependPluginSearchPath (const char *pathlist)
 
spPluginspLoadPlugin (const char *plugin_name)
 
spBool spFreePlugin (spPlugin *plugin)
 
spBool spEqPluginType (spPlugin *plugin, spPluginType type)
 
const char * spGetPluginName (spPlugin *plugin)
 
const char * spGetPluginId (spPlugin *plugin)
 
const char * spGetPluginDescription (spPlugin *plugin)
 
const char * spGetPluginInformation (spPlugin *plugin)
 
long spGetPluginVersionId (spPlugin *plugin)
 
int spGetPluginPriority (spPlugin *plugin)
 
spBool spGetPluginVersion (spPlugin *plugin, int *version, int *revision)
 
spBool spIsPluginFile (const char *filename)
 
char * xspSearchPluginFile (int index)
 

Function Documentation

◆ spLoadPlugin()

spPlugin * spLoadPlugin ( const char * plugin_name)
extern

Loads a plugin. If you call this function before calling spFreePlugin() , the identical address of the plugin that has already loaded. In this case, the number of calls of spFreePlugin() must be balanced with that of spLoadPlugin() .

Parameters
[in]plugin_nameThe null-terminated name of the plugin excluding the suffix. The directories specified by spSetPluginSearchPath() or the default directories are searched.
Returns
Returns the pointer to spPlugin type. You have to unload the plugin by calling spFreePlugin() . NULL will be returned if error occurs.

◆ spFreePlugin()

spBool spFreePlugin ( spPlugin * plugin)
extern

Unloads the plugin. If you call spLoadPlugin() multiple times, the number of calls of spFreePlugin() must be balanced with that of spLoadPlugin() .

Parameters
[in]pluginThe pointer to spPlugin type obtained by spLoadPlugin() .
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ spEqPluginType()

spBool spEqPluginType ( spPlugin * plugin,
spPluginType type )
extern

Checks the type of the plugin.

◆ spGetPluginName()

const char * spGetPluginName ( spPlugin * plugin)
extern

Gets the name of the plugin.

◆ spGetPluginId()

const char * spGetPluginId ( spPlugin * plugin)
extern

Gets the ID of the plugin.

◆ spGetPluginDescription()

const char * spGetPluginDescription ( spPlugin * plugin)
extern

Gets the short description of the plugin which doesn't include line breaks.

◆ spGetPluginInformation()

const char * spGetPluginInformation ( spPlugin * plugin)
extern

Gets the detailed description of the plugin which can include line breaks.

◆ spGetPluginVersionId()

long spGetPluginVersionId ( spPlugin * plugin)
extern

Gets the version ID of the plugin which is an integer of long type.

◆ spGetPluginPriority()

int spGetPluginPriority ( spPlugin * plugin)
extern

Gets the priority of the plugin to determine which plugin is used for a purpose, when several plugins for the purpose are found. SP_PLUGIN_PRIORITY_HIGHEST is the highest and SP_PLUGIN_PRIORITY_LOWEST is the lowest priority.

◆ spGetPluginVersion()

spBool spGetPluginVersion ( spPlugin * plugin,
int * version,
int * revision )
extern

Gets the version number of the plugin loaded.