changeset 54:a798f5e6fc5e

* Further naming change: Transformer -> ModelTransformer. The Transform class now describes a thing that can be done, and the ModelTransformer does it to a Model.
author Chris Cannam
date Wed, 07 Nov 2007 12:59:01 +0000
parents de2b3c6479c8
children 9fa273598830
files framework/Document.cpp framework/Document.h framework/MainWindowBase.cpp framework/MainWindowBase.h framework/SVFileReader.h
diffstat 5 files changed, 31 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/framework/Document.cpp	Mon Nov 05 15:31:06 2007 +0000
+++ b/framework/Document.cpp	Wed Nov 07 12:59:01 2007 +0000
@@ -25,7 +25,8 @@
 #include "view/View.h"
 #include "base/PlayParameterRepository.h"
 #include "base/PlayParameters.h"
-#include "plugin/transform/TransformerFactory.h"
+#include "plugin/transform/TransformFactory.h"
+#include "plugin/transform/ModelTransformerFactory.h"
 #include <QApplication>
 #include <QTextStream>
 #include <iostream>
@@ -42,7 +43,7 @@
     m_autoAlignment(false)
 {
     connect(this, SIGNAL(modelAboutToBeDeleted(Model *)),
-            TransformerFactory::getInstance(),
+            ModelTransformerFactory::getInstance(),
             SLOT(modelAboutToBeDeleted(Model *)));
 }
 
@@ -174,20 +175,20 @@
 
 Layer *
 Document::createDerivedLayer(LayerFactory::LayerType type,
-			     TransformerId transform)
+			     TransformId transform)
 {
     Layer *newLayer = createLayer(type);
     if (!newLayer) return 0;
 
     newLayer->setObjectName(getUniqueLayerName
-                            (TransformerFactory::getInstance()->
-                             getTransformerFriendlyName(transform)));
+                            (TransformFactory::getInstance()->
+                             getTransformFriendlyName(transform)));
 
     return newLayer;
 }
 
 Layer *
-Document::createDerivedLayer(TransformerId transform,
+Document::createDerivedLayer(TransformId transform,
                              Model *inputModel, 
                              const PluginTransformer::ExecutionContext &context,
                              QString configurationXml)
@@ -231,8 +232,8 @@
     
     if (newLayer) {
 	newLayer->setObjectName(getUniqueLayerName
-                                (TransformerFactory::getInstance()->
-                                 getTransformerFriendlyName(transform)));
+                                (TransformFactory::getInstance()->
+                                 getTransformFriendlyName(transform)));
     }
 
     emit layerAdded(newLayer);
@@ -289,7 +290,7 @@
 	    // This model was derived from the previous main
 	    // model: regenerate it.
 	    
-	    TransformerId transform = m_models[model].transform;
+	    TransformId transform = m_models[model].transform;
             PluginTransformer::ExecutionContext context = m_models[model].context;
 	    
 	    Model *replacementModel =
@@ -343,7 +344,7 @@
 }
 
 void
-Document::addDerivedModel(TransformerId transform,
+Document::addDerivedModel(TransformId transform,
                           Model *inputModel,
                           const PluginTransformer::ExecutionContext &context,
                           Model *outputModelToAdd,
@@ -394,7 +395,7 @@
 }
 
 Model *
-Document::addDerivedModel(TransformerId transform,
+Document::addDerivedModel(TransformId transform,
                           Model *inputModel,
                           const PluginTransformer::ExecutionContext &context,
                           QString configurationXml)
@@ -410,7 +411,7 @@
 	}
     }
 
-    model = TransformerFactory::getInstance()->transform
+    model = ModelTransformerFactory::getInstance()->transform
 	(transform, inputModel, context, configurationXml);
 
     if (!model) {
@@ -687,9 +688,9 @@
 bool
 Document::canAlign() 
 {
-    TransformerId id = "vamp:match-vamp-plugin:match:path";
-    TransformerFactory *factory = TransformerFactory::getInstance();
-    return factory->haveTransformer(id);
+    TransformId id = "vamp:match-vamp-plugin:match:path";
+    TransformFactory *factory = TransformFactory::getInstance();
+    return factory->haveTransform(id);
 }
 
 void
@@ -732,9 +733,9 @@
 
     Model *aggregate = new AggregateWaveModel(components);
 
-    TransformerId id = "vamp:match-vamp-plugin:match:path";
+    TransformId id = "vamp:match-vamp-plugin:match:path";
     
-    TransformerFactory *factory = TransformerFactory::getInstance();
+    ModelTransformerFactory *factory = ModelTransformerFactory::getInstance();
 
     Model *transformOutput = factory->transform
         (id, aggregate,
--- a/framework/Document.h	Mon Nov 05 15:31:06 2007 +0000
+++ b/framework/Document.h	Wed Nov 07 12:59:01 2007 +0000
@@ -17,8 +17,9 @@
 #define _DOCUMENT_H_
 
 #include "layer/LayerFactory.h"
-#include "plugin/transform/Transformer.h"
-#include "plugin/transform/PluginTransformer.h"
+#include "plugin/transform/Transform.h"
+#include "plugin/transform/PluginTransformer.h"//!!!
+#include "plugin/transform/ModelTransformer.h"
 #include "base/Command.h"
 
 #include <map>
@@ -45,7 +46,7 @@
  * regenerate it.
  * 
  *  - Any number of Model objects that were generated by a Transformer
- * such as FeatureExtractionPluginTransformer.  For these, we also
+ * such as FeatureExtractionModelTransformer.  For these, we also
  * record the source model and the name of the transform used to
  * generate the model so that we can regenerate it (potentially
  * from a different source) on demand.
@@ -106,14 +107,14 @@
      * by a transform layer _must_ be registered with the document
      * using addDerivedModel below.
      */
-    Layer *createDerivedLayer(LayerFactory::LayerType, TransformerId);
+    Layer *createDerivedLayer(LayerFactory::LayerType, TransformId);
 
     /**
      * Create and return a suitable layer for the given transform,
      * running the transform and associating the resulting model with
      * the new layer.
      */
-    Layer *createDerivedLayer(TransformerId,
+    Layer *createDerivedLayer(TransformId,
                               Model *inputModel, 
                               const PluginTransformer::ExecutionContext &context,
                               QString configurationXml);
@@ -149,7 +150,7 @@
      * Add a derived model associated with the given transform,
      * running the transform and returning the resulting model.
      */
-    Model *addDerivedModel(TransformerId transform,
+    Model *addDerivedModel(TransformId transform,
                            Model *inputModel,
                            const PluginTransformer::ExecutionContext &context,
                            QString configurationXml);
@@ -159,7 +160,7 @@
      * is necessary to register any derived model that was not created
      * by the document using createDerivedModel or createDerivedLayer.
      */
-    void addDerivedModel(TransformerId,
+    void addDerivedModel(TransformId,
                          Model *inputModel,
                          const PluginTransformer::ExecutionContext &context,
                          Model *outputModelToAdd,
@@ -267,7 +268,7 @@
 	// transform involved but the (target) model has been modified
 	// since being generated from it.
 	const Model *source;
-	TransformerId transform;
+	TransformId transform;
         PluginTransformer::ExecutionContext context;
         QString configurationXml;
 
--- a/framework/MainWindowBase.cpp	Mon Nov 05 15:31:06 2007 +0000
+++ b/framework/MainWindowBase.cpp	Wed Nov 07 12:59:01 2007 +0000
@@ -105,7 +105,7 @@
     m_playTarget(0),
     m_oscQueue(withOSCSupport ? new OSCQueue() : 0),
     m_recentFiles("RecentFiles", 20),
-    m_recentTransformers("RecentTransforms", 20),
+    m_recentTransforms("RecentTransforms", 20),
     m_documentModified(false),
     m_openingAudioFile(false),
     m_abandoning(false),
--- a/framework/MainWindowBase.h	Mon Nov 05 15:31:06 2007 +0000
+++ b/framework/MainWindowBase.h	Wed Nov 07 12:59:01 2007 +0000
@@ -27,7 +27,7 @@
 #include "base/PropertyContainer.h"
 #include "base/RecentFiles.h"
 #include "layer/LayerFactory.h"
-#include "plugin/transform/Transformer.h"
+#include "plugin/transform/Transform.h"
 #include "SVFileReader.h"
 #include "data/fileio/FileFinder.h"
 #include "data/fileio/FileSource.h"
@@ -249,7 +249,7 @@
     OSCQueue                *m_oscQueue;
 
     RecentFiles              m_recentFiles;
-    RecentFiles              m_recentTransformers;
+    RecentFiles              m_recentTransforms;
 
     bool                     m_documentModified;
     bool                     m_openingAudioFile;
--- a/framework/SVFileReader.h	Mon Nov 05 15:31:06 2007 +0000
+++ b/framework/SVFileReader.h	Wed Nov 07 12:59:01 2007 +0000
@@ -17,7 +17,7 @@
 #define _SV_FILE_READER_H_
 
 #include "layer/LayerFactory.h"
-#include "plugin/transform/Transformer.h"
+#include "plugin/transform/Transform.h"
 #include "plugin/transform/PluginTransformer.h"
 
 #include <QXmlDefaultHandler>