changeset 106:551d7ae05526

* 1492866: Plugin parameter window info display
author Chris Cannam
date Mon, 19 Jun 2006 16:02:41 +0000
parents 571805759a66
children bf196d6e8998
files widgets/PluginParameterDialog.cpp widgets/PluginParameterDialog.h
diffstat 2 files changed, 40 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/widgets/PluginParameterDialog.cpp	Thu Jun 15 15:48:05 2006 +0000
+++ b/widgets/PluginParameterDialog.cpp	Mon Jun 19 16:02:41 2006 +0000
@@ -17,6 +17,8 @@
 
 #include "PluginParameterBox.h"
 
+#include "vamp-sdk/Plugin.h"
+
 #include <QGridLayout>
 #include <QLabel>
 #include <QGroupBox>
@@ -29,6 +31,7 @@
                                              int sourceChannels,
                                              int targetChannels,
                                              int defaultChannel,
+                                             QString output,
 					     QWidget *parent) :
     QDialog(parent),
     m_plugin(plugin),
@@ -56,6 +59,29 @@
 
     QLabel *makerLabel = new QLabel(plugin->getMaker().c_str());
 
+    QLabel *outputLabel = 0;
+
+    if (output != "") {
+
+        Vamp::Plugin *fePlugin = dynamic_cast<Vamp::Plugin *>(plugin);
+
+        if (fePlugin) {
+
+            std::vector<Vamp::Plugin::OutputDescriptor> od =
+                fePlugin->getOutputDescriptors();
+
+            if (od.size() > 1) {
+
+                for (size_t i = 0; i < od.size(); ++i) {
+                    if (od[i].name == output.toStdString()) {
+                        outputLabel = new QLabel(od[i].description.c_str());
+                        break;
+                    }
+                }
+            }
+        }
+    }
+
     QLabel *versionLabel = new QLabel(QString("%1")
                                       .arg(plugin->getPluginVersion()));
 
@@ -70,14 +96,21 @@
     subgrid->addWidget(new QLabel(tr("Type:")), 1, 0);
     subgrid->addWidget(typeLabel, 1, 1);
 
-    subgrid->addWidget(new QLabel(tr("Maker:")), 2, 0);
-    subgrid->addWidget(makerLabel, 2, 1);
+    int outputOffset = 0;
+    if (outputLabel) {
+        subgrid->addWidget(new QLabel(tr("Output:")), 2, 0);
+        subgrid->addWidget(outputLabel, 2, 1);
+        outputOffset = 1;
+    }
 
-    subgrid->addWidget(new QLabel(tr("Copyright:  ")), 3, 0);
-    subgrid->addWidget(copyrightLabel, 3, 1);
+    subgrid->addWidget(new QLabel(tr("Maker:")), 2 + outputOffset, 0);
+    subgrid->addWidget(makerLabel, 2 + outputOffset, 1);
 
-    subgrid->addWidget(new QLabel(tr("Version:")), 4, 0);
-    subgrid->addWidget(versionLabel, 4, 1);
+    subgrid->addWidget(new QLabel(tr("Copyright:  ")), 3 + outputOffset, 0);
+    subgrid->addWidget(copyrightLabel, 3 + outputOffset, 1);
+
+    subgrid->addWidget(new QLabel(tr("Version:")), 4 + outputOffset, 0);
+    subgrid->addWidget(versionLabel, 4 + outputOffset, 1);
 
     subgrid->setColumnStretch(1, 2);
 
--- a/widgets/PluginParameterDialog.h	Thu Jun 15 15:48:05 2006 +0000
+++ b/widgets/PluginParameterDialog.h	Mon Jun 19 16:02:41 2006 +0000
@@ -38,6 +38,7 @@
                           int sourceChannels,
                           int targetChannels,
                           int defaultChannel,
+                          QString output = "",
                           QWidget *parent = 0);
     ~PluginParameterDialog();