Package org.vamp_plugins
Class PluginLoader
- java.lang.Object
-
- org.vamp_plugins.PluginLoader
-
public class PluginLoader extends java.lang.Object
PluginLoader loads a Vamp plugin by searching the standard Vamp installation path, and returns a Plugin object wrapping the native plugin. To load a plugin call PluginLoader.getInstance().loadPlugin(key, rate), where rate is the processing sample rate and key is the plugin key consisting of the plugin's library base name and its identifier, colon-separated. For example, Plugin p = PluginLoader.getInstance().loadPlugin("vamp-example-plugins:percussiononsets", 44100);
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description class
PluginLoader.AdapterFlags
AdapterFlags contains a set of values that may be OR'd together and passed to loadPlugin() to indicate which of the properties of a plugin the host would like PluginLoader to take care of for it, rather than having to handle itself.class
PluginLoader.LoadFailedException
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static PluginLoader
getInstance()
PluginLoader is a singleton.java.lang.String[]
getPluginCategory(java.lang.String key)
Return the category hierarchy for a Vamp plugin, given its identifying key.java.lang.String[]
getPluginPath()
Return the plugin path, that is, the series of local file folders that will be searched for plugin files.java.lang.String[]
listPlugins()
Search for all available Vamp plugins, and return a list of their plugin keys (suitable for passing to loadPlugin) in the order in which they were found.Plugin
loadPlugin(java.lang.String key, float inputSampleRate, int adapterFlags)
Load a native Vamp plugin from the plugin path.
-
-
-
Method Detail
-
getInstance
public static PluginLoader getInstance()
PluginLoader is a singleton. Return the instance of it.
-
listPlugins
public java.lang.String[] listPlugins()
Search for all available Vamp plugins, and return a list of their plugin keys (suitable for passing to loadPlugin) in the order in which they were found.
-
loadPlugin
public Plugin loadPlugin(java.lang.String key, float inputSampleRate, int adapterFlags) throws PluginLoader.LoadFailedException
Load a native Vamp plugin from the plugin path. If the plugin cannot be loaded, throw LoadFailedException. key is the plugin key consisting of the plugin's library base name and its identifier, colon-separated; inputSampleRate is the processing sample rate for input audio. adapterFlags should contain an OR of the desired AdapterFlags options for the plugin, or AdapterFlags.ADAPT_NONE if no automatic adaptations are to be made.- Throws:
PluginLoader.LoadFailedException
-
getPluginCategory
public java.lang.String[] getPluginCategory(java.lang.String key)
Return the category hierarchy for a Vamp plugin, given its identifying key. The hierarchy is a sequence of category names giving the location of a plugin within a category forest, containing the human-readable names of the plugin's category tree root, followed by each of the nodes down to the leaf containing the plugin. If the plugin has no category information, return an empty list.
-
getPluginPath
public java.lang.String[] getPluginPath()
Return the plugin path, that is, the series of local file folders that will be searched for plugin files. This is platform-specific; it may be a default path, or it may be determined by factors such as the VAMP_PATH environment variable.
-
-