changeset 90:db267a315058

* Make alignment plugin configurable through settings file, even though it isn't yet available in the preferences GUI
author Chris Cannam
date Thu, 07 Feb 2008 12:35:08 +0000
parents 3b616971bdc6
children 9fc4b256c283
files framework/Document.cpp framework/Document.h
diffstat 2 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/framework/Document.cpp	Wed Feb 06 17:40:53 2008 +0000
+++ b/framework/Document.cpp	Thu Feb 07 12:35:08 2008 +0000
@@ -29,6 +29,7 @@
 #include "plugin/transform/ModelTransformerFactory.h"
 #include <QApplication>
 #include <QTextStream>
+#include <QSettings>
 #include <iostream>
 
 // For alignment:
@@ -759,10 +760,22 @@
     return (m_models.find(const_cast<Model *>(model)) != m_models.end());
 }
 
+TransformId
+Document::getAlignmentTransformName()
+{
+    QSettings settings;
+    settings.beginGroup("Alignment");
+    TransformId id =
+        settings.value("transform-id",
+                       "vamp:match-vamp-plugin:match:path").toString();
+    settings.endGroup();
+    return id;
+}
+
 bool
 Document::canAlign() 
 {
-    TransformId id = "vamp:match-vamp-plugin:match:path";
+    TransformId id = getAlignmentTransformName();
     TransformFactory *factory = TransformFactory::getInstance();
     return factory->haveTransform(id);
 }
@@ -832,9 +845,6 @@
 
     std::cerr << "Document::alignModel: Alignment transform step size " << transform.getStepSize() << ", block size " << transform.getBlockSize() << std::endl;
 
-//!!!    QString args = "<plugin param-serialise=\"1\"/>";
-//    Model *transformOutput = factory->transform(id, aggregate, context, args);
-
     ModelTransformerFactory *mtf = ModelTransformerFactory::getInstance();
 
     QString message;
--- a/framework/Document.h	Wed Feb 06 17:40:53 2008 +0000
+++ b/framework/Document.h	Thu Feb 07 12:35:08 2008 +0000
@@ -329,6 +329,8 @@
     QString getUniqueLayerName(QString candidate);
     void writeBackwardCompatibleDerivation(QTextStream &, QString, Model *,
                                            const ModelRecord &) const;
+
+    static TransformId getAlignmentTransformName();
     
     /**
      * And these are the layers.  We also control the lifespans of