| lv2.h | | lv2.h | |
| | | | |
| skipping to change at line 37 | | skipping to change at line 37 | |
| #include <stdint.h> | | #include <stdint.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /* ************************************************************************
* */ | | /* ************************************************************************
* */ | |
| | | | |
| /** @file lv2.h | | /** @file lv2.h | |
| * | | * | |
|
| * Revision: 1.0beta3 | | * Revision: 1.0beta4 | |
| * | | * | |
| * == Overview == | | * == Overview == | |
| * | | * | |
| * There are a large number of open source and free software synthesis | | * There are a large number of open source and free software synthesis | |
| * packages in use or development at this time. This API ('LV2') | | * packages in use or development at this time. This API ('LV2') | |
| * attempts to give programmers the ability to write simple 'plugin' | | * attempts to give programmers the ability to write simple 'plugin' | |
| * audio processors in C/C++ and link them dynamically ('plug') into | | * audio processors in C/C++ and link them dynamically ('plug') into | |
| * a range of these packages ('hosts'). It should be possible for any | | * a range of these packages ('hosts'). It should be possible for any | |
| * host and any plugin to communicate completely through this interface. | | * host and any plugin to communicate completely through this interface. | |
| * | | * | |
| | | | |
| skipping to change at line 154 | | skipping to change at line 154 | |
| } LV2_Host_Feature; | | } LV2_Host_Feature; | |
| | | | |
| /* ************************************************************************
* */ | | /* ************************************************************************
* */ | |
| | | | |
| /** Descriptor for a Type of Plugin. | | /** Descriptor for a Type of Plugin. | |
| * | | * | |
| * This structure is used to describe a plugin type. It provides a number | | * This structure is used to describe a plugin type. It provides a number | |
| * of functions to instantiate it, link it to buffers and run it. */ | | * of functions to instantiate it, link it to buffers and run it. */ | |
| typedef struct _LV2_Descriptor { | | typedef struct _LV2_Descriptor { | |
| | | | |
|
| /** A globally unique, case-sensitive identifier for this plugin type. | | /** A globally unique, case-sensitive identifier for this plugin typ | |
| * | | e. | |
| * All plugins with the same URI MUST be compatible in terms of 'port | | * | |
| * signature', meaning they have the same number of ports, same port | | * All plugins with the same URI MUST be compatible in terms of 'por | |
| * shortnames, and roughly the same functionality. URIs should | | t | |
| * probably contain a version number (or similar) for this reason. | | * signature', meaning they have the same number of ports, same port | |
| * | | * shortnames, and roughly the same functionality. URIs should | |
| * Rationale: When serializing session/patch/etc files, hosts MUST | | * probably contain a version number (or similar) for this reason. | |
| * refer to a loaded plugin by the plugin URI only. In the future | | * | |
| * loading a plugin with this URI MUST yield a plugin with the | | * Rationale: When serializing session/patch/etc files, hosts MUST | |
| * same ports (etc) which is 100% compatible. */ | | * refer to a loaded plugin by the plugin URI only. In the future | |
| const char * URI; | | * loading a plugin with this URI MUST yield a plugin with the | |
| | | * same ports (etc) which is 100% compatible. */ | |
| | | const char * URI; | |
| | | | |
|
| /** Function pointer that instantiates a plugin. | | /** Function pointer that instantiates a plugin. | |
| * | | * | |
| * A handle is returned indicating the new plugin instance. The | | * A handle is returned indicating the new plugin instance. The | |
| * instantiation function accepts a sample rate as a parameter as well | | * instantiation function accepts a sample rate as a parameter as we | |
| * as the plugin descriptor from which this instantiate function was | | ll | |
| * found. This function must return NULL if instantiation fails. | | * as the plugin descriptor from which this instantiate function was | |
| * | | * found. This function must return NULL if instantiation fails. | |
| * BundlePath is a string of the path to the LV2 bundle which contains | | * | |
| * this plugin binary. It MUST include the trailing directory separator | | * BundlePath is a string of the path to the LV2 bundle which contai | |
| * (e.g. '/') so that BundlePath + filename gives the path to a file | | ns | |
| * in the bundle. | | * this plugin binary. It MUST include the trailing directory separ | |
| * | | ator | |
| * HostFeatures is a NULL terminated array of the URIs of the LV2 | | * (e.g. '/') so that BundlePath + filename gives the path to a file | |
| * features that the host supports. Plugins may refuse to instantiate | | * in the bundle. | |
| * if required features are not found here (however hosts SHOULD NOT use | | * | |
| * this as a discovery mechanism, instead reading the data file before | | * HostFeatures is a NULL terminated array of the URIs of the LV2 | |
| * attempting to instantiate the plugin). This array must always exist; | | * features that the host supports. Plugins may refuse to instantiat | |
| * if a host has no features, it MUST pass a single element array | | e | |
| * containing NULL (to simplify plugins). | | * if required features are not found here (however hosts SHOULD NOT | |
| * | | use | |
| * Note that instance initialisation should generally occur in | | * this as a discovery mechanism, instead reading the data file befo | |
| * activate() rather than here. If a host calls instantiate, it MUST | | re | |
| * call cleanup() at some point in the future. */ | | * attempting to instantiate the plugin). This array must always ex | |
| LV2_Handle (*instantiate)(const struct _LV2_Descriptor * Descriptor, | | ist; | |
| uint32_t SampleRate, | | * if a host has no features, it MUST pass a single element array | |
| const char * BundlePath, | | * containing NULL (to simplify plugins). | |
| const LV2_Host_Feature *const * HostFeatures); | | * | |
| | | * Note that instance initialisation should generally occur in | |
| | | * activate() rather than here. If a host calls instantiate, it MUS | |
| | | T | |
| | | * call cleanup() at some point in the future. */ | |
| | | LV2_Handle (*instantiate)(const struct _LV2_Descriptor * Descriptor | |
| | | , | |
| | | double SampleRate | |
| | | , | |
| | | const char * BundlePath | |
| | | , | |
| | | const LV2_Host_Feature *const * HostFeatur | |
| | | es); | |
| | | | |
|
| /** Function pointer that connects a port on a plugin instance to a memor | | /** Function pointer that connects a port on a plugin instance to a | |
| y | | memory | |
| * location where the block of data for the port will be read/written. | | * location where the block of data for the port will be read/writte | |
| * | | n. | |
| * The data location is expected to be of the type defined in the | | * | |
| * plugin's data file (e.g. an array of float for an lv2:AudioPort). | | * The data location is expected to be of the type defined in the | |
| * Memory issues are managed by the host. The plugin must read/write | | * plugin's data file (e.g. an array of float for an lv2:AudioPort). | |
| * the data at these locations every time run() is called, data | | * Memory issues are managed by the host. The plugin must read/write | |
| * present at the time of this connection call MUST NOT be | | * the data at these locations every time run() is called, data | |
| * considered meaningful. | | * present at the time of this connection call MUST NOT be | |
| * | | * considered meaningful. | |
| * connect_port() may be called more than once for a plugin instance | | * | |
| * to allow the host to change the buffers that the plugin is reading | | * connect_port() may be called more than once for a plugin instance | |
| * or writing. These calls may be made before or after activate() | | * to allow the host to change the buffers that the plugin is readin | |
| * or deactivate() calls. Note that there may be realtime constraints | | g | |
| * on connect_port (see lv2:hardRTCapable in lv2.ttl). | | * or writing. These calls may be made before or after activate() | |
| * | | * or deactivate() calls. Note that there may be realtime constrain | |
| * connect_port() MUST be called at least once for each port before | | ts | |
| * run() is called. The plugin must pay careful attention to the block | | * on connect_port (see lv2:hardRTCapable in lv2.ttl). | |
| * size passed to the run function as the block allocated may only just | | * | |
| * be large enough to contain the block of data (typically samples), and | | * connect_port() MUST be called at least once for each port before | |
| * is not guaranteed to be constant. | | * run() is called. The plugin must pay careful attention to the bl | |
| * | | ock | |
| * Plugin writers should be aware that the host may elect to use the | | * size passed to the run function as the block allocated may only j | |
| * same buffer for more than one port and even use the same buffer for | | ust | |
| * both input and output (see lv2:inPlaceBroken in lv2.ttl). | | * be large enough to contain the block of data (typically samples), | |
| * However, overlapped buffers or use of a single buffer for both | | and | |
| * audio and control data may result in unexpected behaviour. | | * is not guaranteed to be constant. | |
| * | | * | |
| * If the plugin has the property lv2:hardRTCapable then there are | | * Plugin writers should be aware that the host may elect to use the | |
| * various things that the plugin MUST NOT do within the connect_port() | | * same buffer for more than one port and even use the same buffer f | |
| * function (see lv2.ttl). */ | | or | |
| void (*connect_port)(LV2_Handle Instance, | | * both input and output (see lv2:inPlaceBroken in lv2.ttl). | |
| uint32_t Port, | | * However, overlapped buffers or use of a single buffer for both | |
| void * DataLocation); | | * audio and control data may result in unexpected behaviour. | |
| | | * | |
| | | * If the plugin has the property lv2:hardRTCapable then there are | |
| | | * various things that the plugin MUST NOT do within the connect_por | |
| | | t() | |
| | | * function (see lv2.ttl). */ | |
| | | void (*connect_port)(LV2_Handle Instance, | |
| | | uint32_t Port, | |
| | | void * DataLocation); | |
| | | | |
|
| /** Function pointer that initialises a plugin instance and activates | | /** Function pointer that initialises a plugin instance and activate | |
| * it for use. | | s | |
| * | | * it for use. | |
| * This is separated from instantiate() to aid real-time support and so | | * | |
| * that hosts can reinitialise a plugin instance by calling deactivate() | | * This is separated from instantiate() to aid real-time support and | |
| * and then activate(). In this case the plugin instance must reset all | | so | |
| * state information dependent on the history of the plugin instance | | * that hosts can reinitialise a plugin instance by calling deactiva | |
| * except for any data locations provided by connect_port(). If there | | te() | |
| * is nothing for activate() to do then the plugin writer may provide | | * and then activate(). In this case the plugin instance must reset | |
| * a NULL rather than an empty function. | | all | |
| * | | * state information dependent on the history of the plugin instance | |
| * When present, hosts MUST call this function once before run() | | * except for any data locations provided by connect_port(). If ther | |
| * is called for the first time. This call SHOULD be made as close | | e | |
| * to the run() call as possible and indicates to real-time plugins | | * is nothing for activate() to do then the plugin writer may provid | |
| * that they are now live, however plugins MUST NOT rely on a prompt | | e | |
| * call to run() after activate(). activate() may not be called again | | * a NULL rather than an empty function. | |
| * unless deactivate() is called first (after which activate() may be | | * | |
| * called again, followed by deactivate, etc. etc.). If a host calls | | * When present, hosts MUST call this function once before run() | |
| * activate, it MUST call deactivate at some point in the future. | | * is called for the first time. This call SHOULD be made as close | |
| * | | * to the run() call as possible and indicates to real-time plugins | |
| * Note that connect_port() may be called before or after a call to | | * that they are now live, however plugins MUST NOT rely on a prompt | |
| * activate(). */ | | * call to run() after activate(). activate() may not be called aga | |
| void (*activate)(LV2_Handle Instance); | | in | |
| | | * unless deactivate() is called first (after which activate() may b | |
| | | e | |
| | | * called again, followed by deactivate, etc. etc.). If a host call | |
| | | s | |
| | | * activate, it MUST call deactivate at some point in the future. | |
| | | * | |
| | | * Note that connect_port() may be called before or after a call to | |
| | | * activate(). */ | |
| | | void (*activate)(LV2_Handle Instance); | |
| | | | |
|
| /** Function pointer that runs a plugin instance for a block. | | /** Function pointer that runs a plugin instance for a block. | |
| * | | * | |
| * Two parameters are required: the first is a handle to the particular | | * Two parameters are required: the first is a handle to the particu | |
| * instance to be run and the second indicates the block size (in | | lar | |
| * samples) for which the plugin instance may run. | | * instance to be run and the second indicates the block size (in | |
| * | | * samples) for which the plugin instance may run. | |
| * Note that if an activate() function exists then it must be called | | * | |
| * before run(). If deactivate() is called for a plugin instance then | | * Note that if an activate() function exists then it must be called | |
| * the plugin instance may not be reused until activate() has been | | * before run(). If deactivate() is called for a plugin instance the | |
| * called again. | | n | |
| * | | * the plugin instance may not be reused until activate() has been | |
| * If the plugin has the property lv2:hardRTCapable then there are | | * called again. | |
| * various things that the plugin MUST NOT do within the run() | | * | |
| * function (see lv2.ttl). */ | | * If the plugin has the property lv2:hardRTCapable then there are | |
| void (*run)(LV2_Handle Instance, | | * various things that the plugin MUST NOT do within the run() | |
| uint32_t SampleCount); | | * function (see lv2.ttl). */ | |
| | | void (*run)(LV2_Handle Instance, | |
| | | uint32_t SampleCount); | |
| | | | |
|
| /** This is the counterpart to activate() (see above). If there is | | /** This is the counterpart to activate() (see above). If there is | |
| * nothing for deactivate() to do then the plugin writer may provide | | * nothing for deactivate() to do then the plugin writer may provide | |
| * a NULL rather than an empty function. | | * a NULL rather than an empty function. | |
| * | | * | |
| * Hosts must deactivate all activated units after they have been run() | | * Hosts must deactivate all activated units after they have been ru | |
| * for the last time. This call SHOULD be made as close to the last | | n() | |
| * run() call as possible and indicates to real-time plugins that | | * for the last time. This call SHOULD be made as close to the last | |
| * they are no longer live, however plugins MUST NOT rely on prompt | | * run() call as possible and indicates to real-time plugins that | |
| * deactivation. Note that connect_port() may be called before or | | * they are no longer live, however plugins MUST NOT rely on prompt | |
| * after a call to deactivate(). | | * deactivation. Note that connect_port() may be called before or | |
| * | | * after a call to deactivate(). | |
| * Note that deactivation is not similar to pausing as the plugin | | * | |
| * instance will be reinitialised when activate() is called to reuse it. | | * Note that deactivation is not similar to pausing as the plugin | |
| * Hosts MUST NOT call deactivate() unless activate() was previously | | * instance will be reinitialised when activate() is called to reuse | |
| * called. */ | | it. | |
| void (*deactivate)(LV2_Handle Instance); | | * Hosts MUST NOT call deactivate() unless activate() was previously | |
| | | * called. */ | |
| | | void (*deactivate)(LV2_Handle Instance); | |
| | | | |
|
| /** This is the counterpart to instantiate() (see above). Once an instan | | /** This is the counterpart to instantiate() (see above). Once an i | |
| ce | | nstance | |
| * of a plugin has been finished with it can be deleted using this | | * of a plugin has been finished with it can be deleted using this | |
| * function. The instance handle passed ceases to be valid after | | * function. The instance handle passed ceases to be valid after | |
| * this call. | | * this call. | |
| * | | * | |
| * If activate() was called for a plugin instance then a corresponding | | * If activate() was called for a plugin instance then a correspondi | |
| * call to deactivate() MUST be made before cleanup() is called. | | ng | |
| * Hosts MUST NOT call cleanup() unless instantiate() was previously | | * call to deactivate() MUST be made before cleanup() is called. | |
| * called. */ | | * Hosts MUST NOT call cleanup() unless instantiate() was previously | |
| void (*cleanup)(LV2_Handle Instance); | | * called. */ | |
| | | void (*cleanup)(LV2_Handle Instance); | |
| | | | |
|
| /** Function pointer that can be used to return additional instance data | | /** Function pointer that can be used to return additional instance | |
| for | | data for | |
| * a plugin defined by some extenion (e.g. a struct containing additional | | * a plugin defined by some extenion (e.g. a struct containing addit | |
| * function pointers). | | ional | |
| * | | * function pointers). | |
| * The actual type and meaning of the returned object MUST be specified | | * | |
| * precisely by the extension if it defines any extra data. If a particu | | * The actual type and meaning of the returned object MUST be specif | |
| lar | | ied | |
| * extension does not define extra instance data, this function MUST retu | | * precisely by the extension if it defines any extra data. If a pa | |
| rn | | rticular | |
| * NULL for that extension's URI. If a plugin does not support any | | * extension does not define extra instance data, this function MUST | |
| * extensions that define extra instance data, this function pointer may | | return | |
| be | | * NULL for that extension's URI. If a plugin does not support any | |
| * set to NULL rather than providing an empty function. | | * extensions that define extra instance data, this function pointer | |
| * | | may be | |
| * The only parameter is the URI of the extension. The plugin MUST return | | * set to NULL rather than providing an empty function. | |
| * NULL if it does not support the extension, but hosts SHOULD NOT use th | | * | |
| is | | * The only parameter is the URI of the extension. The plugin MUST r | |
| * as a discovery method (e.g. hosts should only call this function for | | eturn | |
| * extensions known to be supported by the plugin from the data file). | | * NULL if it does not support the extension, but hosts SHOULD NOT u | |
| * | | se this | |
| * NOTE: It is highly recommended that this function returns a struct, an | | * as a discovery method (e.g. hosts should only call this function | |
| d | | for | |
| * NOT a direct function pointer. Standard C++ (for real reasons) does n | | * extensions known to be supported by the plugin from the data file | |
| ot | | ). | |
| * allow type casts from void* to a function pointer type. To provide | | * | |
| * additional functions a struct should be returned containing the extra | | * NOTE: It is highly recommended that this function returns a struc | |
| * function pointers (which is valid standard C++, and a much better idea | | t, and | |
| * for extensibility anyway). | | * NOT a direct function pointer. Standard C++ (for real reasons) d | |
| */ | | oes not | |
| void* (*extension_data)(const char * URI); | | * allow type casts from void* to a function pointer type. To provi | |
| | | de | |
| | | * additional functions a struct should be returned containing the e | |
| | | xtra | |
| | | * function pointers (which is valid standard C++, and a much better | |
| | | idea | |
| | | * for extensibility anyway). | |
| | | */ | |
| | | void* (*extension_data)(const char * URI); | |
| | | | |
| } LV2_Descriptor; | | } LV2_Descriptor; | |
| | | | |
| /* ****************************************************************** */ | | /* ****************************************************************** */ | |
| | | | |
| /** Accessing Plugin Types. | | /** Accessing Plugin Types. | |
| * | | * | |
| * The exact mechanism by which plugins are loaded is host-dependent, | | * The exact mechanism by which plugins are loaded is host-dependent, | |
| * however all most hosts will need to know is the URI of the plugin they | | * however all most hosts will need to know is the URI of the plugin they | |
| * wish to load. The environment variable LV2_PATH, if present, should | | * wish to load. The environment variable LV2_PATH, if present, should | |
| | | | |
End of changes. 9 change blocks. |
| 172 lines changed or deleted | | 216 lines changed or added | |
|
| types.h | | types.h | |
| | | | |
| skipping to change at line 29 | | skipping to change at line 29 | |
| #ifndef __SLV2_TYPES_H__ | | #ifndef __SLV2_TYPES_H__ | |
| #define __SLV2_TYPES_H__ | | #define __SLV2_TYPES_H__ | |
| | | | |
| #include <stdbool.h> | | #include <stdbool.h> | |
| #include <stdint.h> | | #include <stdint.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
|
| /** Class (direction and type) of a port | | /** (Data) Type of a port | |
| * | | * | |
|
| * Note that ports may be of other classes not listed here, this is just | | * SLV2_UNKNOWN_PORT_TYPE means the Port is not of any type SLV2 understand | |
| * to make the most common case simple. Use slv2_port_get_value(p, "rdf:ty | | s | |
| pe") | | * (currently Control, Audio, MIDI, and OSC). | |
| * if you need further class information. | | * | |
| | | * Further class information can be using slv2_port_get_value(p, "rdf:type" | |
| | | ) | |
| | | * or a custom query. | |
| */ | | */ | |
|
| typedef enum _SLV2PortClass { | | typedef enum _SLV2PortDataType { | |
| SLV2_UNKNOWN_PORT_CLASS, | | SLV2_PORT_TYPE_UNKNOWN, | |
| SLV2_CONTROL_INPUT, /**< One input float per block */ | | SLV2_PORT_TYPE_CONTROL, /**< One float per block */ | |
| SLV2_CONTROL_OUTPUT, /**< One output float per block */ | | SLV2_PORT_TYPE_AUDIO, /**< One float per frame */ | |
| SLV2_AUDIO_INPUT, /**< One input float per frame */ | | SLV2_PORT_TYPE_MIDI, /**< A buffer of MIDI data (LL extension) */ | |
| SLV2_AUDIO_OUTPUT, /**< One output float per frame */ | | SLV2_PORT_TYPE_OSC, /**< A buffer of OSC data (DR extension) */ | |
| SLV2_MIDI_INPUT, /**< MIDI input (LL extension) */ | | } SLV2PortDataType; | |
| SLV2_MIDI_OUTPUT /**< MIDI output (LL extension) */ | | | |
| } SLV2PortClass; | | /** Direction (input or output) of a port | |
| | | * | |
| | | * SLV2_UNKNOWN_PORT_DIRECTION means the Port is only of type lv2:Port | |
| | | * (neither lv2:Input or lv2:Output) as far as SLV2 understands. | |
| | | * | |
| | | * Further class information can be using slv2_port_get_value(p, "rdf:type" | |
| | | ) | |
| | | * or a custom query. | |
| | | */ | |
| | | typedef enum _SLV2PortDirection { | |
| | | SLV2_PORT_DIRECTION_UNKNOWN, /**< Neither input or output */ | |
| | | SLV2_PORT_DIRECTION_INPUT, /**< Plugin reads from port when run */ | |
| | | SLV2_PORT_DIRECTION_OUTPUT, /**< Plugin writes to port when run */ | |
| | | } SLV2PortDirection; | |
| | | | |
| /** The format of a URI string. | | /** The format of a URI string. | |
| * | | * | |
| * Full URI: http://example.org/foo | | * Full URI: http://example.org/foo | |
| * QName: lv2:Plugin | | * QName: lv2:Plugin | |
| */ | | */ | |
| typedef enum _SLV2URIType { | | typedef enum _SLV2URIType { | |
| SLV2_URI, | | SLV2_URI, | |
| SLV2_QNAME | | SLV2_QNAME | |
| } SLV2URIType; | | } SLV2URIType; | |
| | | | |
|
| | | /** A type of plugin GUI (corresponding to some LV2 GUI extension). | |
| | | */ | |
| | | typedef enum _SLV2GUIType { | |
| | | SLV2_GUI_TYPE_GTK2 ///< http://ll-plugins.nongnu.org/lv2/ext/gtk2gui | |
| | | } SLV2GUIType; | |
| | | | |
| /** A port on a plugin. Opaque, but valid to compare to NULL. */ | | /** A port on a plugin. Opaque, but valid to compare to NULL. */ | |
| typedef struct _SLV2Port* SLV2Port; | | typedef struct _SLV2Port* SLV2Port; | |
| | | | |
| /** A plugin. Opaque, but valid to compare to NULL. */ | | /** A plugin. Opaque, but valid to compare to NULL. */ | |
| typedef struct _SLV2Plugin* SLV2Plugin; | | typedef struct _SLV2Plugin* SLV2Plugin; | |
| | | | |
| /** A collection of plugins. Opaque, but valid to compare to NULL. */ | | /** A collection of plugins. Opaque, but valid to compare to NULL. */ | |
| typedef void* SLV2Plugins; | | typedef void* SLV2Plugins; | |
| | | | |
| /** The world. Opaque, but valid to compare to NULL. */ | | /** The world. Opaque, but valid to compare to NULL. */ | |
| | | | |
| skipping to change at line 79 | | skipping to change at line 99 | |
| | | | |
| /** A collection of plugin classes. Opaque, but valid to compare to NULL.
*/ | | /** A collection of plugin classes. Opaque, but valid to compare to NULL.
*/ | |
| typedef void* SLV2PluginClasses; | | typedef void* SLV2PluginClasses; | |
| | | | |
| /** A typed value */ | | /** A typed value */ | |
| typedef struct _SLV2Value* SLV2Value; | | typedef struct _SLV2Value* SLV2Value; | |
| | | | |
| /** A collection of typed values. */ | | /** A collection of typed values. */ | |
| typedef void* SLV2Values; | | typedef void* SLV2Values; | |
| | | | |
|
| | | /** A plugin GUI */ | |
| | | typedef void* SLV2GUI; | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* __SLV2_TYPES_H__ */ | | #endif /* __SLV2_TYPES_H__ */ | |
| | | | |
End of changes. 5 change blocks. |
| 14 lines changed or deleted | | 39 lines changed or added | |
|
| world.h | | world.h | |
| | | | |
| skipping to change at line 50 | | skipping to change at line 50 | |
| * | | * | |
| * Normal hosts should NOT have to refer to bundles directly under normal | | * Normal hosts should NOT have to refer to bundles directly under normal | |
| * circumstances. However, functions are provided to load individual bundl
es | | * circumstances. However, functions are provided to load individual bundl
es | |
| * explicitly, intended for hosts which depend on a specific bundle | | * explicitly, intended for hosts which depend on a specific bundle | |
| * (which is shipped with the application). | | * (which is shipped with the application). | |
| * | | * | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
| /** Initialize a new, empty world. | | /** Initialize a new, empty world. | |
|
| | | * | |
| | | * If initialization fails, NULL is returned. | |
| */ | | */ | |
| SLV2World | | SLV2World | |
| slv2_world_new(); | | slv2_world_new(); | |
| | | | |
| /** Initialize a new, empty world, using an existing Redland context. | | /** Initialize a new, empty world, using an existing Redland context. | |
| */ | | */ | |
| SLV2World | | SLV2World | |
| slv2_world_new_using_rdf_world(librdf_world* world); | | slv2_world_new_using_rdf_world(librdf_world* world); | |
| | | | |
| /** Destroy the world, mwahaha. | | /** Destroy the world, mwahaha. | |
| * | | * | |
| * NB: Destroying the world will leave dangling references in any plugin li
sts, | | * NB: Destroying the world will leave dangling references in any plugin li
sts, | |
| * plugins, etc. Do not destroy the world until you are finished with all | | * plugins, etc. Do not destroy the world until you are finished with all | |
| * objects that came from it. | | * objects that came from it. | |
| */ | | */ | |
| void | | void | |
| slv2_world_free(SLV2World world); | | slv2_world_free(SLV2World world); | |
| | | | |
|
| | | #if 0 | |
| | | /** Set the RDF lock function. | |
| | | * | |
| | | * If set, this function will be called before any calls to librdf function | |
| | | s. | |
| | | * This can be used to make SLV2 thread-safe. | |
| | | * | |
| | | * \a lock will be called with \a data as a parameter, whenever SLV2 is goi | |
| | | ng | |
| | | * to perform an RDF operation. | |
| | | */ | |
| | | void | |
| | | slv2_world_set_rdf_lock_function(SLV2World world, void (*lock)(void*), void | |
| | | * data); | |
| | | | |
| | | /** Set the unlock function. | |
| | | * | |
| | | * This is the counterpart to the RDF lock function set with | |
| | | * slv2_world_set_rdf_lock_function. Be sure to call this after locking, | |
| | | * or a deadlock will occur. | |
| | | * | |
| | | * \a unlock will be called with the same data pointer set with | |
| | | * slv2_world_set_rdf_lock_function. | |
| | | */ | |
| | | void | |
| | | slv2_world_set_rdf_unlock_function(SLV2World world, void (*unlock)(void*)); | |
| | | #endif | |
| | | | |
| /** Load all installed LV2 bundles on the system. | | /** Load all installed LV2 bundles on the system. | |
| * | | * | |
| * This is the recommended way for hosts to load LV2 data. It does the mos
t | | * This is the recommended way for hosts to load LV2 data. It does the mos
t | |
| * reasonable thing to find all installed plugins, extensions, etc. on the | | * reasonable thing to find all installed plugins, extensions, etc. on the | |
| * system. The environment variable LV2_PATH may be used to set the | | * system. The environment variable LV2_PATH may be used to set the | |
| * directories inside which this function will look for bundles. Otherwise | | * directories inside which this function will look for bundles. Otherwise | |
| * a sensible, standard default will be used. | | * a sensible, standard default will be used. | |
| * | | * | |
| * Use of other functions for loading bundles is \em highly discouraged | | * Use of other functions for loading bundles is \em highly discouraged | |
| * without a special reason to do so - use this one. | | * without a special reason to do so - use this one. | |
| | | | |
| skipping to change at line 177 | | skipping to change at line 204 | |
| /** Get plugins filtered by a user-defined SPARQL query. | | /** Get plugins filtered by a user-defined SPARQL query. | |
| * | | * | |
| * This is much faster than using slv2_world_get_plugins_by_filter with a | | * This is much faster than using slv2_world_get_plugins_by_filter with a | |
| * filter function which calls the various slv2_plugin_* functions. | | * filter function which calls the various slv2_plugin_* functions. | |
| * | | * | |
| * \param query A valid SPARQL query which SELECTs a single variable, which | | * \param query A valid SPARQL query which SELECTs a single variable, which | |
| * should match the URI of plugins to be loaded. | | * should match the URI of plugins to be loaded. | |
| * | | * | |
| * \b Example: Get all plugins with at least 1 audio input and output: | | * \b Example: Get all plugins with at least 1 audio input and output: | |
| <tt> \verbatim | | <tt> \verbatim | |
|
| PREFIX : <http://lv2plug.in/ontology#> | | PREFIX : <http://lv2plug.in/ns/lv2core#> | |
| SELECT DISTINCT ?plugin WHERE { | | SELECT DISTINCT ?plugin WHERE { | |
| ?plugin :port [ a :AudioPort; a :InputPort ] ; | | ?plugin :port [ a :AudioPort; a :InputPort ] ; | |
| :port [ a :AudioPort; a :OutputPort ] . | | :port [ a :AudioPort; a :OutputPort ] . | |
| } | | } | |
| \endverbatim </tt> | | \endverbatim </tt> | |
| * | | * | |
| * Returned plugins contain a reference to this world, world must not be | | * Returned plugins contain a reference to this world, world must not be | |
| * destroyed until plugins are finished with. | | * destroyed until plugins are finished with. | |
| */ | | */ | |
| SLV2Plugins | | SLV2Plugins | |
| | | | |
End of changes. 3 change blocks. |
| 1 lines changed or deleted | | 31 lines changed or added | |
|