diff document/SVFileReader.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 aaf806ce329a
children 7b943924b8d3
line wrap: on
line diff
--- a/document/SVFileReader.cpp	Sat Sep 29 10:58:31 2007 +0000
+++ b/document/SVFileReader.cpp	Mon Oct 01 13:48:38 2007 +0000
@@ -1013,6 +1013,24 @@
     int windowType = attributes.value("windowType").trimmed().toInt(&ok);
     if (ok) m_currentTransformContext.windowType = WindowType(windowType);
 
+    QString startFrameStr = attributes.value("startFrame");
+    QString durationStr = attributes.value("duration");
+
+    size_t startFrame = 0;
+    size_t duration = 0;
+
+    if (startFrameStr != "") {
+        startFrame = startFrameStr.trimmed().toInt(&ok);
+        if (!ok) startFrame = 0;
+    }
+    if (durationStr != "") {
+        duration = durationStr.trimmed().toInt(&ok);
+        if (!ok) duration = 0;
+    }
+
+    m_currentTransformContext.startFrame = startFrame;
+    m_currentTransformContext.duration = duration;
+
     return true;
 }