# HG changeset patch
# User Chris Cannam
# Date 1224779448 0
# Node ID 957e6a5c8495b94f99881675a6ad438598caca28
# Parent 2019d89ebcf9e7ff8e31bc1c1244ae4f41dc3a11
* Add More Info URL to plugin finder
diff -r 2019d89ebcf9 -r 957e6a5c8495 data/model/TabularModel.h
--- a/data/model/TabularModel.h Fri Oct 17 15:26:29 2008 +0000
+++ b/data/model/TabularModel.h Thu Oct 23 16:30:48 2008 +0000
@@ -34,6 +34,8 @@
class TabularModel
{
public:
+ virtual ~TabularModel() { }
+
virtual int getRowCount() const = 0;
virtual int getColumnCount() const = 0;
diff -r 2019d89ebcf9 -r 957e6a5c8495 rdf/PluginRDFDescription.cpp
--- a/rdf/PluginRDFDescription.cpp Fri Oct 17 15:26:29 2008 +0000
+++ b/rdf/PluginRDFDescription.cpp Thu Oct 23 16:30:48 2008 +0000
@@ -77,6 +77,12 @@
return m_pluginMaker;
}
+QString
+PluginRDFDescription::getPluginInfoURL() const
+{
+ return m_pluginInfoURL;
+}
+
QStringList
PluginRDFDescription::getOutputIds() const
{
@@ -232,6 +238,52 @@
m_pluginMaker = v.value;
}
+ // If we have a more-information URL for this plugin, then we take
+ // that. Otherwise, a more-inforomation URL for the plugin
+ // library would do nicely. Failing that, we could perhaps use
+ // any foaf:page URL at all that appears in the file -- but
+ // perhaps that would be unwise
+
+ v = SimpleSPARQLQuery::singleResultQuery
+ (QString(
+ " PREFIX vamp: "
+ " PREFIX foaf: "
+ " SELECT ?page from <%1> "
+ " WHERE { "
+ " ?plugin a vamp:Plugin ; "
+ " vamp:identifier \"%2\" ; "
+ " foaf:page ?page . "
+ " }")
+ .arg(url)
+ .arg(label), "page");
+
+ if (v.type == SimpleSPARQLQuery::URIValue && v.value != "") {
+
+ m_pluginInfoURL = v.value;
+
+ } else {
+
+ v = SimpleSPARQLQuery::singleResultQuery
+ (QString(
+ " PREFIX vamp: "
+ " PREFIX foaf: "
+ " SELECT ?page from <%1> "
+ " WHERE { "
+ " ?library a vamp:PluginLibrary ; "
+ " vamp:available_plugin ?plugin ; "
+ " foaf:page ?page . "
+ " ?plugin a vamp:Plugin ; "
+ " vamp:identifier \"%2\" . "
+ " }")
+ .arg(url)
+ .arg(label), "page");
+
+ if (v.type == SimpleSPARQLQuery::URIValue && v.value != "") {
+
+ m_pluginInfoURL = v.value;
+ }
+ }
+
return true;
}
diff -r 2019d89ebcf9 -r 957e6a5c8495 rdf/PluginRDFDescription.h
--- a/rdf/PluginRDFDescription.h Fri Oct 17 15:26:29 2008 +0000
+++ b/rdf/PluginRDFDescription.h Thu Oct 23 16:30:48 2008 +0000
@@ -42,6 +42,7 @@
QString getPluginName() const;
QString getPluginDescription() const;
QString getPluginMaker() const;
+ QString getPluginInfoURL() const;
QStringList getOutputIds() const;
QString getOutputName(QString outputId) const;
@@ -61,6 +62,7 @@
QString m_pluginName;
QString m_pluginDescription;
QString m_pluginMaker;
+ QString m_pluginInfoURL;
OutputStringMap m_outputNames;
OutputDispositionMap m_outputDispositions;
OutputStringMap m_outputEventTypeURIMap;
diff -r 2019d89ebcf9 -r 957e6a5c8495 transform/TransformDescription.h
--- a/transform/TransformDescription.h Fri Oct 17 15:26:29 2008 +0000
+++ b/transform/TransformDescription.h Thu Oct 23 16:30:48 2008 +0000
@@ -65,6 +65,7 @@
QString description; // sentence describing transform
QString longDescription; // description "using" plugin name "by" maker
QString maker;
+ QString infoUrl;
QString units;
bool configurable;
diff -r 2019d89ebcf9 -r 957e6a5c8495 transform/TransformFactory.cpp
--- a/transform/TransformFactory.cpp Fri Oct 17 15:26:29 2008 +0000
+++ b/transform/TransformFactory.cpp Thu Oct 23 16:30:48 2008 +0000
@@ -551,6 +551,7 @@
QString description = desc.getPluginDescription();
QString maker = desc.getPluginMaker();
+ QString infoUrl = desc.getPluginInfoURL();
QStringList oids = desc.getOutputIds();
@@ -581,14 +582,43 @@
td.name = tr("%1: %2").arg(name).arg(oname);
}
+ QString longDescription = description;
+ //!!! basically duplicated from above
+ if (longDescription == "") {
+ if (oids.size() == 1) {
+ longDescription = tr("Extract features using \"%1\" plugin (from %2)")
+ .arg(name).arg(maker);
+ } else {
+ longDescription = tr("Extract features using \"%1\" output of \"%2\" plugin (from %3)")
+ .arg(oname).arg(name).arg(maker);
+ }
+ } else {
+ if (oids.size() == 1) {
+ longDescription = tr("%1 using \"%2\" plugin (from %3)")
+ .arg(longDescription).arg(name).arg(maker);
+ } else {
+ longDescription = tr("%1 using \"%2\" output of \"%3\" plugin (from %4)")
+ .arg(longDescription).arg(oname).arg(name).arg(maker);
+ }
+ }
+
td.friendlyName = name; //!!!???
td.description = description;
- td.longDescription = ""; //!!!
+ td.longDescription = longDescription;
td.maker = maker;
+ td.infoUrl = infoUrl;
td.units = "";
td.configurable = false;
m_uninstalledTransforms[tid] = td;
+
+ if (td.infoUrl != "") {
+ if (m_transforms.find(tid) != m_transforms.end()) {
+ if (m_transforms[tid].infoUrl == "") {
+ m_transforms[tid].infoUrl = td.infoUrl;
+ }
+ }
+ }
}
}