diff transform/TransformFactory.cpp @ 58:f7cb156508cc

* Avoid showing input selection and channel selection for generator plugins
author Chris Cannam
date Tue, 17 Oct 2006 11:41:56 +0000
parents ca1e3f5657d5
children e200055fe80b
line wrap: on
line diff
--- a/transform/TransformFactory.cpp	Mon Oct 16 20:41:34 2006 +0000
+++ b/transform/TransformFactory.cpp	Tue Oct 17 11:41:56 2006 +0000
@@ -480,6 +480,7 @@
 
     bool frequency = false;
     bool effect = false;
+    bool generator = false;
 
     if (FeatureExtractionPluginFactory::instanceFor(id)) {
 
@@ -515,6 +516,10 @@
             effect = true;
         }
 
+        if (desc->audioInputPortCount == 0) {
+            generator = true;
+        }
+
         if (output != "A") {
             int outputNo = output.toInt();
             if (outputNo >= 0 && outputNo < desc->controlOutputPortCount) {
@@ -568,12 +573,14 @@
 
         PluginParameterDialog *dialog = new PluginParameterDialog(plugin);
 
-        if (candidateModelNames.size() > 1) {
+        if (candidateModelNames.size() > 1 && !generator) {
             dialog->setCandidateInputModels(candidateModelNames);
         }
 
-        dialog->setChannelArrangement(sourceChannels, targetChannels,
-                                      defaultChannel);
+        if (targetChannels > 0) {
+            dialog->setChannelArrangement(sourceChannels, targetChannels,
+                                          defaultChannel);
+        }
         
         dialog->setOutputLabel(outputLabel);