changeset 108:58f21cf235c7

* Further fixes for Vamp API change, and update to support API versioning * Add plugin, output and parameter descriptions to GUI * Avoid squished panner in heads-up-display on pane when time-value or note layer is on top
author Chris Cannam
date Tue, 27 Feb 2007 12:51:38 +0000
parents dd11619b73ba
children e6c4b27cba2c
files main/MainWindow.cpp transform/TransformFactory.cpp transform/TransformFactory.h
diffstat 3 files changed, 61 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/main/MainWindow.cpp	Mon Feb 26 18:13:07 2007 +0000
+++ b/main/MainWindow.cpp	Tue Feb 27 12:51:38 2007 +0000
@@ -1242,15 +1242,7 @@
         m_transformActionsReverse[transforms[i].identifier] = action;
 	connect(this, SIGNAL(canAddLayer(bool)), action, SLOT(setEnabled(bool)));
 
-        QString tip;
-        if (output == "") {
-            tip = tr("Transform with \"%1\" plugin (from %3)")
-                .arg(pluginName).arg(maker);
-        } else {
-            tip = tr("Transform with \"%1\" output of \"%2\" plugin (from %3)")
-                .arg(output).arg(pluginName).arg(maker);
-        }
-        action->setStatusTip(tip);
+        action->setStatusTip(transforms[i].description);
 
         if (categoryMenus[type].find(category) == categoryMenus[type].end()) {
             std::cerr << "WARNING: MainWindow::setupMenus: Internal error: "
@@ -1274,7 +1266,7 @@
         connect(action, SIGNAL(triggered()), this, SLOT(addLayer()));
         m_transformActions[action] = transforms[i].identifier;
         connect(this, SIGNAL(canAddLayer(bool)), action, SLOT(setEnabled(bool)));
-        action->setStatusTip(tip);
+        action->setStatusTip(transforms[i].description);
 
 //        cerr << "Transform: \"" << name.toStdString() << "\": plugin name \"" << pluginName.toStdString() << "\"" << endl;
 
--- a/transform/TransformFactory.cpp	Mon Feb 26 18:13:07 2007 +0000
+++ b/transform/TransformFactory.cpp	Tue Feb 27 12:51:38 2007 +0000
@@ -244,6 +244,27 @@
 	    QString userName;
             QString friendlyName;
             QString units = outputs[j].unit.c_str();
+            QString description = plugin->getDescription().c_str();
+            QString maker = plugin->getMaker().c_str();
+            if (maker == "") maker = tr("<unknown maker>");
+
+            if (description == "") {
+                if (outputs.size() == 1) {
+                    description = tr("Extract features using \"%1\" plugin (from %2)")
+                        .arg(pluginName).arg(maker);
+                } else {
+                    description = tr("Extract features using \"%1\" output of \"%2\" plugin (from %3)")
+                        .arg(outputs[j].name.c_str()).arg(pluginName).arg(maker);
+                }
+            } else {
+                if (outputs.size() == 1) {
+                    description = tr("%1 using \"%2\" plugin (from %3)")
+                        .arg(description).arg(pluginName).arg(maker);
+                } else {
+                    description = tr("%1 using \"%2\" output of \"%3\" plugin (from %4)")
+                        .arg(description).arg(outputs[j].name.c_str()).arg(pluginName).arg(maker);
+                }
+            }                    
 
 	    if (outputs.size() == 1) {
 		userName = pluginName;
@@ -266,7 +287,8 @@
                               transformId,
                               userName,
                               friendlyName,
-                              plugin->getMaker().c_str(),
+                              description,
+                              maker,
                               units,
                               configurable);
 	}
@@ -309,6 +331,8 @@
 	QString pluginName = descriptor->name.c_str();
         QString category = factory->getPluginCategory(pluginId);
         bool configurable = (descriptor->parameterCount > 0);
+        QString maker = descriptor->maker.c_str();
+        if (maker == "") maker = tr("<unknown maker>");
 
         if (descriptor->audioInputPortCount > 0) {
 
@@ -317,11 +341,12 @@
                 QString transformId = QString("%1:%2").arg(pluginId).arg(j);
                 QString userName;
                 QString units;
+                QString portName;
 
                 if (j < descriptor->controlOutputPortNames.size() &&
                     descriptor->controlOutputPortNames[j] != "") {
 
-                    QString portName = descriptor->controlOutputPortNames[j].c_str();
+                    portName = descriptor->controlOutputPortNames[j].c_str();
 
                     userName = tr("%1: %2")
                         .arg(pluginName)
@@ -342,6 +367,19 @@
                     userName = pluginName;
                 }
 
+                QString description;
+
+                if (portName != "") {
+                    description = tr("Extract \"%1\" data output from \"%2\" effect plugin (from %3)")
+                        .arg(portName)
+                        .arg(pluginName)
+                        .arg(maker);
+                } else {
+                    description = tr("Extract data output %1 from \"%2\" effect plugin (from %3)")
+                        .arg(j + 1)
+                        .arg(pluginName)
+                        .arg(maker);
+                }
 
                 transforms[transformId] = 
                     TransformDesc(tr("Effects Data"),
@@ -349,7 +387,8 @@
                                   transformId,
                                   userName,
                                   userName,
-                                  descriptor->maker.c_str(),
+                                  description,
+                                  maker,
                                   units,
                                   configurable);
             }
@@ -361,8 +400,16 @@
 
                 QString transformId = QString("%1:A").arg(pluginId);
                 QString type = tr("Effects");
+
+                QString description = tr("Transform audio signal with \"%1\" effect plugin (from %2)")
+                    .arg(pluginName)
+                    .arg(maker);
+
                 if (descriptor->audioInputPortCount == 0) {
                     type = tr("Generators");
+                    QString description = tr("Generate audio signal using \"%1\" plugin (from %2)")
+                        .arg(pluginName)
+                        .arg(maker);
                 }
 
                 transforms[transformId] =
@@ -371,7 +418,8 @@
                                   transformId,
                                   pluginName,
                                   pluginName,
-                                  descriptor->maker.c_str(),
+                                  description,
+                                  maker,
                                   "",
                                   configurable);
             }
@@ -490,6 +538,7 @@
     QString id = identifier.section(':', 0, 2);
     QString output = identifier.section(':', 3);
     QString outputLabel = "";
+    QString outputDescription = "";
     
     bool ok = false;
     configurationXml = m_lastConfigurations[identifier];
@@ -519,6 +568,7 @@
                 for (size_t i = 0; i < od.size(); ++i) {
                     if (od[i].identifier == output.toStdString()) {
                         outputLabel = od[i].name.c_str();
+                        outputDescription = od[i].description.c_str();
                         break;
                     }
                 }
@@ -602,7 +652,7 @@
                                           defaultChannel);
         }
         
-        dialog->setOutputLabel(outputLabel);
+        dialog->setOutputLabel(outputLabel, outputDescription);
         
         dialog->setShowProcessingOptions(true, frequency);
 
--- a/transform/TransformFactory.h	Mon Feb 26 18:13:07 2007 +0000
+++ b/transform/TransformFactory.h	Tue Feb 27 12:51:38 2007 +0000
@@ -47,11 +47,11 @@
         TransformDesc() { }
 	TransformDesc(QString _type, QString _category,
                       TransformId _identifier, QString _name,
-                      QString _friendlyName, QString _maker,
-                      QString _units, bool _configurable) :
+                      QString _friendlyName, QString _description,
+                      QString _maker, QString _units, bool _configurable) :
 	    type(_type), category(_category),
             identifier(_identifier), name(_name),
-            friendlyName(_friendlyName),
+            friendlyName(_friendlyName), description(_description),
             maker(_maker), units(_units), configurable(_configurable) { }
 
         QString type; // e.g. feature extraction plugin
@@ -59,6 +59,7 @@
 	TransformId identifier; // e.g. vamp:vamp-aubio:aubioonset
 	QString name; // plugin's name if 1 output, else "name: output"
         QString friendlyName; // short text for layer name
+        QString description; // sentence describing transform
         QString maker;
         QString units;
         bool configurable;