# HG changeset patch # User Chris Cannam # Date 1150732961 0 # Node ID 551d7ae05526dc359bc1d946a103e87b721c15c9 # Parent 571805759a66f322614a73246c65bf7087d8673d * 1492866: Plugin parameter window info display diff -r 571805759a66 -r 551d7ae05526 widgets/PluginParameterDialog.cpp --- 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 #include #include @@ -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(plugin); + + if (fePlugin) { + + std::vector 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); diff -r 571805759a66 -r 551d7ae05526 widgets/PluginParameterDialog.h --- 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();