Mercurial > hg > sonic-visualiser
comparison 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 |
comparison
equal
deleted
inserted
replaced
183:3fdaf3157eea | 184:ebd906049fb6 |
---|---|
1011 if (ok) m_currentTransformContext.blockSize = blockSize; | 1011 if (ok) m_currentTransformContext.blockSize = blockSize; |
1012 | 1012 |
1013 int windowType = attributes.value("windowType").trimmed().toInt(&ok); | 1013 int windowType = attributes.value("windowType").trimmed().toInt(&ok); |
1014 if (ok) m_currentTransformContext.windowType = WindowType(windowType); | 1014 if (ok) m_currentTransformContext.windowType = WindowType(windowType); |
1015 | 1015 |
1016 QString startFrameStr = attributes.value("startFrame"); | |
1017 QString durationStr = attributes.value("duration"); | |
1018 | |
1019 size_t startFrame = 0; | |
1020 size_t duration = 0; | |
1021 | |
1022 if (startFrameStr != "") { | |
1023 startFrame = startFrameStr.trimmed().toInt(&ok); | |
1024 if (!ok) startFrame = 0; | |
1025 } | |
1026 if (durationStr != "") { | |
1027 duration = durationStr.trimmed().toInt(&ok); | |
1028 if (!ok) duration = 0; | |
1029 } | |
1030 | |
1031 m_currentTransformContext.startFrame = startFrame; | |
1032 m_currentTransformContext.duration = duration; | |
1033 | |
1016 return true; | 1034 return true; |
1017 } | 1035 } |
1018 | 1036 |
1019 bool | 1037 bool |
1020 SVFileReader::readPlayParameters(const QXmlAttributes &attributes) | 1038 SVFileReader::readPlayParameters(const QXmlAttributes &attributes) |