changeset 164:11949d0b2739

* Add system-specific LADSPA and DSSI plugin paths (for OS/X and Windows) * Add ability to open more than one audio file at once from the command line * Add plugin input source selection (with some caveats) * Show name of file being decoded in Ogg/mp3 decode progress dialog
author Chris Cannam
date Thu, 12 Oct 2006 14:56:28 +0000
parents dd6dd983e8ef
children 793df5f0c6cb
files widgets/PluginParameterDialog.cpp widgets/PluginParameterDialog.h
diffstat 2 files changed, 41 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/widgets/PluginParameterDialog.cpp	Wed Oct 11 16:18:51 2006 +0000
+++ b/widgets/PluginParameterDialog.cpp	Thu Oct 12 14:56:28 2006 +0000
@@ -91,7 +91,7 @@
     subgrid->addWidget(label, row, 0);
     subgrid->addWidget(typeLabel, row, 1);
     row++;
-
+    
     m_outputLabel = new QLabel(tr("Output:"));
     m_outputLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
     subgrid->addWidget(m_outputLabel, row, 0);
@@ -121,10 +121,20 @@
 
     subgrid->setColumnStretch(1, 2);
 
+    m_inputModelBox = new QGroupBox;
+    m_inputModelBox->setTitle(tr("Input Source"));
+    grid->addWidget(m_inputModelBox, 1, 0);
+    
+    m_inputModels = new QComboBox;
+    QHBoxLayout *inputLayout = new QHBoxLayout;
+    m_inputModelBox->setLayout(inputLayout);
+    inputLayout->addWidget(m_inputModels);
+    m_inputModelBox->hide();
+
     QGroupBox *paramBox = new QGroupBox;
     paramBox->setTitle(tr("Plugin Parameters"));
-    grid->addWidget(paramBox, 1, 0);
-    grid->setRowStretch(1, 10);
+    grid->addWidget(paramBox, 2, 0);
+    grid->setRowStretch(2, 10);
 
     QHBoxLayout *paramLayout = new QHBoxLayout;
     paramLayout->setMargin(0);
@@ -145,7 +155,7 @@
     QVBoxLayout *advancedLayout = new QVBoxLayout;
     advancedLayout->setMargin(0);
     m_advanced->setLayout(advancedLayout);
-    grid->addWidget(m_advanced, 2, 0);
+    grid->addWidget(m_advanced, 3, 0);
 
     bool haveAdvanced = false;
 
@@ -208,31 +218,6 @@
         m_outputLabel->show();
         m_outputValue->show();
     }
-/*
-    QLabel *outputLabel = 0;
-
-    if (output != "") {
-
-        Vamp::PluginHostAdapter *fePlugin = dynamic_cast<Vamp::PluginHostAdapter *>(m_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());
-                        outputLabel->setWordWrap(true);
-                        break;
-                    }
-                }
-            }
-        }
-    }
-*/
 }
 
 void
@@ -398,6 +383,22 @@
 }
 
 void
+PluginParameterDialog::setCandidateInputModels(const QStringList &models)
+{
+    m_inputModels->clear();
+    m_inputModels->insertItems(0, models);
+    connect(m_inputModels, SIGNAL(activated(const QString &)),
+            this, SIGNAL(inputModelChanged(QString)));
+    m_inputModelBox->show();
+}
+
+QString
+PluginParameterDialog::getInputModel() const
+{
+    return m_inputModels->currentText();
+}
+
+void
 PluginParameterDialog::getProcessingParameters(size_t &blockSize) const
 {
     blockSize = m_blockSize;
--- a/widgets/PluginParameterDialog.h	Wed Oct 11 16:18:51 2006 +0000
+++ b/widgets/PluginParameterDialog.h	Thu Oct 12 14:56:28 2006 +0000
@@ -26,6 +26,7 @@
 class QPushButton;
 class QLabel;
 class QGroupBox;
+class QComboBox;
 
 /**
  * A dialog for editing the parameters of a given plugin, using a
@@ -52,10 +53,14 @@
     void setShowProcessingOptions(bool showWindowSize,
                                   bool showFrequencyDomainOptions);
 
+    void setCandidateInputModels(const QStringList &names);
+
     Vamp::PluginBase *getPlugin() { return m_plugin; }
 
     int getChannel() const { return m_channel; }
 
+    QString getInputModel() const;
+
     //!!! merge with PluginTransform::ExecutionContext
 
     void getProcessingParameters(size_t &blockSize) const;
@@ -64,6 +69,7 @@
 
 signals:
     void pluginConfigurationChanged(QString);
+    void inputModelChanged(QString);
 
 protected slots:
     void channelComboChanged(int);
@@ -85,11 +91,16 @@
 
     QLabel *m_outputLabel;
     QLabel *m_outputValue;
+
     QGroupBox *m_channelBox;
     bool m_haveChannelBoxData;
+
     QGroupBox *m_windowBox;
     bool m_haveWindowBoxData;
 
+    QGroupBox *m_inputModelBox;
+    QComboBox *m_inputModels;
+
     QPushButton *m_advancedButton;
     QWidget *m_advanced;
     bool m_advancedVisible;