# HG changeset patch # User Chris Cannam # Date 1403696317 -3600 # Node ID aede6e90a6b8a09ab58d80ff2d0321c127ad9bd6 # Parent feac60b5d82bc70d29a4a2b9b87aa0725916fa24# Parent bca93a149bd7a3f1c368850f581ba64e2ea05b8c Merge (but taking everything from the more recent default) diff -r feac60b5d82b -r aede6e90a6b8 README --- a/README Thu Jun 05 15:40:04 2014 +0100 +++ b/README Wed Jun 25 12:38:37 2014 +0100 @@ -237,7 +237,7 @@ Vamp and the Vamp SDK were designed and made at the Centre for Digital Music at Queen Mary, University of London. -The SDK was written by Chris Cannam, copyright (c) 2005-2009 +The SDK was written by Chris Cannam, copyright (c) 2005-2014 Chris Cannam and QMUL. Mark Sandler and Christian Landone provided ideas and direction, and diff -r feac60b5d82b -r aede6e90a6b8 host/vamp-simple-host.cpp --- a/host/vamp-simple-host.cpp Thu Jun 05 15:40:04 2014 +0100 +++ b/host/vamp-simple-host.cpp Wed Jun 25 12:38:37 2014 +0100 @@ -114,6 +114,7 @@ " " << name << " --list\n\n" " -- List the plugin libraries and Vamp plugins in the library search path\n" " in a verbose human-readable format.\n\n" + " " << name << " -L\n" " " << name << " --list-full\n\n" " -- List all data reported by all the Vamp plugins in the library search\n" " path in a very verbose human-readable format.\n\n" @@ -161,7 +162,7 @@ enumeratePlugins(PluginInformation); return 0; - } else if (!strcmp(argv[1], "--list-full")) { + } else if (!strcmp(argv[1], "-L") || !strcmp(argv[1], "--list-full")) { enumeratePlugins(PluginInformationDetailed); return 0; diff -r feac60b5d82b -r aede6e90a6b8 rdf/generator/vamp-rdf-template-generator.cpp --- a/rdf/generator/vamp-rdf-template-generator.cpp Thu Jun 05 15:40:04 2014 +0100 +++ b/rdf/generator/vamp-rdf-template-generator.cpp Wed Jun 25 12:38:37 2014 +0100 @@ -30,8 +30,7 @@ using Vamp::HostExt::PluginLoader; using Vamp::Plugin; -//??? -string programURI = "http://www.vamp-plugins.org/doap.rdf#template-generator"; +string programURI = "http://vamp-plugins.org/rdf/template-generator"; void usage() { @@ -68,6 +67,7 @@ @prefix dc: .\n\ @prefix af: .\n\ @prefix foaf: .\n\ +@prefix doap: .\n\ @prefix cc: .\n\ @prefix : <#> .\n\n"; @@ -77,44 +77,93 @@ string describe_doc(string describerURI, string pluginBundleBaseURI, string libname) { - string res=\ - "<> a vamp:PluginDescription ;\n"; + string res = "\n## Properties of this document\n\n\ +<> a vamp:PluginDescription ;\n"; + if (describerURI != "") { res += " foaf:maker <"+describerURI+"> ;\n"; } + res += "\ - foaf:maker <"+programURI+"> ;\n\ - foaf:primaryTopic <"+pluginBundleBaseURI+libname+"> .\n\n"; + foaf:maker <"+programURI+"> ;\n\ + foaf:primaryTopic <"+pluginBundleBaseURI+libname+"> .\n\n"; return res; } +bool have_multiple_makers(vector plugins) +{ + string firstMaker = ""; + for (size_t i = 0; i < plugins.size(); ++i) { + if (i == 0) { + firstMaker = plugins[i]->getMaker(); + } else if (plugins[i]->getMaker() != firstMaker) { + return true; + } + } + return false; +} + +string describe_maker(vector plugins, bool multipleMakers) +{ + string res = "\n## Maker of the whole plugin library\n\n\ +:library_maker\n"; + + if (!multipleMakers) { + string name; + if (!plugins.empty()) { + name = plugins[0]->getMaker(); + } + res += "\ + foaf:name \"" + name + "\" ;\n\ +# foaf:page <> ; # Place maker's homepage URL in here and uncomment\n\ +# foaf:logo <> ; # URL of an image here, if you happen to have a logo\n"; + + } else { + res += "\ + foaf:name \"Multiple makers\" ;\n"; + } + + res += " .\n\n"; + return res; +} string describe_library(string libname, vector plugins) { - string res=\ - ":"+libname+" a vamp:PluginLibrary ;\n\ - vamp:identifier \""+libname+"\""; + string res = "\n## Properties of the plugin library, and references to the plugins it contains\n\n\ +plugbase:library a vamp:PluginLibrary ;\n\ + vamp:identifier \""+libname+"\" ;\n\ + foaf:maker :library_maker"; for (size_t i = 0; i < plugins.size(); ++i) { res += " ; \n\ - vamp:available_plugin plugbase:"+plugins[i]->getIdentifier(); + vamp:available_plugin plugbase:"+plugins[i]->getIdentifier(); } res += " ; \n\ -# dc:title \"\" ; # Place a descriptive name for the plugin library here and uncomment\n\ -# foaf:page ;\n\ +# dc:title \"\" ; # Place library name here and uncomment\n\ +# dc:description \"\" ; # Place library description here and uncomment\n\ +# foaf:page <> ; # Place more-info HTML page URL here and uncomment\n\ +# doap:download-page <> ; # Place download HTML page URL here and uncomment\n\ .\n\n"; return res; } -string describe_plugin(Plugin* plugin) +string describe_plugin(Plugin* plugin, bool multipleMakers) { - string res=\ - "plugbase:"+plugin->getIdentifier()+" a vamp:Plugin ;\n\ + string res = "\n## Properties of the " + plugin->getName() + " plugin\n\n\ +plugbase:"+plugin->getIdentifier()+" a vamp:Plugin ;\n\ dc:title \""+plugin->getName()+"\" ;\n\ vamp:name \""+plugin->getName()+"\" ;\n\ dc:description \"\"\""+plugin->getDescription()+"\"\"\" ;\n\ - foaf:maker [ foaf:name \""+plugin->getMaker()+"\" ] ; # FIXME could give plugin author's URI here\n\ + foaf:maker "; + + if (multipleMakers) { + res += "[ foaf:name \""+plugin->getMaker()+"\" ] ;\n"; + } else { + res += ":library_maker ;\n"; + } + + res += "\ dc:rights \"\"\""+plugin->getCopyright()+"\"\"\" ;\n\ # cc:license ; \n\ vamp:identifier \""+plugin->getIdentifier()+"\" ;\n\ @@ -125,9 +174,7 @@ else res+=" vamp:input_domain vamp:TimeDomain ;\n"; - Plugin::ParameterList params = plugin->getParameterDescriptors(); - if (!params.empty()) res+="\n"; for (Plugin::ParameterList::const_iterator i = params.begin(); i != params.end(); i++) res+=" vamp:parameter plugbase:"+plugin->getIdentifier()+"_param_"+(*i).identifier+" ;\n"; if (!params.empty()) res+="\n"; @@ -355,17 +402,21 @@ string describe(vector plugins, string pluginBundleBaseURI, string describerURI, string libname) { + bool multipleMakers = have_multiple_makers(plugins); + string res = describe_namespaces(pluginBundleBaseURI, libname); res += describe_doc(describerURI, pluginBundleBaseURI, libname); + res += describe_maker(plugins, multipleMakers); + res += describe_library(libname, plugins); for (size_t i = 0; i < plugins.size(); ++i) { Plugin *plugin = plugins[i]; - res += describe_plugin(plugin); + res += describe_plugin(plugin, multipleMakers); Plugin::ParameterList params = plugin->getParameterDescriptors(); for (Plugin::ParameterList::const_iterator i = params.begin(); i != params.end(); i++)