diff document/Document.cpp @ 184:ebd906049fb6

* Change WaveFileModel API from getValues(start,end) to getData(start,count). It's much less error-prone to pass in frame counts instead of start/end locations. Should have done this ages ago. This closes #1794563. * Add option to apply a transform to only the selection region, instead of the whole audio. * (to make the above work properly) Add start frame offset to wave models
author Chris Cannam
date Mon, 01 Oct 2007 13:48:38 +0000
parents 98ba77e0d897
children 29c356da4ae4
line wrap: on
line diff
--- a/document/Document.cpp	Sat Sep 29 10:58:31 2007 +0000
+++ b/document/Document.cpp	Mon Oct 01 13:48:38 2007 +0000
@@ -813,17 +813,24 @@
         }
 
 	if (haveDerivation) {
+
+            QString extentsAttributes;
+            if (rec.context.startFrame != 0 ||
+                rec.context.duration != 0) {
+                extentsAttributes = QString("startFrame=\"%1\" duration=\"%2\" ")
+                    .arg(rec.context.startFrame)
+                    .arg(rec.context.duration);
+            }
 	    
-            //!!! 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\" domain=\"%4\" stepSize=\"%5\" blockSize=\"%6\" windowType=\"%7\" transform=\"%8\"")
+	    out << QString("  <derivation source=\"%1\" model=\"%2\" channel=\"%3\" domain=\"%4\" stepSize=\"%5\" blockSize=\"%6\" %7windowType=\"%8\" transform=\"%9\"")
 		.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(extentsAttributes)
                 .arg(int(rec.context.windowType))
 		.arg(XmlExportable::encodeEntities(rec.transform));