diff framework/SVFileReader.h @ 100:22bf057ea151 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 a798f5e6fc5e
children
line wrap: on
line diff
--- a/framework/SVFileReader.h	Fri Nov 30 17:36:14 2007 +0000
+++ b/framework/SVFileReader.h	Wed Feb 27 10:32:45 2008 +0000
@@ -18,7 +18,6 @@
 
 #include "layer/LayerFactory.h"
 #include "plugin/transform/Transform.h"
-#include "plugin/transform/PluginTransformer.h"
 
 #include <QXmlDefaultHandler>
 
@@ -89,8 +88,19 @@
            a derivation element, and no model element should appear
            for it at all. -->
 
-      <derivation source="0" model="2" transform="..." ...>
-        <plugin id="..." ... />
+      <derivation type="transform" source="0" model="2" channel="-1">
+        <transform id="vamp:soname:pluginid:output" ... />
+      </derivation>
+
+      <!-- Note that the derivation element just described replaces
+           this earlier formulation, which had more attributes in the
+           derivation element and a plugin element describing plugin
+           parameters and properties.  What we actually read and
+           write these days is a horrid composite of the two formats,
+           for backward compatibility reasons. -->
+
+      <derivation source="0" model="2" transform="vamp:soname:pluginid:output" ...>
+        <plugin id="pluginid" ... />
       </derivation>
 
       <!-- The playparameters element lists playback settings for
@@ -151,8 +161,10 @@
  */
 
 
-class SVFileReader : public QXmlDefaultHandler
+class SVFileReader : public QObject, QXmlDefaultHandler
 {
+    Q_OBJECT
+
 public:
     SVFileReader(Document *document,
 		 SVFileReaderPaneCallback &callback,
@@ -182,6 +194,12 @@
     bool error(const QXmlParseException &exception);
     bool fatalError(const QXmlParseException &exception);
 
+signals:
+    void modelRegenerationFailed(QString layerName, QString transformName,
+                                 QString message);
+    void modelRegenerationWarning(QString layerName, QString transformName,
+                                  QString message);
+
 protected:
     bool readWindow(const QXmlAttributes &);
     bool readModel(const QXmlAttributes &);
@@ -195,6 +213,8 @@
     bool readDerivation(const QXmlAttributes &);
     bool readPlayParameters(const QXmlAttributes &);
     bool readPlugin(const QXmlAttributes &);
+    bool readTransform(const QXmlAttributes &);
+    bool readParameter(const QXmlAttributes &);
     bool readSelection(const QXmlAttributes &);
     bool readMeasurement(const QXmlAttributes &);
     void addUnaddedModels();
@@ -216,10 +236,10 @@
     Model *m_currentDerivedModel;
     int m_currentDerivedModelId;
     PlayParameters *m_currentPlayParameters;
-    QString m_currentTransformer;
-    Model *m_currentTransformerSource;
-    PluginTransformer::ExecutionContext m_currentTransformerContext;
-    QString m_currentTransformerConfiguration;
+    Transform m_currentTransform;
+    Model *m_currentTransformSource;
+    int m_currentTransformChannel;
+    bool m_currentTransformIsNewStyle;
     QString m_datasetSeparator;
     bool m_inRow;
     bool m_inLayer;