changeset 30:56e1d4242bb4

* save and restore step/blocksize etc
author Chris Cannam
date Wed, 20 Sep 2006 16:02:42 +0000
parents 660a973c157a
children 37af203dbd15
files document/Document.cpp document/SVFileReader.cpp document/SVFileReader.h
diffstat 3 files changed, 23 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/document/Document.cpp	Wed Sep 20 15:47:16 2006 +0000
+++ b/document/Document.cpp	Wed Sep 20 16:02:42 2006 +0000
@@ -698,10 +698,14 @@
             //!!! stream the rest of the execution context in both directions (i.e. not just channel)
 
 	    out << indent;
-	    out << QString("  <derivation source=\"%1\" model=\"%2\" channel=\"%3\" transform=\"%4\"")
+	    out << QString("  <derivation source=\"%1\" model=\"%2\" channel=\"%3\" domain=\"%4\" stepSize=\"%5\" blockSize=\"%6\" windowType=\"%7\" transform=\"%8\"")
 		.arg(XmlExportable::getObjectExportId(rec.source))
 		.arg(XmlExportable::getObjectExportId(i->first))
                 .arg(rec.context.channel)
+                .arg(rec.context.domain)
+                .arg(rec.context.stepSize)
+                .arg(rec.context.blockSize)
+                .arg(int(rec.context.windowType))
 		.arg(XmlExportable::encodeEntities(rec.transform));
 
             if (rec.configurationXml != "") {
--- a/document/SVFileReader.cpp	Wed Sep 20 15:47:16 2006 +0000
+++ b/document/SVFileReader.cpp	Wed Sep 20 16:02:42 2006 +0000
@@ -262,7 +262,7 @@
         if (m_currentDerivedModel) {
             m_document->addDerivedModel(m_currentTransform,
                                         m_document->getMainModel(), //!!!
-                                        m_currentTransformChannel,
+                                        m_currentTransformContext,
                                         m_currentDerivedModel,
                                         m_currentTransformConfiguration);
             m_addedModels.insert(m_currentDerivedModel);
@@ -897,10 +897,23 @@
         m_currentTransform = transform;
         m_currentTransformConfiguration = "";
 
+        m_currentTransformContext = PluginTransform::ExecutionContext();
+
         bool ok = false;
         int channel = attributes.value("channel").trimmed().toInt(&ok);
-        if (ok) m_currentTransformChannel = channel;
-        else m_currentTransformChannel = -1;
+        if (ok) m_currentTransformContext.channel = channel;
+
+        int domain = attributes.value("domain").trimmed().toInt(&ok);
+        if (ok) m_currentTransformContext.domain = Vamp::Plugin::InputDomain(domain);
+
+        int stepSize = attributes.value("stepSize").trimmed().toInt(&ok);
+        if (ok) m_currentTransformContext.stepSize = stepSize;
+
+        int blockSize = attributes.value("blockSize").trimmed().toInt(&ok);
+        if (ok) m_currentTransformContext.blockSize = blockSize;
+
+        int windowType = attributes.value("windowType").trimmed().toInt(&ok);
+        if (ok) m_currentTransformContext.windowType = WindowType(windowType);
 
     } else {
 	std::cerr << "WARNING: SV-XML: Unknown derived model " << modelId
--- a/document/SVFileReader.h	Wed Sep 20 15:47:16 2006 +0000
+++ b/document/SVFileReader.h	Wed Sep 20 16:02:42 2006 +0000
@@ -18,6 +18,7 @@
 
 #include "layer/LayerFactory.h"
 #include "transform/Transform.h"
+#include "transform/PluginTransform.h"
 
 #include <QXmlDefaultHandler>
 
@@ -93,7 +94,7 @@
     Model *m_currentDerivedModel;
     PlayParameters *m_currentPlayParameters;
     QString m_currentTransform;
-    int m_currentTransformChannel;
+    PluginTransform::ExecutionContext m_currentTransformContext;
     QString m_currentTransformConfiguration;
     QString m_datasetSeparator;
     bool m_inRow;