| lv2.h | | lv2.h | |
| /* LV2 - LADSPA (Linux Audio Developer's Simple Plugin API) Version 2.0 | | /* LV2 - LADSPA (Linux Audio Developer's Simple Plugin API) Version 2.0 | |
|
| * *** PROVISIONAL *** | | * *** PROVISIONAL Revision 1.0beta6 (2007-10-03) *** | |
| * | | * | |
| * Copyright (C) 2000-2002 Richard W.E. Furse, Paul Barton-Davis, | | * Copyright (C) 2000-2002 Richard W.E. Furse, Paul Barton-Davis, | |
|
| * Stefan Westerfeld | | * Stefan Westerfeld. | |
| * Copyright (C) 2006-2007 Steve Harris, Dave Robillard. | | * Copyright (C) 2006-2007 Steve Harris, Dave Robillard. | |
| * | | * | |
| * This header is free software; you can redistribute it and/or modify it | | * This header is free software; you can redistribute it and/or modify it | |
| * under the terms of the GNU Lesser General Public License as published | | * under the terms of the GNU Lesser General Public License as published | |
| * by the Free Software Foundation; either version 2.1 of the License, | | * by the Free Software Foundation; either version 2.1 of the License, | |
| * or (at your option) any later version. | | * or (at your option) any later version. | |
| * | | * | |
| * This header is distributed in the hope that it will be useful, | | * This header is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| | | | |
| 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.0beta4 | | * Revision: 1.0beta6 | |
| * | | * | |
| * == 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. | |
| * | | * | |
| * This API is deliberately as short and simple as possible. | | * This API is deliberately as short and simple as possible. | |
| * The information required to use a plugin is in a companion data | | * The information required to use a plugin is in a companion data | |
| * (RDF) file. The shared library portion of the API (defined in this | | * (RDF) file. The shared library portion of the API (defined in this | |
| * header) does not contain enough information to make use of the plugin | | * header) does not contain enough information to make use of the plugin | |
| * possible - the data file is mandatory. | | * possible - the data file is mandatory. | |
| * | | * | |
| * Plugins are expected to distinguish between control rate and audio | | * Plugins are expected to distinguish between control rate and audio | |
|
| * rate data. Plugins have 'ports' that are inputs or outputs for audio | | * rate data (or other types of data defined by extensions). Plugins have | |
| * or control data and each plugin is 'run' for a 'block' corresponding | | * 'ports' that are inputs or outputs and each plugin is 'run' for a 'block | |
| * to a short time interval measured in samples. Audio rate data is | | ' | |
| * communicated using arrays with one element per sample processed, | | * corresponding to a short time interval measured in samples. Audio rate | |
| | | * data is communicated using arrays with one element per sample processed, | |
| * allowing a block of audio to be processed by the plugin in a single | | * allowing a block of audio to be processed by the plugin in a single | |
| * pass. Control rate data is communicated using single values. Control | | * pass. Control rate data is communicated using single values. Control | |
| * rate data has a single value at the start of a call to the 'run()' | | * rate data has a single value at the start of a call to the 'run()' | |
| * function, and may be considered to remain this value for its duration. | | * function, and may be considered to remain this value for its duration. | |
|
| * Thus the 'control rate' is determined by the block size, controlled | | * Thus the 'control rate' is determined by the block size, controlled by | |
| * by the host. The plugin may assume that all its input and output | | * the host. The plugin may assume that all its input and output ports hav | |
| * ports have been connected to the relevant data location (see the | | e | |
| * 'connect_port()' function below) before it is asked to run. | | * been connected to the relevant data location (see the 'connect_port()' | |
| | | * function below) before it is asked to run, unless the port has been set | |
| | | * 'connection optional' in the plugin's data file. | |
| * | | * | |
| * Plugins will reside in shared object files suitable for dynamic linking | | * Plugins will reside in shared object files suitable for dynamic linking | |
| * by dlopen() and family. The file will provide a number of 'plugin | | * by dlopen() and family. The file will provide a number of 'plugin | |
| * types' that can be used to instantiate actual plugins (sometimes known | | * types' that can be used to instantiate actual plugins (sometimes known | |
| * as 'plugin instances') that can be connected together to perform tasks. | | * as 'plugin instances') that can be connected together to perform tasks. | |
| * The host can access these plugin types using the lv2_descriptor() | | * The host can access these plugin types using the lv2_descriptor() | |
| * function. | | * function. | |
| * | | * | |
| * This API contains very limited error-handling. | | * This API contains very limited error-handling. | |
| * | | * | |
| * == Threading rules == | | * == Threading rules == | |
| * | | * | |
| * Certain hosts may need to call the functions provided by a plugin from | | * Certain hosts may need to call the functions provided by a plugin from | |
| * multiple threads. For this to be safe, the plugin must be written so tha
t | | * multiple threads. For this to be safe, the plugin must be written so tha
t | |
| * those functions can be executed simultaneously without problems. | | * those functions can be executed simultaneously without problems. | |
| * To facilitate this, the functions provided by a plugin are divided into | | * To facilitate this, the functions provided by a plugin are divided into | |
| * classes: | | * classes: | |
| * | | * | |
|
| * - Audio class: run(), connect_port() | | * - Discovery class: lv2_descriptor(), extension_data() | |
| * - Instantiation class: instantiate(), cleanup(), | | * - Instantiation class: instantiate(), cleanup(), activate(), deactivate | |
| * activate(), deactivate() | | () | |
| | | * - Audio class: run(), connect_port() | |
| * | | * | |
| * Extensions to this specification which add new functions MUST declare in | | * Extensions to this specification which add new functions MUST declare in | |
| * which of these classes the functions belong, or define new classes for t
hem. | | * which of these classes the functions belong, or define new classes for t
hem. | |
| * The rules that hosts must follow are these: | | * The rules that hosts must follow are these: | |
| * | | * | |
|
| | | * - When a function from the Discovery class is running, no other | |
| | | * functions in the same shared object file may run. | |
| * - When a function from the Instantiation class is running for a plugin | | * - When a function from the Instantiation class is running for a plugin | |
| * instance, no other functions for that instance may run. | | * instance, no other functions for that instance may run. | |
| * - When a function is running for a plugin instance, no other | | * - When a function is running for a plugin instance, no other | |
| * function in the same class may run for that instance. | | * function in the same class may run for that instance. | |
| * | | * | |
| * Any simultaneous calls that are not explicitly forbidden by these rules | | * Any simultaneous calls that are not explicitly forbidden by these rules | |
| * are allowed. For example, a host may call run() for two different plugin | | * are allowed. For example, a host may call run() for two different plugin | |
| * instances simultaneously. | | * instances simultaneously. | |
|
| * | | | |
| * The extension_data() function and the lv2_descriptor() function are neve | | | |
| r | | | |
| * associated with any plugin instances and may be called at any time. | | | |
| */ | | */ | |
| | | | |
| /* ************************************************************************
* */ | | /* ************************************************************************
* */ | |
| | | | |
| /** Plugin Handle. | | /** Plugin Handle. | |
| * | | * | |
| * This plugin handle indicates a particular instance of the plugin | | * This plugin handle indicates a particular instance of the plugin | |
| * concerned. It is valid to compare this to NULL (0 for C++) but | | * concerned. It is valid to compare this to NULL (0 for C++) but | |
| * otherwise the host MUST NOT attempt to interpret it. The plugin | | * otherwise the host MUST NOT attempt to interpret it. The plugin | |
| * may use it to reference internal instance data. */ | | * may use it to reference internal instance data. */ | |
| typedef void * LV2_Handle; | | typedef void * LV2_Handle; | |
| | | | |
| /* ************************************************************************
* */ | | /* ************************************************************************
* */ | |
| | | | |
|
| /** Host feature. | | /** Feature data. | |
| * | | * | |
| * These are passed to a plugin's instantiate method to represent a special | | * These are passed to a plugin's instantiate method to represent a special | |
| * feature the host has which the plugin may depend on. This is to allow | | * feature the host has which the plugin may depend on. This is to allow | |
|
| * extensions to the LV2 specification without causing any breakage. The b | | * extensions to the LV2 specification without causing any breakage. | |
| ase | | * Extensions may specify what data needs to be passed here. The base | |
| * LV2 specification does not define any host features; hosts are not requi | | * LV2 specification does not define any features; hosts are not required | |
| red | | * to use this facility. */ | |
| * to use this facility. | | typedef struct _LV2_Feature { | |
| */ | | | |
| typedef struct _LV2_Host_Feature { | | | |
| /** A globally unique, case-sensitive identifier for this feature. | | /** A globally unique, case-sensitive identifier for this feature. | |
| * | | * | |
| * This MUST be defined in the specification of any LV2 extension wh
ich | | * This MUST be defined in the specification of any LV2 extension wh
ich | |
|
| * defines a host feature. | | * defines a host feature. */ | |
| */ | | | |
| const char * URI; | | const char * URI; | |
| | | | |
| /** Pointer to arbitrary data. | | /** Pointer to arbitrary data. | |
| * | | * | |
| * This is to allow hosts to pass data to a plugin (simple values, d
ata | | * This is to allow hosts to pass data to a plugin (simple values, d
ata | |
| * structures, function pointers, etc) as part of a 'feature'. The
LV2 | | * structures, function pointers, etc) as part of a 'feature'. The
LV2 | |
| * specification makes no restrictions on the contents of this data. | | * specification makes no restrictions on the contents of this data. | |
| * The data here MUST be cleary defined by the LV2 extension which d
efines | | * The data here MUST be cleary defined by the LV2 extension which d
efines | |
| * this feature. | | * this feature. | |
|
| * If no data is required, this may be set to NULL. | | * If no data is required, this may be set to NULL. */ | |
| */ | | | |
| void * data; | | void * data; | |
|
| } LV2_Host_Feature; | | } LV2_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 typ
e. | | /** A globally unique, case-sensitive identifier for this plugin typ
e. | |
| | | | |
| skipping to change at line 190 | | skipping to change at line 188 | |
| * features that the host supports. Plugins may refuse to instantiat
e | | * features that the host supports. Plugins may refuse to instantiat
e | |
| * if required features are not found here (however hosts SHOULD NOT
use | | * if required features are not found here (however hosts SHOULD NOT
use | |
| * this as a discovery mechanism, instead reading the data file befo
re | | * this as a discovery mechanism, instead reading the data file befo
re | |
| * attempting to instantiate the plugin). This array must always ex
ist; | | * attempting to instantiate the plugin). This array must always ex
ist; | |
| * if a host has no features, it MUST pass a single element array | | * if a host has no features, it MUST pass a single element array | |
| * containing NULL (to simplify plugins). | | * containing NULL (to simplify plugins). | |
| * | | * | |
| * Note that instance initialisation should generally occur in | | * Note that instance initialisation should generally occur in | |
| * activate() rather than here. If a host calls instantiate, it MUS
T | | * activate() rather than here. If a host calls instantiate, it MUS
T | |
| * call cleanup() at some point in the future. */ | | * call cleanup() at some point in the future. */ | |
|
| LV2_Handle (*instantiate)(const struct _LV2_Descriptor * Descriptor | | LV2_Handle (*instantiate)(const struct _LV2_Descriptor * descriptor, | |
| , | | double sample_rate | |
| double SampleRate | | , | |
| , | | const char * bundle_path | |
| const char * BundlePath | | , | |
| , | | const LV2_Feature *const * features); | |
| const LV2_Host_Feature *const * HostFeatur | | | |
| es); | | | |
| | | | |
| /** Function pointer that connects a port on a plugin instance to a
memory | | /** Function pointer that connects a port on a plugin instance to a
memory | |
| * location where the block of data for the port will be read/writte
n. | | * 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 | | * 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). | | * plugin's data file (e.g. an array of float for an lv2:AudioPort). | |
| * Memory issues are managed by the host. The plugin must read/write | | * Memory issues are managed by the host. The plugin must read/write | |
| * the data at these locations every time run() is called, data | | * the data at these locations every time run() is called, data | |
| * present at the time of this connection call MUST NOT be | | * present at the time of this connection call MUST NOT be | |
| * considered meaningful. | | * considered meaningful. | |
| * | | * | |
|
| | | * The host MUST NOT try to connect a data buffer to a port index | |
| | | * that is not defined in the RDF data for the plugin. If it does, | |
| | | * the plugin's behaviour is undefined. | |
| | | * | |
| * connect_port() may be called more than once for a plugin instance | | * connect_port() may be called more than once for a plugin instance | |
| * to allow the host to change the buffers that the plugin is readin
g | | * to allow the host to change the buffers that the plugin is readin
g | |
| * or writing. These calls may be made before or after activate() | | * or writing. These calls may be made before or after activate() | |
| * or deactivate() calls. Note that there may be realtime constrain
ts | | * or deactivate() calls. Note that there may be realtime constrain
ts | |
| * on connect_port (see lv2:hardRTCapable in lv2.ttl). | | * on connect_port (see lv2:hardRTCapable in lv2.ttl). | |
| * | | * | |
| * connect_port() MUST be called at least once for each port before | | * connect_port() MUST be called at least once for each port before | |
| * run() is called. The plugin must pay careful attention to the bl
ock | | * run() is called. The plugin must pay careful attention to the bl
ock | |
| * size passed to the run function as the block allocated may only j
ust | | * size passed to the run function as the block allocated may only j
ust | |
| * be large enough to contain the block of data (typically samples),
and | | * be large enough to contain the block of data (typically samples),
and | |
| * is not guaranteed to be constant. | | * is not guaranteed to be constant. | |
| * | | * | |
| * Plugin writers should be aware that the host may elect to use the | | * Plugin writers should be aware that the host may elect to use the | |
| * same buffer for more than one port and even use the same buffer f
or | | * same buffer for more than one port and even use the same buffer f
or | |
| * both input and output (see lv2:inPlaceBroken in lv2.ttl). | | * both input and output (see lv2:inPlaceBroken in lv2.ttl). | |
| * However, overlapped buffers or use of a single buffer for both | | * However, overlapped buffers or use of a single buffer for both | |
| * audio and control data may result in unexpected behaviour. | | * audio and control data may result in unexpected behaviour. | |
| * | | * | |
|
| * If the plugin has the property lv2:hardRTCapable then there are | | * If the plugin has the feature lv2:hardRTCapable then there are | |
| * various things that the plugin MUST NOT do within the connect_por
t() | | * various things that the plugin MUST NOT do within the connect_por
t() | |
| * function (see lv2.ttl). */ | | * function (see lv2.ttl). */ | |
|
| void (*connect_port)(LV2_Handle Instance, | | void (*connect_port)(LV2_Handle instance, | |
| uint32_t Port, | | uint32_t port, | |
| void * DataLocation); | | void * data_location); | |
| | | | |
| /** Function pointer that initialises a plugin instance and activate
s | | /** Function pointer that initialises a plugin instance and activate
s | |
| * it for use. | | * it for use. | |
| * | | * | |
| * This is separated from instantiate() to aid real-time support and
so | | * This is separated from instantiate() to aid real-time support and
so | |
| * that hosts can reinitialise a plugin instance by calling deactiva
te() | | * that hosts can reinitialise a plugin instance by calling deactiva
te() | |
| * and then activate(). In this case the plugin instance must reset
all | | * and then activate(). In this case the plugin instance must reset
all | |
| * state information dependent on the history of the plugin instance | | * state information dependent on the history of the plugin instance | |
| * except for any data locations provided by connect_port(). If ther
e | | * except for any data locations provided by connect_port(). If ther
e | |
| * is nothing for activate() to do then the plugin writer may provid
e | | * is nothing for activate() to do then the plugin writer may provid
e | |
| | | | |
| skipping to change at line 252 | | skipping to change at line 254 | |
| * is called for the first time. This call SHOULD be made as close | | * 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 | | * to the run() call as possible and indicates to real-time plugins | |
| * that they are now live, however plugins MUST NOT rely on a prompt | | * that they are now live, however plugins MUST NOT rely on a prompt | |
| * call to run() after activate(). activate() may not be called aga
in | | * call to run() after activate(). activate() may not be called aga
in | |
| * unless deactivate() is called first (after which activate() may b
e | | * unless deactivate() is called first (after which activate() may b
e | |
| * called again, followed by deactivate, etc. etc.). If a host call
s | | * called again, followed by deactivate, etc. etc.). If a host call
s | |
| * activate, it MUST call deactivate at some point in the future. | | * activate, it MUST call deactivate at some point in the future. | |
| * | | * | |
| * Note that connect_port() may be called before or after a call to | | * Note that connect_port() may be called before or after a call to | |
| * activate(). */ | | * activate(). */ | |
|
| void (*activate)(LV2_Handle Instance); | | 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 particu
lar | | * Two parameters are required: the first is a handle to the particu
lar | |
| * instance to be run and the second indicates the block size (in | | * instance to be run and the second indicates the block size (in | |
| * samples) for which the plugin instance may run. | | * samples) for which the plugin instance may run. | |
| * | | * | |
| * Note that if an activate() function exists then it must be called | | * Note that if an activate() function exists then it must be called | |
| * before run(). If deactivate() is called for a plugin instance the
n | | * before run(). If deactivate() is called for a plugin instance the
n | |
| * the plugin instance may not be reused until activate() has been | | * the plugin instance may not be reused until activate() has been | |
| * called again. | | * called again. | |
| * | | * | |
|
| * If the plugin has the property lv2:hardRTCapable then there are | | * If the plugin has the feature lv2:hardRTCapable then there are | |
| * various things that the plugin MUST NOT do within the run() | | * various things that the plugin MUST NOT do within the run() | |
| * function (see lv2.ttl). */ | | * function (see lv2.ttl). */ | |
|
| void (*run)(LV2_Handle Instance, | | void (*run)(LV2_Handle instance, | |
| uint32_t SampleCount); | | 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 ru
n() | | * Hosts must deactivate all activated units after they have been ru
n() | |
| * for the last time. This call SHOULD be made as close to the last | | * for the last time. This call SHOULD be made as close to the last | |
| * run() call as possible and indicates to real-time plugins that | | * run() call as possible and indicates to real-time plugins that | |
| * they are no longer live, however plugins MUST NOT rely on prompt | | * they are no longer live, however plugins MUST NOT rely on prompt | |
| * deactivation. Note that connect_port() may be called before or | | * deactivation. Note that connect_port() may be called before or | |
| * after a call to deactivate(). | | * after a call to deactivate(). | |
| * | | * | |
| * Note that deactivation is not similar to pausing as the plugin | | * Note that deactivation is not similar to pausing as the plugin | |
| * instance will be reinitialised when activate() is called to reuse
it. | | * instance will be reinitialised when activate() is called to reuse
it. | |
| * Hosts MUST NOT call deactivate() unless activate() was previously | | * Hosts MUST NOT call deactivate() unless activate() was previously | |
| * called. */ | | * called. */ | |
|
| void (*deactivate)(LV2_Handle Instance); | | void (*deactivate)(LV2_Handle instance); | |
| | | | |
| /** This is the counterpart to instantiate() (see above). Once an i
nstance | | /** This is the counterpart to instantiate() (see above). Once an i
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 correspondi
ng | | * If activate() was called for a plugin instance then a correspondi
ng | |
| * call to deactivate() MUST be made before cleanup() is called. | | * call to deactivate() MUST be made before cleanup() is called. | |
| * Hosts MUST NOT call cleanup() unless instantiate() was previously | | * Hosts MUST NOT call cleanup() unless instantiate() was previously | |
| * called. */ | | * called. */ | |
|
| void (*cleanup)(LV2_Handle Instance); | | void (*cleanup)(LV2_Handle instance); | |
| | | | |
| /** Function pointer that can be used to return additional instance
data for | | /** Function pointer that can be used to return additional instance
data for | |
| * a plugin defined by some extenion (e.g. a struct containing addit
ional | | * a plugin defined by some extenion (e.g. a struct containing addit
ional | |
| * function pointers). | | * function pointers). | |
| * | | * | |
| * The actual type and meaning of the returned object MUST be specif
ied | | * The actual type and meaning of the returned object MUST be specif
ied | |
| * precisely by the extension if it defines any extra data. If a pa
rticular | | * precisely by the extension if it defines any extra data. If a pa
rticular | |
| * extension does not define extra instance data, this function MUST
return | | * extension does not define extra instance data, this function MUST
return | |
| * NULL for that extension's URI. If a plugin does not support any | | * NULL for that extension's URI. If a plugin does not support any | |
| * extensions that define extra instance data, this function pointer
may be | | * extensions that define extra instance data, this function pointer
may be | |
| * set to NULL rather than providing an empty function. | | * set to NULL rather than providing an empty function. | |
| * | | * | |
| * The only parameter is the URI of the extension. The plugin MUST r
eturn | | * The only parameter is the URI of the extension. The plugin MUST r
eturn | |
| * NULL if it does not support the extension, but hosts SHOULD NOT u
se this | | * NULL if it does not support the extension, but hosts SHOULD NOT u
se this | |
| * as a discovery method (e.g. hosts should only call this function
for | | * as a discovery method (e.g. hosts should only call this function
for | |
| * extensions known to be supported by the plugin from the data file
). | | * extensions known to be supported by the plugin from the data file
). | |
| * | | * | |
|
| * NOTE: It is highly recommended that this function returns a struc | | * The host is never responsible for freeing the returned value. | |
| t, and | | * | |
| * NOT a direct function pointer. Standard C++ (for real reasons) d | | * NOTE: This function should return a struct (likely containing fun | |
| oes not | | ction | |
| | | * pointers) and NOT a direct function pointer. Standard C and C++ | |
| | | do not | |
| * allow type casts from void* to a function pointer type. To provi
de | | * allow type casts from void* to a function pointer type. To provi
de | |
| * additional functions a struct should be returned containing the e
xtra | | * additional functions a struct should be returned containing the e
xtra | |
|
| * function pointers (which is valid standard C++, and a much better | | * function pointers (which is valid standard code, and a much bette | |
| idea | | r idea | |
| * for extensibility anyway). | | * for extensibility anyway). */ | |
| */ | | const void* (*extension_data)(const char * uri); | |
| 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 | |
| | | | |
| skipping to change at line 353 | | skipping to change at line 356 | |
| * | | * | |
| * A host will find the plugin shared object file by one means or another, | | * A host will find the plugin shared object file by one means or another, | |
| * find the lv2_descriptor() function, call it, and proceed from there. | | * find the lv2_descriptor() function, call it, and proceed from there. | |
| * | | * | |
| * Plugin types are accessed by index (not ID) using values from 0 | | * Plugin types are accessed by index (not ID) using values from 0 | |
| * upwards. Out of range indexes must result in this function returning | | * upwards. Out of range indexes must result in this function returning | |
| * NULL, so the plugin count can be determined by checking for the least | | * NULL, so the plugin count can be determined by checking for the least | |
| * index that results in NULL being returned. Index has no meaning, | | * index that results in NULL being returned. Index has no meaning, | |
| * hosts MUST NOT depend on it remaining constant (ie when serialising) | | * hosts MUST NOT depend on it remaining constant (ie when serialising) | |
| * in any way. */ | | * in any way. */ | |
|
| const LV2_Descriptor * lv2_descriptor(uint32_t Index); | | const LV2_Descriptor * lv2_descriptor(uint32_t index); | |
| | | | |
| /** Datatype corresponding to the lv2_descriptor() function. */ | | /** Datatype corresponding to the lv2_descriptor() function. */ | |
| typedef const LV2_Descriptor * | | typedef const LV2_Descriptor * | |
|
| (*LV2_Descriptor_Function)(uint32_t Index); | | (*LV2_Descriptor_Function)(uint32_t index); | |
| | | | |
| /* ******************************************************************** */ | | /* ******************************************************************** */ | |
| | | | |
| /* Put this (LV2_SYMBOL_EXPORT) before any functions that are to be loaded | | /* Put this (LV2_SYMBOL_EXPORT) before any functions that are to be loaded | |
| * by the host as a symbol from the dynamic library. | | * by the host as a symbol from the dynamic library. | |
| */ | | */ | |
| #ifdef WIN32 | | #ifdef WIN32 | |
| #define LV2_SYMBOL_EXPORT __declspec(dllexport) | | #define LV2_SYMBOL_EXPORT __declspec(dllexport) | |
| #else | | #else | |
| #define LV2_SYMBOL_EXPORT | | #define LV2_SYMBOL_EXPORT | |
| | | | |
End of changes. 26 change blocks. |
| 60 lines changed or deleted | | 61 lines changed or added | |
|
| plugin.h | | plugin.h | |
| | | | |
| skipping to change at line 147 | | skipping to change at line 147 | |
| */ | | */ | |
| SLV2PluginClass | | SLV2PluginClass | |
| slv2_plugin_get_class(SLV2Plugin plugin); | | slv2_plugin_get_class(SLV2Plugin plugin); | |
| | | | |
| /** Get a value associated with the plugin in a plugin's data files. | | /** Get a value associated with the plugin in a plugin's data files. | |
| * | | * | |
| * Returns the ?object of all triples found of the form: | | * Returns the ?object of all triples found of the form: | |
| * | | * | |
| * <code><plugin-uri> predicate ?object</code> | | * <code><plugin-uri> predicate ?object</code> | |
| * | | * | |
|
| * May return NULL if the property was not found, or if object is not | | * May return NULL if the property was not found, or if object(s) is not | |
| * sensibly represented as an SLV2Values (e.g. blank nodes). | | * sensibly represented as an SLV2Values (e.g. blank nodes). | |
| * | | * | |
| * Return value must be freed by caller with slv2_values_free. | | * Return value must be freed by caller with slv2_values_free. | |
| * | | * | |
| * \a predicate must be either a URI or a QName. | | * \a predicate must be either a URI or a QName. | |
| * See SLV2URIType documentation for examples. | | * See SLV2URIType documentation for examples. | |
| * | | * | |
| * Time = Query | | * Time = Query | |
| */ | | */ | |
| SLV2Values | | SLV2Values | |
| | | | |
| skipping to change at line 187 | | skipping to change at line 187 | |
| * Return value must be freed by caller with slv2_values_free. | | * Return value must be freed by caller with slv2_values_free. | |
| * | | * | |
| * Time = Query | | * Time = Query | |
| */ | | */ | |
| SLV2Values | | SLV2Values | |
| slv2_plugin_get_value_for_subject(SLV2Plugin p, | | slv2_plugin_get_value_for_subject(SLV2Plugin p, | |
| SLV2Value subject, | | SLV2Value subject, | |
| SLV2URIType predicate_type, | | SLV2URIType predicate_type, | |
| const char* predicate); | | const char* predicate); | |
| | | | |
|
| /** Get the LV2 Properties of a plugin. | | /** Get the LV2 Features supported (required or optionally) by a plugin. | |
| * | | * | |
|
| * LV2 Properties are mandatory. Hosts MUST NOT use a plugin if they do no | | * A feature is "supported" by a plugin if it is required OR optional. | |
| t | | | |
| * understand all the LV2 Properties associated with that plugin (if this i | | | |
| s | | | |
| * not what you want, see slv2_plugin_get_hints). | | | |
| * | | * | |
|
| * Return value must be freed by caller with slv2_value_free. | | * Since required features have special rules the host must obey, this func | |
| | | tion | |
| | | * probably shouldn't be used by normal hosts. Using slv2_plugin_get_optio | |
| | | nal_features | |
| | | * and slv2_plugin_get_required_features separately is best in most cases. | |
| | | * | |
| | | * Returned value must be freed by caller with slv2_values_free. | |
| * | | * | |
| * Time = Query | | * Time = Query | |
| */ | | */ | |
| SLV2Values | | SLV2Values | |
|
| slv2_plugin_get_properties(SLV2Plugin p); | | slv2_plugin_get_supported_features(SLV2Plugin p); | |
| | | | |
|
| /** Get the LV2 Hints of a plugin. | | /** Get the LV2 Features required by a plugin. | |
| * | | * | |
|
| * LV2 Hints are suggestions that may be useful for a host. LV2 Hints may | | * If a feature is required by a plugin, hosts MUST NOT use the plugin if t | |
| be | | hey do not | |
| * ignored and the plugin will still function correctly. | | * understand (or are unable to support) that feature. | |
| * | | * | |
|
| * Return value must be freed by caller with slv2_value_free. | | * All values returned here MUST be passed to the plugin's instantiate meth | |
| | | od | |
| | | * (along with data, if necessary, as defined by the feature specification) | |
| | | * or plugin instantiation will fail. | |
| | | * | |
| | | * Return value must be freed by caller with slv2_values_free. | |
| * | | * | |
| * Time = Query | | * Time = Query | |
| */ | | */ | |
| SLV2Values | | SLV2Values | |
|
| slv2_plugin_get_hints(SLV2Plugin p); | | slv2_plugin_get_required_features(SLV2Plugin p); | |
| | | | |
| | | /** Get the LV2 Features optionally supported by a plugin. | |
| | | * | |
| | | * Hosts MAY ignore optional plugin features for whatever reasons. Plugins | |
| | | * MUST operate (at least somewhat) if they are instantiated without being | |
| | | * passed optional features. | |
| | | * | |
| | | * Return value must be freed by caller with slv2_values_free. | |
| | | * | |
| | | * Time = Query | |
| | | */ | |
| | | SLV2Values | |
| | | slv2_plugin_get_optional_features(SLV2Plugin p); | |
| | | | |
| /** Get the number of ports on this plugin. | | /** Get the number of ports on this plugin. | |
| * | | * | |
| * Time = O(1) | | * Time = O(1) | |
| */ | | */ | |
| uint32_t | | uint32_t | |
| slv2_plugin_get_num_ports(SLV2Plugin p); | | slv2_plugin_get_num_ports(SLV2Plugin p); | |
| | | | |
| /** Return whether or not the plugin introduces (and reports) latency. | | /** Return whether or not the plugin introduces (and reports) latency. | |
| * | | * | |
| * The index of the latency port can be found with slv2_plugin_get_latency_
port | | * The index of the latency port can be found with slv2_plugin_get_latency_
port | |
| * ONLY if this function returns true. | | * ONLY if this function returns true. | |
| * | | * | |
| * Time = Query | | * Time = Query | |
| */ | | */ | |
| bool | | bool | |
| slv2_plugin_has_latency(SLV2Plugin p); | | slv2_plugin_has_latency(SLV2Plugin p); | |
| | | | |
|
| /** Return the index of the plugin's latency port, or the empty string if t | | /** Return the index of the plugin's latency port. | |
| he | | | |
| * plugin has no latency. | | | |
| * | | * | |
| * It is a fatal error to call this on a plugin without checking if the por
t | | * It is a fatal error to call this on a plugin without checking if the por
t | |
| * exists by first calling slv2_plugin_has_latency. | | * exists by first calling slv2_plugin_has_latency. | |
| * | | * | |
| * Any plugin that introduces unwanted latency that should be compensated f
or | | * Any plugin that introduces unwanted latency that should be compensated f
or | |
| * (by hosts with the ability/need) MUST provide this port, which is a cont
rol | | * (by hosts with the ability/need) MUST provide this port, which is a cont
rol | |
| * rate output port that reports the latency for each cycle in frames. | | * rate output port that reports the latency for each cycle in frames. | |
| * | | * | |
| * Time = Query | | * Time = Query | |
| */ | | */ | |
| uint32_t | | uint32_t | |
| slv2_plugin_get_latency_port(SLV2Plugin p); | | slv2_plugin_get_latency_port(SLV2Plugin p); | |
| | | | |
|
| /** Get a plugin's supported host features / extensions. | | | |
| * | | | |
| * This returns a list of all supported features (both required and optiona | | | |
| l). | | | |
| * | | | |
| * Time = Query | | | |
| */ | | | |
| SLV2Values | | | |
| slv2_plugin_get_supported_features(SLV2Plugin p); | | | |
| | | | |
| /** Get a plugin's requires host features / extensions. | | | |
| * | | | |
| * All feature URI's returned by this call MUST be passed to the plugin's | | | |
| * instantiate method for the plugin to instantiate successfully. | | | |
| * | | | |
| * Time = Query | | | |
| */ | | | |
| SLV2Values | | | |
| slv2_plugin_get_required_features(SLV2Plugin p); | | | |
| | | | |
| /** Get a plugin's optional host features / extensions. | | | |
| * | | | |
| * If the feature URI's returned by this method are passed to the plugin's | | | |
| * instantiate method, those features will be used by the function, otherwi | | | |
| se | | | |
| * the plugin will act as it would if it did not support that feature at al | | | |
| l. | | | |
| * | | | |
| * Time = Query | | | |
| */ | | | |
| SLV2Values | | | |
| slv2_plugin_get_optional_features(SLV2Plugin p); | | | |
| | | | |
| /** Query a plugin for a single variable. | | /** Query a plugin for a single variable. | |
| * | | * | |
| * \param plugin The plugin to query. | | * \param plugin The plugin to query. | |
| * \param sparql_str A SPARQL SELECT query. | | * \param sparql_str A SPARQL SELECT query. | |
| * \param variable The index of the variable to return results for | | * \param variable The index of the variable to return results for | |
| * (i.e. with "<code>SELECT ?foo ?bar</code>" foo is 0, and bar is 1). | | * (i.e. with "<code>SELECT ?foo ?bar</code>" foo is 0, and bar is 1). | |
| * \return All matches for \a variable. | | * \return All matches for \a variable. | |
| * | | * | |
| * Time = Query | | * Time = Query | |
| */ | | */ | |
| | | | |
| skipping to change at line 322 | | skipping to change at line 310 | |
| * | | * | |
| * To perform multiple calls on a port, the returned value should | | * To perform multiple calls on a port, the returned value should | |
| * be cached and used repeatedly. | | * be cached and used repeatedly. | |
| * | | * | |
| * Time = O(n) | | * Time = O(n) | |
| */ | | */ | |
| SLV2Port | | SLV2Port | |
| slv2_plugin_get_port_by_symbol(SLV2Plugin plugin, | | slv2_plugin_get_port_by_symbol(SLV2Plugin plugin, | |
| const char* symbol); | | const char* symbol); | |
| | | | |
|
| /** Get a list of all GUIs available for this plugin. | | /** Get a list of all UIs available for this plugin. | |
| * | | * | |
|
| * Note this returns the URI of the GUI, and not the path/URI to its shared | | * Note this returns the URI of the UI, and not the path/URI to its shared | |
| * library, use slv2_plugin_gui_get_library_uri with the values returned | | * library, use slv2_ui_get_library_uri with the values returned | |
| * here for that. | | * here for that. | |
| * | | * | |
|
| * \param plugin The plugin to get the GUIs for. | | * Returned value must be freed by caller using slv2_uis_free. | |
| * | | | |
| * Time = Query | | | |
| */ | | | |
| SLV2Values | | | |
| slv2_plugin_get_guis(SLV2Plugin plugin); | | | |
| | | | |
| /** Get the URI for a GUI library. | | | |
| * | | * | |
|
| * \param plugin The plugin that the GUI is for. | | * \param plugin The plugin to get the UIs for. | |
| * \param gui A GUI identifier as returned by slv2_plugin_get_guis() (wi | | | |
| th type SLV2_VALUE_GUI). | | | |
| * | | * | |
| * Time = Query | | * Time = Query | |
| */ | | */ | |
|
| SLV2Value | | SLV2UIs | |
| slv2_plugin_get_gui_library_uri(SLV2Plugin plugin, | | slv2_plugin_get_uis(SLV2Plugin plugin); | |
| SLV2Value gui); | | | |
| | | | |
| /** @} */ | | /** @} */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* __SLV2_PLUGIN_H__ */ | | #endif /* __SLV2_PLUGIN_H__ */ | |
| | | | |
End of changes. 16 change blocks. |
| 68 lines changed or deleted | | 43 lines changed or added | |
|