changeset 34:d36c679577a1

Vestigial Vamp plugin thingy
author Chris Cannam
date Fri, 21 Dec 2012 22:56:45 +0000
parents e20d3c23a243
children 1f80673af4c7
files vamp.yeti
diffstat 1 files changed, 39 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vamp.yeti	Fri Dec 21 22:56:45 2012 +0000
@@ -0,0 +1,39 @@
+module vamp;
+
+import org.vamp_plugins: Plugin, PluginLoader, PluginLoader$AdapterFlags;
+import java.lang: UnsatisfiedLinkError;
+
+listPlugins () =
+   (try
+        map string PluginLoader#getInstance()#listPlugins();
+    catch UnsatisfiedLinkError e:
+        eprintln "Warning: Unable to obtain plugin list:\n\(e)";
+        [];
+    yrt);
+   
+categoryOf key =
+    list PluginLoader#getInstance()#getPluginCategory(key);
+
+plugin key p is string -> ~Plugin -> 'a = {
+    plugin = p,
+    key,
+    get identifier () = p#getIdentifier(),
+    get name () = p#getName(),
+    get description () = p#getName(),
+    get maker () = p#getName(),
+    get copyright () = p#getName(),
+    get version () = p#getName(),
+    get category () = PluginLoader#getInstance()#getPluginCategory(key),
+    };
+
+loadPlugin key rate =
+    plugin key PluginLoader#getInstance()#loadPlugin(key, rate, PluginLoader$AdapterFlags#ADAPT_ALL);
+
+    ///!!! no params, programs [yet]
+
+{
+get pluginKeys = listPlugins,
+loadPlugin,
+categoryOf,
+}
+