Convert a file URI string to a local path string.
For example, “file://foo/bar%20one/baz.ttl” returns “/foo/bar one/baz.ttl”.
Return value must be freed by caller with lilv_free().
@param uri The file URI to parse.
@param hostname If non-NULL, set to the hostname in the URI, if any.
@return uri converted to a path, or NULL on failure (URI is not local).
Activate a plugin instance.
This resets all state information in the plugin, except for port data
locations (as set by lilv_instance_connect_port()). This MUST be called
before calling lilv_instance_run().
Connect a port to a data location.
This may be called regardless of whether the plugin is activated,
activation and deactivation does not destroy port connections.
Deactivate a plugin instance.
Note that to run the plugin after this you must activate it, which will
reset all state information (except port connections).
Get the LV2_Descriptor of the plugin instance.
Normally hosts should not need to access the LV2_Descriptor directly,
use the lilv_instance_* functions.
Get extension data from the plugin instance.
The type and semantics of the data returned is specific to the particular
extension, though in all cases it is shared and must not be deleted.
Connect a port to a data location.
This may be called regardless of whether the plugin is activated,
activation and deactivation does not destroy port connections.
Create a new file URI value.
@param world The world.
@param host Host name, or NULL.
@param path Path on host.
@return A new node that must be freed by caller.
Return this value as a blank node identifier, e.g. “genid03”.
Valid to call only if lilv_node_is_blank(value) returns true.
Returned value is owned by value and must not be freed by caller.
Return this value as a URI string, e.g. “http://example.org/foo”.
Valid to call only if lilv_node_is_uri(value) returns true.
Returned value is owned by value and must not be freed by caller.
Get the URI of this class’ superclass.
Returned value is owned by plugin_class and must not be freed by caller.
Returned value may be NULL, if class has no parent.
Get a plugin class from classes by URI.
Return value is shared (stored in classes) and must not be freed or
modified by the caller in any way.
@return NULL if no plugin class with uri is found in classes.
Get the (resolvable) URI of the plugin’s “main” bundle.
This returns the URI of the bundle where the plugin itself was found. Note
that the data for a plugin may be spread over many bundles, that is,
lilv_plugin_get_data_uris() may return URIs which are not within this
bundle.
Get the (resolvable) URIs of the RDF data files that define a plugin.
Typical hosts should not need to use this function.
Note this always returns fully qualified URIs. If you want local
filesystem paths, use lilv_file_uri_parse().
@return a list of complete URLs eg. “file:///foo/ABundle.lv2/aplug.ttl”,
which is shared and must not be modified or freed.
Get a sequence of all extension data provided by a plugin.
This can be used to find which URIs lilv_instance_get_extension_data()
will return a value for without instantiating the plugin.
Return the index of the plugin’s latency port.
It is a fatal error to call this on a plugin without checking if the port
exists by first calling lilv_plugin_has_latency().
Get the (resolvable) URI of the shared library for plugin.
Note this always returns a fully qualified URI. If you want a local
filesystem path, use lilv_file_uri_parse().
@return a shared string which must not be modified or freed.
Get the name of plugin.
This returns the name (doap:name) of the plugin. The name may be
translated according to the current locale, this value MUST NOT be used
as a plugin identifier (use the URI for that).
Returned value must be freed by the caller.
Get the number of ports on this plugin that are members of some class(es).
Note that this is a varargs function so ports fitting any type ‘profile’
desired can be found quickly. REMEMBER TO TERMINATE THE PARAMETER LIST
OF THIS FUNCTION WITH NULL OR VERY NASTY THINGS WILL HAPPEN.
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.
Get a port on plugin by symbol.
Note this function is slower than lilv_plugin_get_port_by_index(),
especially on plugins with a very large number of ports.
Get the port ranges (minimum, maximum and default values) for all ports.
min_values, max_values and def_values must either point to an array
of N floats, where N is the value returned by lilv_plugin_get_num_ports()
for this plugin, or NULL. The elements of the array will be set to the
the minimum, maximum and default values of the ports on this plugin,
with array index corresponding to port index. If a port doesn’t have a
minimum, maximum or default value, or the port’s type is not float, the
corresponding array element will be set to NAN.
Get the LV2 Features required by a plugin.
If a feature is required by a plugin, hosts MUST NOT use the plugin if they do not
understand (or are unable to support) that feature.
Get the URI of plugin.
Any serialization that refers to plugins should refer to them by this.
Hosts SHOULD NOT save any filesystem paths, plugin indexes, etc. in saved
files; save only the URI.
Return whether or not the plugin introduces (and reports) latency.
The index of the latency port can be found with
lilv_plugin_get_latency_port() ONLY if this function returns true.
Instantiate a plugin.
The returned value is a lightweight handle for an LV2 plugin instance,
it does not refer to plugin, or any other Lilv state. The caller must
eventually free it with lilv_instance_free().
features is a NULL-terminated array of features the host supports.
NULL may be passed if the host supports no additional features.
@return NULL if instantiation failed.
Check if plugin is valid.
This is not a rigorous validator, but can be used to reject some malformed
plugins that could cause bugs (e.g. plugins with missing required fields).
Get a plugin from plugins by URI.
Return value is shared (stored in plugins) and must not be freed or
modified by the caller in any way.
@return NULL if no plugin with uri is found in plugins.
Get all the classes of a port.
This can be used to determine if a port is an input, output, audio,
control, midi, etc, etc, though it’s simpler to use lilv_port_is_a().
The returned list does not include lv2:Port, which is implied.
Returned value is shared and must not be destroyed by caller.
Get the name of a port.
This is guaranteed to return the untranslated name (the doap:name in the
data file without a language tag). Returned value must be freed by
the caller.
Get the scale points (enumeration values) of a port.
This returns a collection of ‘interesting’ named values of a port
(e.g. appropriate entries for a UI selector associated with this port).
Returned value may be NULL if port has no scale points, otherwise it
must be freed by caller with lilv_scale_points_free().
Determine if a port is of a given class (input, output, audio, etc).
For convenience/performance/extensibility reasons, hosts are expected to
create a LilvNode for each port class they “care about”. Well-known type
URI strings are defined (e.g. LILV_URI_INPUT_PORT) for convenience, but
this function is designed so that Lilv is usable with any port types
without requiring explicit support in Lilv.
Enumerate the port values in a state snapshot.
@param state The state to retrieve port values from.
@param set_value A function to receive port values.
@param user_data User data to pass to set_value.
Load a state snapshot from a file.
@param world The world.
@param map URID mapper.
@param subject The subject of the state description (e.g. a preset URI).
@param path The path of the file containing the state description.
@return A new LilvState which must be freed with lilv_state_free().
Load a state snapshot from the world RDF model.
This function can be used to load the default state of a plugin by passing
the plugin URI as the subject parameter.
@param world The world.
@param map URID mapper.
@param node The subject of the state description (e.g. a preset URI).
@return A new LilvState which must be freed with lilv_state_free(), or NULL.
Restore a plugin instance from a state snapshot.
@param state The state to restore, which must apply to the correct plugin.
@param instance An instance of the plugin state applies to, or NULL.
@param set_value A function to set a port value (may be NULL).
@param user_data User data to pass to set_value.
@param flags Bitwise OR of LV2_State_Flags values.
@param features Features to pass LV2_State_Interface.restore().
Save state to a file.
@param world The world.
@param map URID mapper.
@param unmap URID unmapper.
@param state State to save.
@param uri URI of state, may be NULL.
@param dir Path of the bundle directory to save into.
@param filename Path of the state file relative to dir.
Set a metadata property on state.
@param state The state to set the metadata for.
@param key The key to store value under (URID).
@param value Pointer to the value to be stored.
@param size The size of value in bytes.
@param type The type of value (URID).
@param flags LV2_State_Flags for value.
@return 0 on success.
Return true iff a Plugin UI is supported as a given widget type.
@param ui The Plugin UI
@param supported_func User provided supported predicate.
@param container_type The widget type to host the UI within.
@param ui_type (Output) If non-NULL, set to the native type of the UI
which is owned by ui and must not be freed by the caller.
@return The embedding quality level returned by supported_func.
Get a UI from uis by URI.
Return value is shared (stored in uis) and must not be freed or
modified by the caller in any way.
@return NULL if no UI with uri is found in list.
Convert a file URI string to a local path string.
For example, “file://foo/bar/baz.ttl” returns “/foo/bar/baz.ttl”.
Return value is shared and must not be deleted by caller.
This function does not handle escaping correctly and should not be used for
general file URIs. Use lilv_file_uri_parse() instead.
@return uri converted to a path, or NULL on failure (URI is not local).
Find nodes matching a triple pattern.
Either subject or object may be NULL (i.e. a wildcard), but not both.
@return All matches for the wildcard field, or NULL.
Destroy the world, mwahaha.
It is safe to call this function on NULL.
Note that destroying world will destroy all the objects it contains
(e.g. instances of LilvPlugin). Do not destroy the world until you are
finished with all objects that came from it.
Find a single node that matches a pattern.
Exactly one of subject, predicate, object must be NULL.
This function is equivalent to
lilv_nodes_get_first(lilv_world_find_nodes(…)) but simplifies the common
case of only wanting a single value.
@return the first matching node, or NULL if no matches are found.
Return a list of all found plugins.
The returned list contains just enough references to query
or instantiate plugins. The data for a particular plugin will not be
loaded into memory until a call to an lilv_plugin_* function results in
a query (at which time the data is cached with the LilvPlugin so future
queries are very fast).
Load all installed LV2 bundles on the system.
This is the recommended way for hosts to load LV2 data. It implements the
established/standard best practice for discovering all LV2 data on the
system. The environment variable LV2_PATH may be used to control where
this function will look for bundles.
Load all the data associated with the given resource.
@param world The world.
@param resource Must be a subject (i.e. a URI or a blank node).
@return The number of files parsed, or -1 on error
Function to get a port value.
@param port_symbol The symbol of the port.
@param user_data The user_data passed to lilv_state_new_from_instance().
@param size (Output) The size of the returned value.
@param type (Output) The URID of the type of the returned value.
@return A pointer to the port value.
Function to set a port value.
@param port_symbol The symbol of the port.
@param user_data The user_data passed to lilv_state_restore().
@param size The size of value.
@param type The URID of the type of value.
@param value A pointer to the port value.