diff transform/TransformFactory.cpp @ 54:ec77936c268e

* 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 94f1c2747de4
children ca1e3f5657d5
line wrap: on
line diff
--- a/transform/TransformFactory.cpp	Wed Oct 11 16:18:51 2006 +0000
+++ b/transform/TransformFactory.cpp	Thu Oct 12 14:56:28 2006 +0000
@@ -450,7 +450,22 @@
 {
     if (candidateInputModels.empty()) return 0;
 
+    //!!! This will need revision -- we'll have to have a callback
+    //from the dialog for when the candidate input model is changed,
+    //as we'll need to reinitialise the channel settings in the dialog
     Model *inputModel = candidateInputModels[0]; //!!! for now
+    QStringList candidateModelNames;
+    std::map<QString, Model *> modelMap;
+    for (size_t i = 0; i < candidateInputModels.size(); ++i) {
+        QString modelName = candidateInputModels[i]->objectName();
+        QString origModelName = modelName;
+        int dupcount = 1;
+        while (modelMap.find(modelName) != modelMap.end()) {
+            modelName = tr("%1 <%2>").arg(origModelName).arg(++dupcount);
+        }
+        modelMap[modelName] = candidateInputModels[i];
+        candidateModelNames.push_back(modelName);
+    }
 
     QString id = name.section(':', 0, 2);
     QString output = name.section(':', 3);
@@ -553,6 +568,10 @@
 
         PluginParameterDialog *dialog = new PluginParameterDialog(plugin);
 
+        if (candidateModelNames.size() > 1) {
+            dialog->setCandidateInputModels(candidateModelNames);
+        }
+
         dialog->setChannelArrangement(sourceChannels, targetChannels,
                                       defaultChannel);
         
@@ -564,6 +583,16 @@
             ok = true;
         }
 
+        QString selectedInput = dialog->getInputModel();
+        if (selectedInput != "") {
+            if (modelMap.find(selectedInput) != modelMap.end()) {
+                inputModel = modelMap[selectedInput];
+                std::cerr << "Found selected input \"" << selectedInput.toStdString() << "\" in model map, result is " << inputModel << std::endl;
+            } else {
+                std::cerr << "Failed to find selected input \"" << selectedInput.toStdString() << "\" in model map" << std::endl;
+            }
+        }
+
         configurationXml = PluginXml(plugin).toXmlString();
         context.channel = dialog->getChannel();