diff plugin/transform/ModelTransformerFactory.h @ 383:94fc0591ea43 1.2-stable

* merge from trunk (1.2 ended up being tracked from trunk, but we may want this branch for fixes later)
author Chris Cannam
date Wed, 27 Feb 2008 10:32:45 +0000
parents 700cd3350391
children
line wrap: on
line diff
--- a/plugin/transform/ModelTransformerFactory.h	Fri Nov 30 17:36:14 2007 +0000
+++ b/plugin/transform/ModelTransformerFactory.h	Wed Feb 27 10:32:45 2008 +0000
@@ -21,8 +21,6 @@
 
 #include "ModelTransformer.h"
 
-#include "PluginTransformer.h"
-
 #include <map>
 #include <set>
 
@@ -40,28 +38,21 @@
     static ModelTransformerFactory *getInstance();
 
     /**
-     * Get a configuration XML string for the given transform (by
-     * asking the user, most likely).  Returns the selected input
-     * model if the transform is acceptable, 0 if the operation should
-     * be cancelled.  Audio callback play source may be used to
-     * audition effects plugins, if provided.
+     * Fill out the configuration for the given transform (by asking
+     * the user, most likely).  Returns the selected input model and
+     * channel if the transform is acceptable, or an input with a null
+     * model if the operation should be cancelled.  Audio callback
+     * play source may be used to audition effects plugins, if
+     * provided.
      */
-    Model *getConfigurationForTransformer(TransformId identifier,
-                                          const std::vector<Model *> &candidateInputModels,
-                                          Model *defaultInputModel,
-                                          PluginTransformer::ExecutionContext &context,
-                                          QString &configurationXml,
-                                          AudioCallbackPlaySource *source = 0,
-                                          size_t startFrame = 0,
-                                          size_t duration = 0);
-
-    /**
-     * Get the default execution context for the given transform
-     * and input model (if known).
-     */
-    PluginTransformer::ExecutionContext getDefaultContextForTransformer(TransformId identifier,
-                                                                        Model *inputModel = 0);
-
+    ModelTransformer::Input
+    getConfigurationForTransform(Transform &transform,
+                                 const std::vector<Model *> &candidateInputModels,
+                                 Model *defaultInputModel,
+                                 AudioCallbackPlaySource *source = 0,
+                                 size_t startFrame = 0,
+                                 size_t duration = 0);
+    
     /**
      * Return the output model resulting from applying the named
      * transform to the given input model.  The transform may still be
@@ -70,14 +61,15 @@
      *
      * If the transform is unknown or the input model is not an
      * appropriate type for the given transform, or if some other
-     * problem occurs, return 0.
+     * problem occurs, return 0.  Set message if there is any error or
+     * warning to report.
      * 
      * The returned model is owned by the caller and must be deleted
      * when no longer needed.
      */
-    Model *transform(TransformId identifier, Model *inputModel,
-                     const PluginTransformer::ExecutionContext &context,
-                     QString configurationXml = "");
+    Model *transform(const Transform &transform,
+                     const ModelTransformer::Input &input,
+                     QString &message);
 
 protected slots:
     void transformerFinished();
@@ -85,9 +77,8 @@
     void modelAboutToBeDeleted(Model *);
 
 protected:
-    ModelTransformer *createTransformer(TransformId identifier, Model *inputModel,
-                                        const PluginTransformer::ExecutionContext &context,
-                                        QString configurationXml);
+    ModelTransformer *createTransformer(const Transform &transform,
+                                        const ModelTransformer::Input &input);
 
     typedef std::map<TransformId, QString> TransformerConfigurationMap;
     TransformerConfigurationMap m_lastConfigurations;