lv2_ui.h   lv2_ui.h 
/************************************************************************ /************************************************************************
* *
* In-process UI extension for LV2 * In-process UI extension for LV2
* *
* Copyright (C) 2006-2007 Lars Luthman <lars.luthman@gmail.com> * Copyright (C) 2006-2008 Lars Luthman <lars.luthman@gmail.com>
* *
* Based on lv2.h, which was * Based on lv2.h, which was
* *
* 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 Steve Harris, Dave Robillard. * Copyright (C) 2006 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,
skipping to change at line 36 skipping to change at line 36
* USA. * USA.
* *
***********************************************************************/ ***********************************************************************/
/** @file /** @file
This extension defines an interface that can be used in LV2 plugins and This extension defines an interface that can be used in LV2 plugins and
hosts to create UIs for plugins. The UIs are plugins that reside in hosts to create UIs for plugins. The UIs are plugins that reside in
shared object files in an LV2 bundle and are referenced in the RDF data shared object files in an LV2 bundle and are referenced in the RDF data
using the triples (Turtle shown) using the triples (Turtle shown)
<pre> <pre>
@@prefix uiext: <http://ll-plugins.nongnu.org/lv2/ext/ui#> . @@prefix uiext: <http://lv2plug.in/ns/extensions/ui#> .
<http://my.plugin> uiext:ui <http://my.pluginui> . <http://my.plugin> uiext:ui <http://my.pluginui> .
<http://my.plugin> a uiext:GtkUI . <http://my.plugin> a uiext:GtkUI .
<http://my.pluginui> uiext:binary <myui.so> . <http://my.pluginui> uiext:binary <myui.so> .
</pre> </pre>
where <http://my.plugin> is the URI of the plugin, <http://my.pluginui> is where <http://my.plugin> is the URI of the plugin, <http://my.pluginui> is
the URI of the plugin UI and <myui.so> is the relative URI to the share d the URI of the plugin UI and <myui.so> is the relative URI to the share d
object file. While it is possible to have the plugin UI and the plugin in object file. While it is possible to have the plugin UI and the plugin in
the same shared object file it is probably a good idea to keep them the same shared object file it is probably a good idea to keep them
separate so that hosts that don't want UIs don't have to load the UI co de. separate so that hosts that don't want UIs don't have to load the UI co de.
A UI MUST specify its class in the RDF data. In this case the class is A UI MUST specify its class in the RDF data, in this case uiext:GtkUI.
uiext:GtkUI, which is the only class defined by this extension. The
class defines what type the UI is, e.g. what graphics toolkit it uses.
There are no UI classes defined in this extension, those are specified
separately (and anyone can define their own).
(Note: the prefix above is used throughout this file for the same URI) (Note: the prefix above is used throughout this file for the same URI)
It's entirely possible to have multiple UIs for the same plugin, or to have It's entirely possible to have multiple UIs for the same plugin, or to have
the UI for a plugin in a different bundle from the actual plugin - this the UI for a plugin in a different bundle from the actual plugin - this
way people other than the plugin author can write plugin UIs independen tly way people other than the plugin author can write plugin UIs independen tly
without editing the original plugin bundle. without editing the original plugin bundle.
Note that the process that loads the shared object file containing the UI Note that the process that loads the shared object file containing the UI
code and the process that loads the shared object file containing the code and the process that loads the shared object file containing the
skipping to change at line 80 skipping to change at line 82
"features" that you declare in the RDF data for the UI as "features" that you declare in the RDF data for the UI as
<pre> <pre>
<http://my.pluginui> uiext:requiredFeature <http://my.feature> . <http://my.pluginui> uiext:requiredFeature <http://my.feature> .
<http://my.pluginui> uiext:optionalFeature <http://my.feature> . <http://my.pluginui> uiext:optionalFeature <http://my.feature> .
</pre> </pre>
These predicates have the same semantics as lv2:requiredFeature and These predicates have the same semantics as lv2:requiredFeature and
lv2:optionalFeature - if a UI is declaring a feature as required, the lv2:optionalFeature - if a UI is declaring a feature as required, the
host is NOT allowed to load it unless it supports that feature, and if it host is NOT allowed to load it unless it supports that feature, and if it
does support a feature (required or optional) it MUST pass that feature 's does support a feature (required or optional) it MUST pass that feature 's
URI and any additional data (specified by the meta-extension that defin es URI and any additional data (specified by the meta-extension that defin es
the feature) to the UI's instantiate() function. the feature) in a LV2_Feature struct (as defined in lv2.h) to the UI's
instantiate() function.
These features may be used to specify how to pass data between the UI These features may be used to specify how to pass data between the UI
and the plugin port buffers - see LV2UI_Write_Function for details. and the plugin port buffers - see LV2UI_Write_Function for details.
There are four features defined in this extension that hosts may want t
o
implement:
<pre>
uiext:makeResident
</pre>
If this feature is required by a UI the host MUST NEVER unload the shar
ed
library containing the UI implementation during the lifetime of the hos
t
process (e.g. never calling dlclose() on Linux). This feature may be
needed by e.g. a Gtk UI that registers its own Glib types using
g_type_register_static() - if it gets unloaded and then loaded again th
e
type registration will break, since there is no way to unregister the
types when the library is unloaded. The data pointer in the LV2_Feature
for this feature should always be set to NULL.
<pre>
uiext:makeSONameResident
</pre>
This feature is ELF specific - it should only be used by UIs that
use the ELF file format for the UI shared object files (e.g. on Linux).
If it is required by an UI the UI should also list a number of SO names
(shared object names) for libraries that the UI shared object
depends on and that may not be unloaded during the lifetime of the host
process, using the predicate @c uiext:residentSONames, like this:
<pre>
<http://my.pluginui> uiext:residentSONames "libgtkmm-2.4.so.1", "libfoo
.so.0"
</pre>
The host MUST then make sure that the shared libraries with the given E
LF
SO names are not unloaded when the plugin UI is, but stay loaded during
the entire lifetime of the host process. On Linux this can be accomplis
hed
by calling dlopen() on the shared library file with that SO name and ne
ver
calling a matching dlclose(). However, if a plugin UI requires the
@c uiext:makeSONameResident feature, it MUST ALWAYS be safe for the hos
t to
just never unload the shared object containing the UI implementation, i
.e.
act as if the UI required the @c uiext:makeResident feature instead. Th
us
the host only needs to find the shared library files corresponding to t
he
given SO names if it wants to save RAM by unloading the UI shared objec
t
file when it is no longer needed. The data pointer for the LV2_Feature
for
this feature should always be set to NULL.
<pre>
uiext:noUserResize
</pre>
If an UI requires this feature it indicates that it does not make sense
to let the user resize the main widget, and the host should prevent tha
t.
This feature may not make sense for all UI types. The data pointer for
the
LV2_Feature for this feature should always be set to NULL.
<pre>
uiext:fixedSize
</pre>
If an UI requires this feature it indicates the same thing as
uiext:noUserResize, and additionally it means that the UI will not resi
ze
the main widget on its own - it will always remain the same size (e.g.
a
pixmap based GUI). This feature may not make sense for all UI types.
The data pointer for the LV2_Feature for this feature should always be
set
to NULL.
UIs written to this specification do not need to be threadsafe - the UIs written to this specification do not need to be threadsafe - the
functions defined below may only be called in the same thread as the UI functions defined below may only be called in the same thread as the UI
main loop is running in. main loop is running in.
Note that this UI extension is NOT a lv2:Feature. There is no way for a Note that this UI extension is NOT a lv2:Feature. There is no way for a
plugin to know whether the host that loads it supports UIs or not, and plugin to know whether the host that loads it supports UIs or not, and
the plugin must ALWAYS work without the UI (although it may be rather the plugin must ALWAYS work without the UI (although it may be rather
useless unless it has been configured using the UI in a previous sessio n). useless unless it has been configured using the UI in a previous sessio n).
A UI does not have to be a graphical widget, it could just as well be a A UI does not have to be a graphical widget, it could just as well be a
server listening for OSC input or an interface to some sort of hardware server listening for OSC input or an interface to some sort of hardware
device, depending on the RDF class of the UI. device, depending on the RDF class of the UI.
*/ */
#ifndef LV2_IPUI_H #ifndef LV2_UI_H
#define LV2_IPUI_H #define LV2_UI_H
#include "lv2.h" #include <lv2.h>
#define LV2_UI_URI "http://lv2plug.in/ns/extensions/ui"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** A pointer to some widget or other type of UI handle. /** A pointer to some widget or other type of UI handle.
The actual type is defined by the type URI of the UI, e.g. if The actual type is defined by the type URI of the UI.
"<http://example.org/someui> a uiext:GtkUI", this is a pointer All the functionality provided by this extension is toolkit
to a GtkWidget compatible with GTK+ 2.0 and the UI can expect the GTK+
main loop to be running during the entire lifetime of all instances of
that
UI. All the functionality provided by this extension is toolkit
independent, the host only needs to pass the necessary callbacks and independent, the host only needs to pass the necessary callbacks and
display the widget, if possible. Plugins may have several UIs, in vario us display the widget, if possible. Plugins may have several UIs, in vario us
toolkits, but uiext:GtkUI is the only type that is defined in this toolkits. */
extension. */
typedef void* LV2UI_Widget; typedef void* LV2UI_Widget;
/** A pointer to some host data required to instantiate a UI.
Like the type of the widget, the actual type of this pointer is defined
by
the type URI of the UI. Hosts can use this to pass toolkit specific da
ta
to a UI it needs to instantiate (type map, drawing context, etc). For t
he
uiext:GtkUI type this should be NULL. */
typedef void* LV2UI_Host_Data;
/** This handle indicates a particular instance of a UI. /** This handle indicates a particular instance of a UI.
It is valid to compare this to NULL (0 for C++) but otherwise the It is valid to compare this to NULL (0 for C++) but otherwise the
host MUST not attempt to interpret it. The UI plugin may use it to host MUST not attempt to interpret it. The UI plugin may use it to
reference internal instance data. */ reference internal instance data. */
typedef void* LV2UI_Handle; typedef void* LV2UI_Handle;
/** This handle indicates a particular plugin instance, provided by the hos t. /** This handle indicates a particular plugin instance, provided by the hos t.
It is valid to compare this to NULL (0 for C++) but otherwise the It is valid to compare this to NULL (0 for C++) but otherwise the
UI plugin MUST not attempt to interpret it. The host may use it to UI plugin MUST not attempt to interpret it. The host may use it to
reference internal plugin instance data. */ reference internal plugin instance data. */
typedef void* LV2UI_Controller; typedef void* LV2UI_Controller;
/** This is the type of the host-provided function that the UI can use to /** This is the type of the host-provided function that the UI can use to
send data to a plugin's input ports. The @c buffer parameter must point send data to a plugin's input ports. The @c buffer parameter must point
to a block of data, @c buffer_size bytes large. The contents of this bu ffer to a block of data, @c buffer_size bytes large. The contents of this bu ffer
will depend on the class of the port it's being sent to, and the transf and what the host should do with it depends on the value of the @c form
er at
mechanism specified for that port class. parameter.
Transfer mechanisms are Features and may be defined in meta-extensions. The @c format parameter should either be 0 or a numeric ID for a "Trans
They specify how to translate the data buffers passed to this function fer
to input data for the plugin ports. If a UI wishes to write data to an mechanism". Transfer mechanisms are Features and may be defined in
input port, it must list a transfer mechanism Feature for that port's meta-extensions. They specify how to translate the data buffers passed
class as an optional or required feature (depending on whether the UI to this function to input data for the plugin ports. If a UI wishes to
will work without being able to write to that port or not). The only write data to an input port, it must list a transfer mechanism Feature
exception is ports of the class lv2:ControlPort, for which @c buffer_si for that port's class as an optional or required feature (depending on
ze whether the UI will work without being able to write to that port or no
should always be 4 and the buffer should always contain a single IEEE-7 t).
54 The only exception is when the UI wants to write single float values to
float. input ports of the class lv2:ControlPort, in which case @c buffer_size
should always be 4, the buffer should always contain a single IEEE-754
float, and @c format should be 0.
The numeric IDs for the transfer mechanisms are provided by a
URI-to-integer mapping function provided by the host, using the URI Map
feature <http://lv2plug.in/ns/ext/uri-map> with the map URI
"http://lv2plug.in/ns/extensions/ui". Thus a UI that requires transfer
mechanism features also requires the URI Map feature, but this is
implicit - the UI does not have to list the URI map feature as a requir
ed
or optional feature in it's RDF data.
An UI MUST NOT pass a @c format parameter value (except 0) that has not
been returned by the host-provided URI mapping function for a
host-supported transfer mechanism feature URI.
The UI MUST NOT try to write to a port for which there is no specified The UI MUST NOT try to write to a port for which there is no specified
transfer mechanism, or to an output port. The UI is responsible for transfer mechanism, or to an output port. The UI is responsible for
allocating the buffer and deallocating it after the call. A function allocating the buffer and deallocating it after the call.
pointer of this type will be provided to the UI by the host in the */
instantiate() function. */
typedef void (*LV2UI_Write_Function)(LV2UI_Controller controller, typedef void (*LV2UI_Write_Function)(LV2UI_Controller controller,
uint32_t port_index, uint32_t port_index,
uint32_t buffer_size, uint32_t buffer_size,
uint32_t format,
const void* buffer); const void* buffer);
/** */ /** This struct contains the implementation of an UI. A pointer to an
object of this type is returned by the lv2ui_descriptor() function.
*/
typedef struct _LV2UI_Descriptor { typedef struct _LV2UI_Descriptor {
/** The URI for this UI (not for the plugin it controls). */ /** The URI for this UI (not for the plugin it controls). */
const char* URI; const char* URI;
/** Create a new UI object and return a handle to it. This function works /** Create a new UI object and return a handle to it. This function works
similarly to the instantiate() member in LV2_Descriptor. similarly to the instantiate() member in LV2_Descriptor.
@param descriptor The descriptor for the UI that you want to instanti ate. @param descriptor The descriptor for the UI that you want to instanti ate.
@param plugin_uri The URI of the plugin that this UI will control. @param plugin_uri The URI of the plugin that this UI will control.
@param bundle_path The path to the bundle containing the RDF data fil e @param bundle_path The path to the bundle containing the RDF data fil e
that references this shared object file, including the that references this shared object file, including the
trailing '/'. trailing '/'.
@param write_function A function provided by the host that the UI can @param write_function A function provided by the host that the UI can
use to send data to the plugin's input ports. use to send data to the plugin's input ports.
@param controller A handle for the plugin instance that should be pas sed @param controller A handle for the plugin instance that should be pas sed
as the first parameter of @c write_function. as the first parameter of @c write_function.
@param host_data Data required from the host for instantiation.
The type of this depends on the RDF class of the UI
.
If the UI type does not specify anything to be passe
d
here, the host should pass NULL.
@param widget A pointer to an LV2UI_Widget. The UI will write a @param widget A pointer to an LV2UI_Widget. The UI will write a
widget pointer to this location (what type of widge t widget pointer to this location (what type of widge t
depends on the RDF class of the UI) that will be th e depends on the RDF class of the UI) that will be th e
main UI widget. main UI widget.
@param features An array of LV2_Feature pointers. The host must pas s @param features An array of LV2_Feature pointers. The host must pas s
all feature URIs that it and the plugin supports an d any all feature URIs that it and the UI supports and an y
additional data, just like in the LV2 plugin additional data, just like in the LV2 plugin
instantiate() function. instantiate() function. Note that UI features and p
lugin
features are NOT necessarily the same, they just sha
re
the same data structure - this will probably not be
the
same array as the one the plugin host passes to a
plugin.
*/ */
LV2UI_Handle (*instantiate)(const struct _LV2UI_Descriptor* descriptor, LV2UI_Handle (*instantiate)(const struct _LV2UI_Descriptor* descriptor,
const char* plugin_uri, const char* plugin_uri,
const char* bundle_path, const char* bundle_path,
LV2UI_Write_Function write_functio n, LV2UI_Write_Function write_functio n,
LV2UI_Controller controller, LV2UI_Controller controller,
LV2UI_Host_Data host_data,
LV2UI_Widget* widget, LV2UI_Widget* widget,
const LV2_Feature* const* features); const LV2_Feature* const* features);
/** Destroy the UI object and the associated widget. The host must not tr y /** Destroy the UI object and the associated widget. The host must not tr y
to access the widget after calling this function. to access the widget after calling this function.
*/ */
void (*cleanup)(LV2UI_Handle ui); void (*cleanup)(LV2UI_Handle ui);
/** Tell the UI that something interesting has happened at a plugin port. /** Tell the UI that something interesting has happened at a plugin port.
What is interesting and how it is written to the buffer passed to thi s What is interesting and how it is written to the buffer passed to thi s
function is defined by the specified transfer mechanism for that port function is defined by the @c format parameter, which has the same
class (see LV2UI_Write_Function). The only exception is ports of the meaning as in LV2UI_Write_Function. The only exception is ports of th
e
class lv2:ControlPort, for which this function should be called class lv2:ControlPort, for which this function should be called
when the port value changes (it must not be called for every single when the port value changes (it does not have to be called for every
change if the host's UI thread has problems keeping up with the threa single change if the host's UI thread has problems keeping up with
d the thread the plugin is running in), @c buffer_size should be 4 and
the plugin is running in), @c buffer_size should be 4 and the buffer the
should contain a single IEEE-754 float. buffer should contain a single IEEE-754 float. In this case the @c fo
rmat
parameter should be 0.
By default, the host should only call this function for input ports o f By default, the host should only call this function for input ports o f
the lv2:ControlPort class. However, the default setting can be modifi ed the lv2:ControlPort class. However, the default setting can be modifi ed
by using the following URIs in the UI's RDF data: by using the following URIs in the UI's RDF data:
<pre> <pre>
uiext:portNotification uiext:portNotification
uiext:noPortNotification uiext:noPortNotification
uiext:plugin uiext:plugin
uiext:portIndex uiext:portIndex
</pre> </pre>
skipping to change at line 240 skipping to change at line 308
<code><http://my.pluginui></code> for the plugin with URI <code><http://my.pluginui></code> for the plugin with URI
<code><http://my.plugin></code> to get notified when the value of the <code><http://my.plugin></code> to get notified when the value of the
output control port with index 4 changes, you would use the following output control port with index 4 changes, you would use the following
in the RDF for your UI: in the RDF for your UI:
<pre> <pre>
<http://my.pluginui> uiext:portNotification [ uiext:plugin <http://my .plugin> ; <http://my.pluginui> uiext:portNotification [ uiext:plugin <http://my .plugin> ;
uiext:portIndex 4 ] . uiext:portIndex 4 ] .
</pre> </pre>
and similarly with <code>uiext:noPortNotification</code> if you wante d and similarly with <code>uiext:noPortNotification</code> if you wante d
to prevent notifications for a port for which it would be on by defau lt to prevent notifications for a port for which it would be on by defau lt
otherwise. The UI is not allowed to request notifications for ports otherwise. The UI is not allowed to request notifications for ports o
for which no transfer mechanism is specified, if it does it should be f
considered broken and the host should not load it. types for which no transfer mechanism is specified, if it does it sho
uld
be considered broken and the host should not load it.
The @c buffer is only valid during the time of this function call, so if The @c buffer is only valid during the time of this function call, so if
the UI wants to keep it for later use it has to copy the contents to an the UI wants to keep it for later use it has to copy the contents to an
internal buffer. internal buffer.
This member may be set to NULL if the UI is not interested in any This member may be set to NULL if the UI is not interested in any
port events. port events.
*/ */
void (*port_event)(LV2UI_Handle ui, void (*port_event)(LV2UI_Handle ui,
uint32_t port, uint32_t port_index,
uint32_t buffer_size, uint32_t buffer_size,
uint32_t format,
const void* buffer); const void* buffer);
/** Returns a data structure associated with an extension URI, for exampl e /** Returns a data structure associated with an extension URI, for exampl e
a struct containing additional function pointers. Avoid returning a struct containing additional function pointers. Avoid returning
function pointers directly since standard C++ has no valid way of function pointers directly since standard C++ has no valid way of
casting a void* to a function pointer. This member may be set to NULL casting a void* to a function pointer. This member may be set to NULL
if the UI is not interested in supporting any extensions. This is sim ilar if the UI is not interested in supporting any extensions. This is sim ilar
to the extension_data() member in LV2_Descriptor. to the extension_data() member in LV2_Descriptor.
*/ */
const void* (*extension_data)(const char* uri); const void* (*extension_data)(const char* uri);
skipping to change at line 278 skipping to change at line 347
with the following function prototype within the shared object with the following function prototype within the shared object
file. This function will have C-style linkage (if you are using file. This function will have C-style linkage (if you are using
C++ this is taken care of by the 'extern "C"' clause at the top of C++ this is taken care of by the 'extern "C"' clause at the top of
the file). This function will be accessed by the UI host using the the file). This function will be accessed by the UI host using the
@c dlsym() function and called to get a LV2UI_UIDescriptor for the @c dlsym() function and called to get a LV2UI_UIDescriptor for the
wanted plugin. wanted plugin.
Just like lv2_descriptor(), this function takes an index parameter. The Just like lv2_descriptor(), this function takes an index parameter. The
index should only be used for enumeration and not as any sort of ID num ber - index should only be used for enumeration and not as any sort of ID num ber -
the host should just iterate from 0 and upwards until the function retu rns the host should just iterate from 0 and upwards until the function retu rns
NULL, or a descriptor with an URI matching the one the host is looking NULL or a descriptor with an URI matching the one the host is looking f
for or.
is returned.
*/ */
const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index); const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index);
/** This is the type of the lv2ui_descriptor() function. */ /** This is the type of the lv2ui_descriptor() function. */
typedef const LV2UI_Descriptor* (*LV2UI_DescriptorFunction)(uint32_t index) ; typedef const LV2UI_Descriptor* (*LV2UI_DescriptorFunction)(uint32_t index) ;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
 End of changes. 25 change blocks. 
67 lines changed or deleted 157 lines changed or added


 pluginclass.h   pluginclass.h 
skipping to change at line 39 skipping to change at line 39
* @{ * @{
*/ */
/** Get the URI of this class' superclass. /** Get the URI of this class' superclass.
* *
* Returned value is owned by \a plugin_class and must not be freed by call er. * Returned value is owned by \a plugin_class and must not be freed by call er.
* Returned value may be NULL, if class has no parent. * Returned value may be NULL, if class has no parent.
* *
* Time = O(1) * Time = O(1)
*/ */
const char* slv2_plugin_class_get_parent_uri(SLV2PluginClass plugin_class); SLV2Value slv2_plugin_class_get_parent_uri(SLV2PluginClass plugin_class);
/** Get the URI of this plugin class. /** Get the URI of this plugin class.
* *
* Returned value is owned by \a plugin_class and must not be freed by call er. * Returned value is owned by \a plugin_class and must not be freed by call er.
* *
* Time = O(1) * Time = O(1)
*/ */
const char* slv2_plugin_class_get_uri(SLV2PluginClass plugin_class); SLV2Value slv2_plugin_class_get_uri(SLV2PluginClass plugin_class);
/** Get the label of this plugin class, ie "Oscillators". /** Get the label of this plugin class, ie "Oscillators".
* *
* Returned value is owned by \a plugin_class and must not be freed by call er. * Returned value is owned by \a plugin_class and must not be freed by call er.
* *
* Time = O(1) * Time = O(1)
*/ */
const char* slv2_plugin_class_get_label(SLV2PluginClass plugin_class); SLV2Value slv2_plugin_class_get_label(SLV2PluginClass plugin_class);
/** Get the subclasses of this plugin class. /** Get the subclasses of this plugin class.
* *
* Returned value must be freed by caller with slv2_plugin_classes_free. * Returned value must be freed by caller with slv2_plugin_classes_free.
* *
* Time = O(nclasses) * Time = O(nclasses)
*/ */
SLV2PluginClasses SLV2PluginClasses
slv2_plugin_class_get_children(SLV2PluginClass plugin_class); slv2_plugin_class_get_children(SLV2PluginClass plugin_class);
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 pluginclasses.h   pluginclasses.h 
skipping to change at line 32 skipping to change at line 32
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <slv2/pluginclass.h> #include <slv2/pluginclass.h>
/** \addtogroup slv2_collections /** \addtogroup slv2_collections
* @{ * @{
*/ */
/** Get the number of plugins in the list. /** Get the number of plugins in the collection.
*/ */
unsigned unsigned
slv2_plugin_classes_size(SLV2PluginClasses list); slv2_plugin_classes_size(SLV2PluginClasses classes);
/** Get a plugin class from the list by URI. /** Get a plugin class from the collection by URI.
* *
* Return value is shared (stored in \a list) and must not be freed or * Return value is shared (stored in \a classes) and must not be freed or
* modified by the caller in any way. * modified by the caller in any way.
* *
* Time = O(log2(n)) * Time = O(log2(n))
* *
* \return NULL if plugin with \a url not found in \a list. * \return NULL if plugin with \a url not found in \a classes.
*/ */
SLV2PluginClass SLV2PluginClass
slv2_plugin_classes_get_by_uri(SLV2PluginClasses list, slv2_plugin_classes_get_by_uri(SLV2PluginClasses classes,
const char* uri); SLV2Value uri);
/** Get a plugin from the list by index. /** Get a plugin from the collection by index.
* *
* \a index has no significance other than as an index into this list. * \a index has no significance other than as an index into \a classes.
* Any \a index not less than slv2_plugin_classes_get_length(list) will ret * Any \a index not less than slv2_plugin_classes_get_length(classes) will
urn NULL, return NULL,
* so all plugin_classes in a list can be enumerated by repeated calls * so all plugin_classes in a classes can be enumerated by repeated calls
* to this function starting with \a index = 0. * to this function starting with \a index = 0.
* *
* Time = O(1) * Time = O(1)
* *
* \return NULL if \a index out of range. * \return NULL if \a index out of range.
*/ */
SLV2PluginClass SLV2PluginClass
slv2_plugin_classes_get_at(SLV2PluginClasses list, slv2_plugin_classes_get_at(SLV2PluginClasses classes,
unsigned index); unsigned index);
/** @} */ /** @} */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __SLV2_PLUGIN_CLASSES_H__ */ #endif /* __SLV2_PLUGIN_CLASSES_H__ */
 End of changes. 9 change blocks. 
13 lines changed or deleted 13 lines changed or added


 plugininstance.h   plugininstance.h 
skipping to change at line 33 skipping to change at line 33
extern "C" { extern "C" {
#endif #endif
#include <assert.h> #include <assert.h>
#include <lv2.h> #include <lv2.h>
#include <slv2/plugin.h> #include <slv2/plugin.h>
#include <slv2/port.h> #include <slv2/port.h>
typedef struct _InstanceImpl* SLV2InstanceImpl; typedef struct _InstanceImpl* SLV2InstanceImpl;
/** \cond IGNORE */
/* Instance of a plugin. /* Instance of a plugin.
* *
* The LV2 descriptor and handle of this are exposed to allow inlining of * The LV2 descriptor and handle of this are exposed to allow inlining of
* performance critical functions like slv2_instance_run (which are exposed * performance critical functions like slv2_instance_run (which are exposed
* in lv2.h anyway). This is for performance only, this struct is not * in lv2.h anyway). This is for performance only, this struct is not
* documented and should not be used directly. The remaining implementatio n * documented and should not be used directly. The remaining implementatio n
* details are in the opaque pimpl member. * details are in the opaque pimpl member.
*/ */
typedef struct _Instance { typedef struct _Instance {
const LV2_Descriptor* lv2_descriptor; const LV2_Descriptor* lv2_descriptor;
LV2_Handle lv2_handle; LV2_Handle lv2_handle;
SLV2InstanceImpl pimpl; ///< Private implementation SLV2InstanceImpl pimpl; ///< Private implementation
}* SLV2Instance; }* SLV2Instance;
/** \endcond */
/** \defgroup slv2_library Plugin library access /** \defgroup slv2_library Plugin library access
* *
* An SLV2Instance is an instantiated SLV2Plugin (ie a loaded dynamic * An SLV2Instance is an instantiated SLV2Plugin (ie a loaded dynamic
* library). These functions interact with the binary library code only, * library). These functions interact with the binary library code only,
* they do not read data files in any way. * they do not read data files in any way.
* *
* @{ * @{
*/ */
/** Instantiate a plugin. /** Instantiate a plugin.
skipping to change at line 145 skipping to change at line 149
* guaranteed not to block. * guaranteed not to block.
*/ */
static inline void static inline void
slv2_instance_run(SLV2Instance instance, slv2_instance_run(SLV2Instance instance,
uint32_t sample_count) uint32_t sample_count)
{ {
assert(instance); assert(instance);
assert(instance->lv2_descriptor); assert(instance->lv2_descriptor);
assert(instance->lv2_handle); assert(instance->lv2_handle);
if (instance->lv2_descriptor->run) /*if (instance->lv2_descriptor->run)*/
instance->lv2_descriptor->run(instance->lv2_handle, sample_c ount); instance->lv2_descriptor->run(instance->lv2_handle, sample_c ount);
} }
/** Deactivate a plugin instance. /** Deactivate a plugin instance.
* *
* Note that to run the plugin after this you must activate it, which will * Note that to run the plugin after this you must activate it, which will
* reset all state information (except port connections). * reset all state information (except port connections).
*/ */
static inline void static inline void
slv2_instance_deactivate(SLV2Instance instance) slv2_instance_deactivate(SLV2Instance instance)
 End of changes. 3 change blocks. 
1 lines changed or deleted 5 lines changed or added


 plugins.h   plugins.h 
skipping to change at line 33 skipping to change at line 33
extern "C" { extern "C" {
#endif #endif
#include <slv2/types.h> #include <slv2/types.h>
#include <slv2/plugin.h> #include <slv2/plugin.h>
/** \addtogroup slv2_collections /** \addtogroup slv2_collections
* @{ * @{
*/ */
/** Free a plugin list. /** Free a plugin plugins.
* *
* Freeing a plugin list does not destroy the plugins it contains (plugins * Freeing a plugin collection does not destroy the plugins it contains
* are owned by the world). \a list is invalid after this call. * (plugins are owned by the world). \a plugins is invalid after this call.
*/ */
void void
slv2_plugins_free(SLV2World world, slv2_plugins_free(SLV2World world,
SLV2Plugins list); SLV2Plugins plugins);
/** Get the number of plugins in the list. /** Get the number of plugins in the collection.
*/ */
unsigned unsigned
slv2_plugins_size(SLV2Plugins list); slv2_plugins_size(SLV2Plugins plugins);
/** Get a plugin from the list by URI. /** Get a plugin from the collection by URI.
* *
* Return value is shared (stored in \a list) and must not be freed or * Return value is shared (stored in \a plugins) and must not be freed or
* modified by the caller in any way. * modified by the caller in any way.
* *
* Time = O(log2(n)) * Time = O(log2(n))
* *
* \return NULL if plugin with \a url not found in \a list. * \return NULL if plugin with \a url not found in \a plugins.
*/ */
SLV2Plugin SLV2Plugin
slv2_plugins_get_by_uri(SLV2Plugins list, slv2_plugins_get_by_uri(SLV2Plugins plugins,
const char* uri); SLV2Value uri);
/** Get a plugin from the list by index. /** Get a plugin from the plugins by index.
* *
* \a index has no significance other than as an index into this list. * \a index has no significance other than as an index into this plugins.
* Any \a index not less than slv2_list_get_length(list) will return NULL, * Any \a index not less than slv2_plugins_get_length(plugins) will return
* so all plugins in a list can be enumerated by repeated calls NULL,
* so all plugins in a plugins can be enumerated by repeated calls
* to this function starting with \a index = 0. * to this function starting with \a index = 0.
* *
* Time = O(1) * Time = O(1)
* *
* \return NULL if \a index out of range. * \return NULL if \a index out of range.
*/ */
SLV2Plugin SLV2Plugin
slv2_plugins_get_at(SLV2Plugins list, slv2_plugins_get_at(SLV2Plugins plugins,
unsigned index); unsigned index);
/** @} */ /** @} */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __SLV2_PLUGINS_H__ */ #endif /* __SLV2_PLUGINS_H__ */
 End of changes. 12 change blocks. 
16 lines changed or deleted 17 lines changed or added


 pluginui.h   pluginui.h 
skipping to change at line 36 skipping to change at line 36
/** \addtogroup slv2_data /** \addtogroup slv2_data
* @{ * @{
*/ */
/** Get the URI of a Plugin UI. /** Get the URI of a Plugin UI.
* *
* \param ui The Plugin UI * \param ui The Plugin UI
* *
* Time = O(1) * Time = O(1)
*/ */
const char* SLV2Value
slv2_ui_get_uri(SLV2UI ui); slv2_ui_get_uri(SLV2UI ui);
/** Get the types (URIs of RDF classes) of a Plugin UI. /** Get the types (URIs of RDF classes) of a Plugin UI.
* *
* \param ui The Plugin UI * \param ui The Plugin UI
* *
* Time = O(1) * Time = O(1)
*/ */
SLV2Values SLV2Values
slv2_ui_get_types(SLV2UI ui); slv2_ui_get_classes(SLV2UI ui);
/** Check whether a plugin UI is a given type. /** Check whether a plugin UI is a given type.
* *
* \param ui The Plugin UI * \param ui The Plugin UI
* \param type_uri The URI of the LV2 UI type to check this UI against * \param class_uri The URI of the LV2 UI type to check this UI against
* *
* Time = O(1) * Time = O(1)
*/ */
bool bool
slv2_ui_is_type(SLV2UI ui, const char* type_uri); slv2_ui_is_a(SLV2UI ui, SLV2Value class_uri);
/** Get the URI for a Plugin UI's bundle. /** Get the URI for a Plugin UI's bundle.
* *
* \param ui The Plugin UI * \param ui The Plugin UI
* *
* Time = O(1) * Time = O(1)
*/ */
const char* SLV2Value
slv2_ui_get_bundle_uri(SLV2UI ui); slv2_ui_get_bundle_uri(SLV2UI ui);
/** Get the URI for a Plugin UI's shared library. /** Get the URI for a Plugin UI's shared library.
* *
* \param ui The Plugin UI * \param ui The Plugin UI
* *
* Time = O(1) * Time = O(1)
*/ */
const char* SLV2Value
slv2_ui_get_binary_uri(SLV2UI ui); slv2_ui_get_binary_uri(SLV2UI ui);
/** @} */ /** @} */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __SLV2_PLUGIN_UI_H__ */ #endif /* __SLV2_PLUGIN_UI_H__ */
 End of changes. 6 change blocks. 
7 lines changed or deleted 7 lines changed or added


 pluginuiinstance.h   pluginuiinstance.h 
skipping to change at line 65 skipping to change at line 65
* NULL may be passed if the host supports no additional features (unlike * NULL may be passed if the host supports no additional features (unlike
* the LV2 specification - SLV2 takes care of it). * the LV2 specification - SLV2 takes care of it).
* *
* \return NULL if instantiation failed. * \return NULL if instantiation failed.
*/ */
SLV2UIInstance SLV2UIInstance
slv2_ui_instantiate(SLV2Plugin plugin, slv2_ui_instantiate(SLV2Plugin plugin,
SLV2UI ui, SLV2UI ui,
LV2UI_Write_Function write_function, LV2UI_Write_Function write_function,
LV2UI_Controller controller, LV2UI_Controller controller,
LV2UI_Host_Data host_data,
const LV2_Feature* const* features); const LV2_Feature* const* features);
/** Free a plugin UI instance. /** Free a plugin UI instance.
* *
* It is the caller's responsibility to ensure all references to the UI * It is the caller's responsibility to ensure all references to the UI
* instance (including any returned widgets) are cut before calling * instance (including any returned widgets) are cut before calling
* this function. * this function.
* *
* \a instance is invalid after this call. * \a instance is invalid after this call.
*/ */
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 pluginuis.h   pluginuis.h 
skipping to change at line 57 skipping to change at line 57
/** Get a plugin from the list by URI. /** Get a plugin from the list by URI.
* *
* Return value is shared (stored in \a list) and must not be freed or * Return value is shared (stored in \a list) and must not be freed or
* modified by the caller in any way. * modified by the caller in any way.
* *
* Time = O(log2(n)) * Time = O(log2(n))
* *
* \return NULL if plugin with \a url not found in \a list. * \return NULL if plugin with \a url not found in \a list.
*/ */
SLV2UI SLV2UI
slv2_uis_get_by_uri(SLV2UIs list, slv2_uis_get_by_uri(SLV2UIs list,
const char* uri); SLV2Value uri);
/** Get a plugin from the list by index. /** Get a plugin from the list by index.
* *
* \a index has no significance other than as an index into this list. * \a index has no significance other than as an index into this list.
* Any \a index not less than slv2_list_get_length(list) will return NULL, * Any \a index not less than slv2_list_get_length(list) will return NULL,
* so all plugins in a list can be enumerated by repeated calls * so all plugins in a list can be enumerated by repeated calls
* to this function starting with \a index = 0. * to this function starting with \a index = 0.
* *
* Time = O(1) * Time = O(1)
* *
 End of changes. 1 change blocks. 
2 lines changed or deleted 2 lines changed or added


 port.h   port.h 
skipping to change at line 40 skipping to change at line 40
/** \addtogroup slv2_data /** \addtogroup slv2_data
* @{ * @{
*/ */
/** Port analog of slv2_plugin_get_value. /** Port analog of slv2_plugin_get_value.
* *
* Time = Query * Time = Query
*/ */
SLV2Values SLV2Values
slv2_port_get_value(SLV2Plugin plugin, slv2_port_get_value_by_qname(SLV2Plugin plugin,
SLV2Port port, SLV2Port port,
const char* property); const char* property_uri);
/** Return the LV2 port properties of a port. /** Return the LV2 port properties of a port.
* *
* Time = Query * Time = Query
*/ */
SLV2Values SLV2Values
slv2_port_get_properties(SLV2Plugin plugin, slv2_port_get_properties(SLV2Plugin plugin,
SLV2Port port); SLV2Port port);
/** Return whether a port has a certain property. /** Return whether a port has a certain property.
* *
* Time = Query * Time = Query
*/ */
bool bool
slv2_port_has_property(SLV2Plugin p, slv2_port_has_property(SLV2Plugin p,
SLV2Port port, SLV2Port port,
const char* property_uri); SLV2Value property_uri);
/** Get the symbol of a port given the index. /** Return whether a port is an event port and supports a certain event typ e.
* *
* The 'symbol' is a short string, a valid C identifier. * Time = Query
* Returned string must be free()'d by caller. */
bool
slv2_port_supports_event(SLV2Plugin p,
SLV2Port port,
SLV2Value event_uri);
/** Get the symbol of a port.
* *
* \return NULL when index is out of range * The 'symbol' is a short string, a valid C identifier.
* Returned value is owned by \a port and must not be freed.
* *
* Time = Query * Time = Query
*/ */
char* SLV2Value
slv2_port_get_symbol(SLV2Plugin plugin, slv2_port_get_symbol(SLV2Plugin plugin,
SLV2Port port); SLV2Port port);
/** Get the name of a port. /** Get the name of a port.
* *
* This is guaranteed to return the untranslated name (the doap:name in the * This is guaranteed to return the untranslated name (the doap:name in the
* data file without a language tag). Returned value must be free()'d by * data file without a language tag). Returned value must be free()'d by
* the caller. * the caller.
* *
* Time = Query * Time = Query
*/ */
char* SLV2Value
slv2_port_get_name(SLV2Plugin plugin, slv2_port_get_name(SLV2Plugin plugin,
SLV2Port port); SLV2Port port);
/** Get the direction (input, output) of a port. /** Get all the classes of a port.
* *
* Time = Query * This can be used to determine if a port is an input, output, audio,
*/ * control, midi, etc, etc, though it's simpler to use slv2_port_is_a.
SLV2PortDirection * The returned list does not include lv2:Port, which is implied.
slv2_port_get_direction(SLV2Plugin plugin,
SLV2Port port);
/** Get the data type of a port.
* *
* Time = Query * Returned value is shared and must not be destroyed by caller.
*
* Time = O(1)
*/ */
SLV2PortDataType SLV2Values
slv2_port_get_data_type(SLV2Plugin plugin, slv2_port_get_classes(SLV2Plugin plugin,
SLV2Port port); SLV2Port port);
/** Get the default value of a port. /** Determine if a port is of a given class (input, output, audio, etc).
* *
* Only valid for ports with a data type of lv2:float. * For convenience/performance/extensibility reasons, hosts are expected to
* create an SLV2Value for each port class they "care about". Well-known t
ype
* URI strings are defined (e.g. SLV2_PORT_CLASS_INPUT) for convenience, bu
t
* this function is designed so that SLV2 is usable with any port types
* without requiring explicit support in SLV2.
* *
* Time = Query * Time = O(n) (n pointer comparisons where n is the number of classes of
* this port, so this method is suitable for realtime use on any sane port)
.
*/ */
float bool
slv2_port_get_default_value(SLV2Plugin plugin, slv2_port_is_a(SLV2Plugin plugin,
SLV2Port port); SLV2Port port,
SLV2Value port_class);
/** Get the minimum value of a port. /** Get the default, minimum, and maximum values of a port.
* *
* Only valid for ports with a data type of lv2:float. * @a def, @a min, and @a max are outputs, pass pointers to uninitialized
* (i.e. NOT created with slv2_value_new) SLV2Value variables. These will
* be set to point at new values (which must be freed by the caller using
* slv2_value_free), or NULL if the value does not exist.
* *
* Time = Query * Time = Query
*/ */
float void
slv2_port_get_minimum_value(SLV2Plugin plugin, slv2_port_get_range(SLV2Plugin plugin,
SLV2Port port); SLV2Port port,
SLV2Value* def,
SLV2Value* min,
SLV2Value* max);
/** Get the maximum value of a port. /** Get the scale points (enumeration values) of a port.
* *
* Only valid for ports with a data type of lv2:float. * This returns a collection of 'interesting' named values of a port
* (e.g. appropriate entries for a UI selector associated with this port).
* *
* Time = Query * Returned value may be NULL if @a port has no scale points, otherwise it
* must be freed by caller with slv2_scale_points_free.
*/ */
float SLV2ScalePoints
slv2_port_get_maximum_value(SLV2Plugin plugin, slv2_port_get_scale_points(SLV2Plugin plugin,
SLV2Port port); SLV2Port port);
/** @} */ /** @} */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __SLV2_PORT_H__ */ #endif /* __SLV2_PORT_H__ */
 End of changes. 22 change blocks. 
41 lines changed or deleted 63 lines changed or added


 slv2.h   slv2.h 
skipping to change at line 34 skipping to change at line 34
#endif #endif
#include <slv2/plugin.h> #include <slv2/plugin.h>
#include <slv2/pluginclass.h> #include <slv2/pluginclass.h>
#include <slv2/plugininstance.h> #include <slv2/plugininstance.h>
#include <slv2/plugins.h> #include <slv2/plugins.h>
#include <slv2/pluginui.h> #include <slv2/pluginui.h>
#include <slv2/pluginuiinstance.h> #include <slv2/pluginuiinstance.h>
#include <slv2/pluginuis.h> #include <slv2/pluginuis.h>
#include <slv2/port.h> #include <slv2/port.h>
#include <slv2/portsignature.h>
#include <slv2/template.h>
#include <slv2/types.h> #include <slv2/types.h>
#include <slv2/util.h> #include <slv2/util.h>
#include <slv2/value.h> #include <slv2/value.h>
#include <slv2/values.h> #include <slv2/values.h>
#include <slv2/scalepoint.h>
#include <slv2/scalepoints.h>
#include <slv2/world.h> #include <slv2/world.h>
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __SLV2_H__ */ #endif /* __SLV2_H__ */
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 types.h   types.h 
skipping to change at line 26 skipping to change at line 26
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef __SLV2_TYPES_H__ #ifndef __SLV2_TYPES_H__
#define __SLV2_TYPES_H__ #define __SLV2_TYPES_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <stdbool.h>
#include <stdint.h> #include <stdint.h>
/** (Data) Type of a port #define SLV2_NAMESPACE_LV2 "http://lv2plug.in/ns/lv2core#"
* #define SLV2_PORT_CLASS_PORT "http://lv2plug.in/ns/lv2core#Port"
* SLV2_UNKNOWN_PORT_TYPE means the Port is not of any type SLV2 understand #define SLV2_PORT_CLASS_INPUT "http://lv2plug.in/ns/lv2core#InputPort"
s #define SLV2_PORT_CLASS_OUTPUT "http://lv2plug.in/ns/lv2core#OutputPort"
* (currently Control, Audio, MIDI, and OSC). #define SLV2_PORT_CLASS_CONTROL "http://lv2plug.in/ns/lv2core#ControlPort"
* #define SLV2_PORT_CLASS_AUDIO "http://lv2plug.in/ns/lv2core#AudioPort"
* Further class information can be using slv2_port_get_value(p, "rdf:type" #define SLV2_PORT_CLASS_EVENT "http://lv2plug.in/ns/ext/event#EventPort"
) #define SLV2_EVENT_CLASS_MIDI "http://lv2plug.in/ns/ext/midi#MidiEvent"
* or a custom query.
*/
typedef enum _SLV2PortDataType {
SLV2_PORT_DATA_TYPE_UNKNOWN,
SLV2_PORT_DATA_TYPE_CONTROL, /**< One float per block */
SLV2_PORT_DATA_TYPE_AUDIO, /**< One float per frame */
SLV2_PORT_DATA_TYPE_MIDI, /**< A buffer of MIDI data (LL extensio
n) */
SLV2_PORT_DATA_TYPE_OSC, /**< A buffer of OSC data (DR extension
) */
} SLV2PortDataType;
/** 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.
*
* Full URI: http://example.org/foo
* QName: lv2:Plugin
*/
typedef enum _SLV2URIType {
SLV2_URI,
SLV2_QNAME
} SLV2URIType;
/** 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;
/** The port (I/O) signature of a plugin. Opaque, but valid to compare to
NULL. */
typedef struct _SLV2PortSignature* SLV2PortSignature;
/** 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. */
typedef struct _SLV2World* SLV2World; typedef struct _SLV2World* SLV2World;
/** A plugin class. Opaque, but valid to compare to NULL. */ /** A plugin class. Opaque, but valid to compare to NULL. */
typedef struct _SLV2PluginClass* SLV2PluginClass; typedef struct _SLV2PluginClass* SLV2PluginClass;
/** 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 plugin template (collection of port signatures). */
typedef void* SLV2Template;
/** A collection of typed values. */ /** A collection of typed values. */
typedef void* SLV2Values; typedef void* SLV2Values;
/** A scale point */
typedef struct _SLV2ScalePoint* SLV2ScalePoint;
/** A collection of scale points. */
typedef void* SLV2ScalePoints;
/** A plugin UI */ /** A plugin UI */
typedef struct _SLV2UI* SLV2UI; typedef struct _SLV2UI* SLV2UI;
/** A collection of plugin UIs. */ /** A collection of plugin UIs. */
typedef void* SLV2UIs; typedef void* SLV2UIs;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
 End of changes. 5 change blocks. 
52 lines changed or deleted 14 lines changed or added


 util.h   util.h 
skipping to change at line 40 skipping to change at line 40
* @{ * @{
*/ */
/** Convert a full URI (eg file://foo/bar/baz.ttl) to a local path (e.g. /f oo/bar/baz.ttl). /** Convert a full URI (eg file://foo/bar/baz.ttl) to a local path (e.g. /f oo/bar/baz.ttl).
* *
* Return value is shared and must not be deleted by caller. * Return value is shared and must not be deleted by caller.
* \return \a uri converted to a path, or NULL on failure (URI is not local ). * \return \a uri converted to a path, or NULL on failure (URI is not local ).
*/ */
const char* slv2_uri_to_path(const char* uri); const char* slv2_uri_to_path(const char* uri);
/** Append \a suffix to \a *dst, reallocating \a dst as necessary.
*
* \a dst will (possibly) be freed, it must be dynamically allocated with m
alloc
* or NULL.
*/
void
slv2_strappend(char** dst, const char* suffix);
/** Join all arguments into one string.
*
* Arguments are not modified, return value must be free()'d.
*/
char*
slv2_strjoin(const char* first, ...);
char*
slv2_vstrjoin(const char** first, va_list args_list);
/** @} */ /** @} */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __SLV2_UTIL_H__ */ #endif /* __SLV2_UTIL_H__ */
 End of changes. 1 change blocks. 
19 lines changed or deleted 0 lines changed or added


 value.h   value.h 
skipping to change at line 33 skipping to change at line 33
extern "C" { extern "C" {
#endif #endif
#include <stdbool.h> #include <stdbool.h>
#include <slv2/types.h> #include <slv2/types.h>
/** \addtogroup slv2_data /** \addtogroup slv2_data
* @{ * @{
*/ */
/*SLV2Value /** Create a new URI value.
slv2_value_new_uri(const char* uri);*/ *
* Returned value must be freed by called with slv2_value_free.
*/
SLV2Value
slv2_value_new_uri(SLV2World world, const char* uri);
/** Free an SLV2Value. /** Free an SLV2Value.
*/ */
void void
slv2_value_free(SLV2Value val); slv2_value_free(SLV2Value val);
/** Duplicate an SLV2Value. /** Duplicate an SLV2Value.
*/ */
SLV2Value SLV2Value
slv2_value_duplicate(SLV2Value val); slv2_value_duplicate(SLV2Value val);
 End of changes. 1 change blocks. 
2 lines changed or deleted 6 lines changed or added


 values.h   values.h 
skipping to change at line 47 skipping to change at line 47
/** Allocate a new, empty SLV2Values /** Allocate a new, empty SLV2Values
*/ */
SLV2Values SLV2Values
slv2_values_new(); slv2_values_new();
/** Free an SLV2Values. /** Free an SLV2Values.
*/ */
void void
slv2_values_free(SLV2Values); slv2_values_free(SLV2Values);
/** Get the number of elements in a string list. /** Get the number of elements in a value collection.
*/ */
unsigned unsigned
slv2_values_size(SLV2Values list); slv2_values_size(SLV2Values values);
/** Get a string from a string list at the given index. /** Get the value at a given index in the collection.
* *
* @return the element at \a index, or NULL if index is out of range. * @return the element at \a index, or NULL if index is out of range.
* *
* Time = O(1) * Time = O(1)
*/ */
SLV2Value SLV2Value
slv2_values_get_at(SLV2Values list, unsigned index); slv2_values_get_at(SLV2Values values, unsigned index);
/** Return whether \a list contains \a value. /** Return whether \a values contains \a value.
* *
* Time = O(n) * Time = O(n)
*/ */
bool bool
slv2_values_contains(SLV2Values list, SLV2Value value); slv2_values_contains(SLV2Values values, SLV2Value value);
/** @} */ /** @} */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __SLV2_VALUES_H__ */ #endif /* __SLV2_VALUES_H__ */
 End of changes. 6 change blocks. 
6 lines changed or deleted 6 lines changed or added


 world.h   world.h 
skipping to change at line 105 skipping to change at line 105
* Plugins (and other things) are identified by URIs, \b not bundle or * Plugins (and other things) are identified by URIs, \b not bundle or
* file names. * file names.
* *
* This function should only be used by apps which ship with a special * This function should only be used by apps which ship with a special
* bundle (which it knows exists at some path because the bundle is * bundle (which it knows exists at some path because the bundle is
* shipped with the application). * shipped with the application).
* *
* Time = Query * Time = Query
*/ */
void void
slv2_world_load_bundle(SLV2World world, slv2_world_load_bundle(SLV2World world,
const char* bundle_uri); SLV2Value bundle_uri);
/** Get the parent of all other plugin classes, lv2:Plugin. /** Get the parent of all other plugin classes, lv2:Plugin.
* *
* Time = O(1) * Time = O(1)
*/ */
SLV2PluginClass SLV2PluginClass
slv2_world_get_plugin_class(SLV2World world); slv2_world_get_plugin_class(SLV2World world);
/** Return a list of all found plugin classes. /** Return a list of all found plugin classes.
* *
 End of changes. 1 change blocks. 
2 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/