diff framework/Document.h @ 72:4aa40182321f

* Merge from transforms branch -- switch over to using Transform object properly
author Chris Cannam
date Fri, 07 Dec 2007 16:47:31 +0000
parents a798f5e6fc5e
children 0535c49069ba
line wrap: on
line diff
--- a/framework/Document.h	Fri Nov 30 17:31:09 2007 +0000
+++ b/framework/Document.h	Fri Dec 07 16:47:31 2007 +0000
@@ -18,7 +18,6 @@
 
 #include "layer/LayerFactory.h"
 #include "plugin/transform/Transform.h"
-#include "plugin/transform/PluginTransformer.h"//!!!
 #include "plugin/transform/ModelTransformer.h"
 #include "base/Command.h"
 
@@ -114,10 +113,8 @@
      * running the transform and associating the resulting model with
      * the new layer.
      */
-    Layer *createDerivedLayer(TransformId,
-                              Model *inputModel, 
-                              const PluginTransformer::ExecutionContext &context,
-                              QString configurationXml);
+    Layer *createDerivedLayer(const Transform &,
+                              const ModelTransformer::Input &);
 
     /**
      * Delete the given layer, and also its associated model if no
@@ -144,27 +141,23 @@
      */
     const WaveFileModel *getMainModel() const { return m_mainModel; }
 
-    std::vector<Model *> getTransformerInputModels();
+    std::vector<Model *> getTransformInputModels();
 
     /**
      * Add a derived model associated with the given transform,
      * running the transform and returning the resulting model.
      */
-    Model *addDerivedModel(TransformId transform,
-                           Model *inputModel,
-                           const PluginTransformer::ExecutionContext &context,
-                           QString configurationXml);
+    Model *addDerivedModel(const Transform &transform,
+                           const ModelTransformer::Input &input);
 
     /**
      * Add a derived model associated with the given transform.  This
      * is necessary to register any derived model that was not created
      * by the document using createDerivedModel or createDerivedLayer.
      */
-    void addDerivedModel(TransformId,
-                         Model *inputModel,
-                         const PluginTransformer::ExecutionContext &context,
-                         Model *outputModelToAdd,
-                         QString configurationXml);
+    void addDerivedModel(const Transform &transform,
+                         const ModelTransformer::Input &input,
+                         Model *outputModelToAdd);
 
     /**
      * Add an imported (non-derived, non-main) model.  This is
@@ -267,10 +260,14 @@
 	// transform name is set but source is NULL, then there was a
 	// transform involved but the (target) model has been modified
 	// since being generated from it.
+        
+        // This does not use ModelTransformer::Input, because it would
+        // be confusing to have Input objects hanging around with NULL
+        // models in them.
+
 	const Model *source;
-	TransformId transform;
-        PluginTransformer::ExecutionContext context;
-        QString configurationXml;
+        int channel;
+        Transform transform;
 
 	// Count of the number of layers using this model.
 	int refcount;
@@ -322,6 +319,8 @@
     void removeFromLayerViewMap(Layer *, View *);
 
     QString getUniqueLayerName(QString candidate);
+    void writeBackwardCompatibleDerivation(QTextStream &, QString, Model *,
+                                           const ModelRecord &) const;
     
     /**
      * And these are the layers.  We also control the lifespans of