---
name: "slv2_world"
section: "3"
platform: "linux"
package: "slv2-doc"
version: "0.6.6+dfsg1-2"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/slv2_world"
---

# slv2\_world(3)

The 'world' represents all library state, and the data found in bundles' manifest.ttl (ie it is an in-memory index of all things LV2 found).

## NAME

Global\_library\_state - The 'world' represents all library state, and the data found in bundles' manifest.ttl (ie it is an in-memory index of all things LV2 found).

### Functions

SLV2World **slv2\_world\_new** ()\
 void **slv2\_world\_free** (SLV2World world)\
 void **slv2\_world\_load\_all** (SLV2World world)\
 void **slv2\_world\_load\_bundle** (SLV2World world, SLV2Value bundle\_uri)\
 SLV2PluginClass **slv2\_world\_get\_plugin\_class** (SLV2World world)\
 SLV2PluginClasses **slv2\_world\_get\_plugin\_classes** (SLV2World world)\
 SLV2Plugins **slv2\_world\_get\_all\_plugins** (SLV2World world)\
 SLV2Plugins **slv2\_world\_get\_plugins\_by\_filter** (SLV2World world, bool(\*include)(SLV2Plugin))\

## Detailed Description

Plugins (and plugin extensions) and the LV2 specification (and LV2 extensions) itself can be queried from the world for use.

Normal hosts which just want to easily load plugins by URI are strongly recommended to simply call **slv2\_world\_load\_all** to find all installed data in the recommended way.

Normal hosts should NOT have to refer to bundles directly under normal circumstances. However, functions are provided to load individual bundles explicitly, intended for hosts which depend on a specific bundle (which is shipped with the application).

## Function Documentation

### SLV2World slv2\_world\_new ()

Initialize a new, empty world.

If initialization fails, NULL is returned.

### SLV2World slv2\_world\_new\_using\_rdf\_world (librdf\_world \* world)

Initialize a new, empty world, using an existing Redland context.

### void slv2\_world\_free (SLV2World world)

Destroy the world, mwahaha.

NB: Destroying the world will leave dangling references in any plugin lists, plugins, etc. Do not destroy the world until you are finished with all objects that came from it.

### void slv2\_world\_load\_all (SLV2World world)

Load all installed LV2 bundles on the system.

This is the recommended way for hosts to load LV2 data. It does the most reasonable thing to find all installed plugins, extensions, etc. on the system. The environment variable LV2\_PATH may be used to set the directories inside which this function will look for bundles. Otherwise a sensible, standard default will be used.

Use of other functions for loading bundles is *highly* discouraged without a special reason to do so - use this one.

Time = Query

### void slv2\_world\_load\_bundle (SLV2World world, SLV2Value bundle\_uri)

Load a specific bundle.

- •

  bundle\_uri A fully qualified URI to the bundle directory, with the trailing slash, eg. file:///usr/lib/lv2/someBundle/

Normal hosts should not use this function.

Hosts should **never** attach any long-term significance to bundle paths as there are no guarantees they will remain consistent whatsoever. Plugins (and other things) are identified by URIs, **not** bundle or file names.

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 shipped with the application).

Time = Query

### SLV2PluginClass slv2\_world\_get\_plugin\_class (SLV2World world)

Get the parent of all other plugin classes, lv2:Plugin.

Time = O(1)

### SLV2PluginClasses slv2\_world\_get\_plugin\_classes (SLV2World world)

Return a list of all found plugin classes.

Returned list is owned by world and must not be freed by the caller.

Time = O(1)

### SLV2Plugins slv2\_world\_get\_all\_plugins (SLV2World world)

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 slv2\_plugin\_\* function results in a query (at which time the data is cached with the SLV2Plugin so future queries are very fast).

Returned list must be freed by user with slv2\_plugins\_free. The contained plugins are owned by *world* and must not be freed by caller.

Time = O(1)

### SLV2Plugins slv2\_world\_get\_plugins\_by\_filter (SLV2World world, bool(\*)(SLV2Plugin) include)

Return a list of found plugins filtered by a user-defined filter function.

All plugins currently found in *world* that return true when passed to *include* (a pointer to a function which takes an SLV2Plugin and returns a bool) will be in the returned list.

Returned list must be freed by user with slv2\_plugins\_free. The contained plugins are owned by *world* and must not be freed by caller.

Time = O(n \* Time(include))

## Author

Generated automatically by Doxygen for SLV2 from the source code.
