diff transform/FeatureExtractionModelTransformer.cpp @ 859:13803edd513d tonioni

Use a settings setting for flexi/non-flexi determination -- this may not be the right thing in the long run but it's simpler and easier than passing through a random value that doesn't actually come from anywhere
author Chris Cannam
date Wed, 04 Dec 2013 19:30:02 +0000
parents dba8a02b0413
children 862fe7b20df7 3e6ed8a8577b
line wrap: on
line diff
--- a/transform/FeatureExtractionModelTransformer.cpp	Wed Dec 04 19:29:19 2013 +0000
+++ b/transform/FeatureExtractionModelTransformer.cpp	Wed Dec 04 19:30:02 2013 +0000
@@ -37,12 +37,12 @@
 
 #include <iostream>
 
+#include <QSettings>
+
 FeatureExtractionModelTransformer::FeatureExtractionModelTransformer(Input in,
-                                                                     const Transform &transform,
-                                                                     const PreferredOutputModel outputmodel) :
+                                                                     const Transform &transform) :
     ModelTransformer(in, transform),
-    m_plugin(0),
-    m_preferredOutputModel(outputmodel)
+    m_plugin(0)
 {
 //    SVDEBUG << "FeatureExtractionModelTransformer::FeatureExtractionModelTransformer: plugin " << pluginId << ", outputName " << m_transform.getOutput() << endl;
 
@@ -50,11 +50,9 @@
 }
 
 FeatureExtractionModelTransformer::FeatureExtractionModelTransformer(Input in,
-                                                                     const Transforms &transforms,
-                                                                     const PreferredOutputModel outputmodel) :
+                                                                     const Transforms &transforms) :
     ModelTransformer(in, transforms),
-    m_plugin(0),
-    m_preferredOutputModel(outputmodel)
+    m_plugin(0)
 {
 //    SVDEBUG << "FeatureExtractionModelTransformer::FeatureExtractionModelTransformer: plugin " << pluginId << ", outputName " << m_transform.getOutput() << endl;
 
@@ -344,25 +342,35 @@
         // problem of determining whether to use that here (if bin
         // count > 1).  But we don't.
 
-		if (isNoteModel && m_preferredOutputModel == NoteOutputModel) {
+        QSettings settings;
+        settings.beginGroup("Transformer");
+        bool flexi = settings.value("use-flexi-note-model", false).toBool();
+        settings.endGroup();
+
+        cerr << "flexi = " << flexi << endl;
+
+        if (isNoteModel && !flexi) {
 
             NoteModel *model;
             if (haveExtents) {
-	            model = new NoteModel (modelRate, modelResolution, minValue, maxValue, false);
+                model = new NoteModel
+                    (modelRate, modelResolution, minValue, maxValue, false);
             } else {
-	            model = new NoteModel (modelRate, modelResolution, false);
+                model = new NoteModel
+                    (modelRate, modelResolution, false);
             }
             model->setScaleUnits(m_descriptors[n]->unit.c_str());
             out = model;
 
-		// GF: FlexiNoteModel is selected if the m_preferredOutputModel is set
-        } else if (isNoteModel && m_preferredOutputModel == FlexiNoteOutputModel) {
+        } else if (isNoteModel && flexi) {
 
             FlexiNoteModel *model;
             if (haveExtents) {
-                model = new FlexiNoteModel (modelRate, modelResolution, minValue, maxValue, false);
+                model = new FlexiNoteModel
+                    (modelRate, modelResolution, minValue, maxValue, false);
             } else {
-                model = new FlexiNoteModel (modelRate, modelResolution, false);
+                model = new FlexiNoteModel
+                    (modelRate, modelResolution, false);
             }
             model->setScaleUnits(m_descriptors[n]->unit.c_str());
             out = model;