changeset 577:514299fc8751

Return library name as well as soname, if present; extend known plugins to include local RDF as well as remote
author Chris Cannam
date Thu, 05 Jun 2014 19:23:26 +0100
parents f0da2404108c
children b28ef45035ac
files src/may/vamp.yeti src/may/vamp/vamprdf.yeti
diffstat 2 files changed, 34 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/may/vamp.yeti	Tue May 20 13:39:22 2014 +0100
+++ b/src/may/vamp.yeti	Thu Jun 05 19:23:26 2014 +0100
@@ -81,14 +81,23 @@
         [];
     yrt);
 
+getPluginKeysFrom store =
+   (nodes = vamprdf.allPluginNodes store;
+    // ordering is random out of the store; might as well sort
+    sort (concatMap do n:
+        case vamprdf.pluginKeyByNode store n of Some k: [k]; None (): [] esac 
+        done nodes));
+
 getKnownPluginKeys () =
-   (store = getGlobalStore ();
-    nodes = vamprdf.allPluginNodes store;
-    // ordering is random out of the store; might as well sort
-    sort (map do n: (vamprdf.pluginDataByNode store n).pluginKey done nodes));
+   (global = getPluginKeysFrom (getGlobalStore ());
+    system = getPluginKeysFrom (getSystemStore ());
+    sort (nub (concat [global, system])));
 
 getDataForKnownPlugin key =
-    vamprdf.pluginDataByKey (getGlobalStore ()) key;
+    case vamprdf.pluginDataByKey (getSystemStore ()) key of
+    Some d: Some d;
+    None _: vamprdf.pluginDataByKey (getGlobalStore ()) key;
+    esac;
    
 categoryOf key =
     list PluginLoader#getInstance()#getPluginCategory(key);
--- a/src/may/vamp/vamprdf.yeti	Tue May 20 13:39:22 2014 +0100
+++ b/src/may/vamp/vamprdf.yeti	Thu Jun 05 19:23:26 2014 +0100
@@ -222,14 +222,18 @@
    (tprop abbr = textProperty store pluginNode abbr;
     nprop abbr =
         try number (textProperty store pluginNode abbr); catch Exception _: 0 yrt;
-    soname =
+    { soname, libraryName } =
         case libraryNodeFor store pluginNode of
-        None (): "";
-        Some n: textProperty store n "vamp:identifier";
+        Some n: { 
+                soname = textProperty store n "vamp:identifier",
+                libraryName = textProperty store n "dc:title"
+            };
+        None (): { soname = "", libraryName = "" };
         esac;
     {
+        pluginNode,
         pluginKey = soname ^ ":" ^ tprop "vamp:identifier",
-        soname,
+        library = { soname, name = libraryName },
         apiVersion = nprop "vamp:vamp_API_version",
         identifier = tprop "vamp:identifier",
         name = tprop "dc:title",
@@ -270,6 +274,17 @@
                        done matches)),
     });
 
+pluginKeyByNode store node =
+    case libraryNodeFor store node of
+    Some libnode: 
+        Some
+           (textProperty store libnode "vamp:identifier" ^
+            ":" ^
+            textProperty store node "vamp:identifier");
+    None ():
+        None ();
+    esac;
+
 pluginDataByKey store key =
     case pluginNodesByKey store key of
     node::others: Some (pluginDataByNode store node);
@@ -282,6 +297,7 @@
 allPluginNodes,
 allLibraryNodes,
 pluginNodesByKey,
+pluginKeyByNode,
 pluginDataByNode,
 pluginDataByKey,
 }