spBase
Loading...
Searching...
No Matches
Plugin

Data Structures

class  spPlugin
 A class to handle plugin-based processing. More...
 

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)
 
spBool spIsPluginFile (const char *filename)
 
char * xspSearchPluginFile (int index)
 

Detailed Description

Macro Definition Documentation

◆ SP_PLUGIN_CHECK_VERSION

#define SP_PLUGIN_CHECK_VERSION ( version,
revision,
update )
Value:
(SP_PLUGIN_VERSION > (version) || \
(SP_PLUGIN_VERSION == (version) && SP_PLUGIN_REVISION > (revision)) || \
(SP_PLUGIN_VERSION == (version) && SP_PLUGIN_REVISION == (revision) && SP_PLUGIN_UPDATE_LEVEL >= (update)))

Checks if the version of the spPlugin header files is the same as or newer than the specified version.

Parameters
[in]versionThe version number.
[in]revisionThe revision number.
[in]updateThe update number.

◆ SP_PLUGIN_SUPPORTED_VERSION_ID

#define SP_PLUGIN_SUPPORTED_VERSION_ID   /*SP_PLUGIN_VERSION_ID*/1003

The version ID supported by these header files.

◆ SP_PLUGIN_PRIORITY_HIGHEST

#define SP_PLUGIN_PRIORITY_HIGHEST   0

Highest plugin priority.

◆ SP_PLUGIN_PRIORITY_HIGHER

#define SP_PLUGIN_PRIORITY_HIGHER   1

Plugin priority higher than middle.

◆ SP_PLUGIN_PRIORITY_MIDDLE

#define SP_PLUGIN_PRIORITY_MIDDLE   2

Middle plugin priority.

◆ SP_PLUGIN_PRIORITY_LOWER

#define SP_PLUGIN_PRIORITY_LOWER   3

Plugin priority lower than middle.

◆ SP_PLUGIN_PRIORITY_LOWEST

#define SP_PLUGIN_PRIORITY_LOWEST   4

Lowest plugin priority.

◆ SP_PLUGIN_PRIORITY_NULL

#define SP_PLUGIN_PRIORITY_NULL   5

Plugin priority is not defined.

◆ SP_PLUGIN_ERROR_SUCCESS

#define SP_PLUGIN_ERROR_SUCCESS   SP_TRUE

Success.

◆ SP_PLUGIN_ERROR_FAILURE

#define SP_PLUGIN_ERROR_FAILURE   SP_FALSE

Failure.

◆ SP_PLUGIN_ERROR_NO_ERROR

#define SP_PLUGIN_ERROR_NO_ERROR   SP_TRUE

No error.

◆ SP_PLUGIN_ERROR_WRONG_PLUGIN

#define SP_PLUGIN_ERROR_WRONG_PLUGIN   (-1)

Wrong plugin.

◆ SP_PLUGIN_ERROR_OPEN

#define SP_PLUGIN_ERROR_OPEN   (-2)

Error in opening.

◆ SP_PLUGIN_ERROR_READ

#define SP_PLUGIN_ERROR_READ   (-3)

Error in reading.

◆ SP_PLUGIN_ERROR_WRITE

#define SP_PLUGIN_ERROR_WRITE   (-4)

Error in writing.

◆ SP_PLUGIN_ERROR_LOAD

#define SP_PLUGIN_ERROR_LOAD   (-5)

Error in loading.

◆ SP_PLUGIN_ERROR_SUITABLE_NOT_FOUND

#define SP_PLUGIN_ERROR_SUITABLE_NOT_FOUND   (-6)

No suitable plugin is found.

◆ SP_PLUGIN_ERROR_MULTIPLE_INSTANCE

#define SP_PLUGIN_ERROR_MULTIPLE_INSTANCE   (-7)

Doesn't allow multiple instanciations.

◆ SP_PLUGIN_ERROR_INSTANTIATE

#define SP_PLUGIN_ERROR_INSTANTIATE   (-8)

Error in instantiating.

◆ SP_PLUGIN_ERROR_BOGUS_FILE

#define SP_PLUGIN_ERROR_BOGUS_FILE   (-10)

The file is broken.

◆ SP_PLUGIN_ERROR_FILE_TYPE

#define SP_PLUGIN_ERROR_FILE_TYPE   (-11)

Doesn't accept the file type.

◆ SP_PLUGIN_ERROR_SAMP_RATE

#define SP_PLUGIN_ERROR_SAMP_RATE   (-12)

Doesn't accept the sampling rate.

◆ SP_PLUGIN_ERROR_SAMP_BIT

#define SP_PLUGIN_ERROR_SAMP_BIT   (-13)

Doesn't accept the bits/sample.

◆ SP_PLUGIN_ERROR_NUM_CHANNEL

#define SP_PLUGIN_ERROR_NUM_CHANNEL   (-14)

Doesn't accept the number of channels.

◆ SP_PLUGIN_ERROR_OTHER_INFO

#define SP_PLUGIN_ERROR_OTHER_INFO   (-15)

Error caused by other information.

◆ SP_PLUGIN_ERROR_TOTAL_LENGTH_REQUIRED

#define SP_PLUGIN_ERROR_TOTAL_LENGTH_REQUIRED   (-16)

The total length of the file must be specified.

◆ SP_PLUGIN_ERROR_UNKNOWN_DEVICE

#define SP_PLUGIN_ERROR_UNKNOWN_DEVICE   (-20)

Doesn't recognize the device.

◆ SP_PLUGIN_ERROR_USER

#define SP_PLUGIN_ERROR_USER   (-256)

User defined errors can be defined from this number.

◆ SP_PLUGIN_CAPS_THREAD_SAFE

#define SP_PLUGIN_CAPS_THREAD_SAFE   (1<<1)

The plugin is thread-safe. The thread-safe plugin must be run with multiple insntances.

◆ SP_PLUGIN_CAPS_NEED_LOCK

#define SP_PLUGIN_CAPS_NEED_LOCK   (1<<2)

The plugin needs locking.

◆ SP_PLUGIN_CAPS_MEMORY_SAFE

#define SP_PLUGIN_CAPS_MEMORY_SAFE   (1<<3)

The plugin doesn't execute memory related functions in the read/write function.

◆ SP_PLUGIN_CAPS_KEEP_IN_MEMORY

#define SP_PLUGIN_CAPS_KEEP_IN_MEMORY   (1<<4)

The plugin doesn't need big memory.

◆ SP_PLUGIN_CAPS_CUSTOM_OPTION_DIALOG

#define SP_PLUGIN_CAPS_CUSTOM_OPTION_DIALOG   (1<<5)

The plugin displays the option dialog specialized for the plugin. If this caps is turned on, A call of free_options with options=NULL must display the option dialog.

◆ SP_PLUGIN_CAPS_THREAD_BY_THREAD_SAFE

#define SP_PLUGIN_CAPS_THREAD_BY_THREAD_SAFE   (1<<6)

The plugin is not true thread-safe, but thread-safe in a thread-by-thread basis.

Typedef Documentation

◆ spPluginError

typedef int spPluginError

Definition of spPluginError.

Enumeration Type Documentation

◆ spPluginCallbackReason

The callback reason for the plugin callback function.

Enumerator
SP_PLUGIN_CR_ERROR 

Callbacked for an error.

SP_PLUGIN_CR_OPTION 

Callbacked when the options must be updated. host_data: spOptions

◆ spPluginState

The current state of the plugin.

Enumerator
SP_PLUGIN_STATE_ERROR 

Error.

SP_PLUGIN_STATE_STOP 

Stopped state.

SP_PLUGIN_STATE_START 

Started state.

SP_PLUGIN_STATE_PAUSE 

Paused state.

◆ spPluginDeviceType

Target device of the plugin.

Enumerator
SP_PLUGIN_DEVICE_UNKNOWN 

Unknow target.

SP_PLUGIN_DEVICE_FILE 

A file.

SP_PLUGIN_DEVICE_AUDIO 

An audio device.

SP_PLUGIN_DEVICE_CD 

A CD player.

SP_PLUGIN_DEVICE_MIXER 

A mixer device.

SP_PLUGIN_DEVICE_OTHERS 

Other devices.

Function Documentation

◆ spGetPluginSearchPath()

const char * spGetPluginSearchPath ( void )
extern

Gets the current search path of plugins.

Returns
Returns the current null-terminated path of the directories. Multiple directories are indicated by using the separator of ‘;’ on Windows and Mac or ‘:’ on others.

◆ spSetPluginSearchPath()

void spSetPluginSearchPath ( const char * pathlist)
extern

Sets the directories to search plugins.

Parameters
[in]pathlistThe null-terminated path of the directories. This list overrides the current list. Multiple directories can be specified by using the separator of ‘;’ on Windows and Mac or ‘:’ on others. Specifiying NULL will initialize the current list.

◆ spAppendPluginSearchPath()

spBool spAppendPluginSearchPath ( const char * pathlist)
extern

Appends the directories to the tail of the current search path of plugins.

Parameters
[in]pathlistThe null-terminated path of the directories. This list will be appended to the tail of the current list. Multiple directories can be specified by using the separator of ‘;’ on Windows and Mac or ‘:’ on others. Specifiying NULL does not change the current list.

◆ spPrependPluginSearchPath()

spBool spPrependPluginSearchPath ( const char * pathlist)
extern

Prepends the directories to the head of the current search path of plugins.

Parameters
[in]pathlistThe null-terminated path of the directories. This list will be prepended to the head of the current list. Multiple directories can be specified by using the separator of ‘;’ on Windows and Mac or ‘:’ on others. Specifiying NULL does not change the current list.

◆ spIsPluginFile()

spBool spIsPluginFile ( const char * filename)
extern

Checks whether the file is a plugin. This function checks that only by using the suffix of the file name, i.e., doesn't load the plugin.

Parameters
[in]filenameThe null-terminated path of the file. filename is not a body of the name but a actual path as opposed to spLoadPlugin() .
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ xspSearchPluginFile()

char * xspSearchPluginFile ( int index)
extern

Searches the index-th plugin and Gets the file name of the plugin. This function targets only the files that spIsPluginFile() returns SP_TRUE.

Parameters
[in]indexThe index for a plugin.
Returns
A null-terminated string indicating the file name of the plugin. You have to deallocate the memory by calling xspFree() . NULL will be returned if error occurs.