diff document/SVFileReader.cpp @ 3:e764bbf2b090 last-cc-copyright

* Move the current DenseThreeDimensionalModel to EditableDenseThreeDimensionalModel (wow!), and make DTDM an abstract base * Move FFTFuzzyAdapter to FFTModel as a new subclass of DTDM
author Chris Cannam
date Mon, 31 Jul 2006 17:05:18 +0000
parents 40116f709d3b
children 56e1d4242bb4
line wrap: on
line diff
--- a/document/SVFileReader.cpp	Mon Jul 31 16:15:45 2006 +0000
+++ b/document/SVFileReader.cpp	Mon Jul 31 17:05:18 2006 +0000
@@ -23,7 +23,7 @@
 #include "data/fileio/AudioFileReaderFactory.h"
 
 #include "data/model/WaveFileModel.h"
-#include "data/model/DenseThreeDimensionalModel.h"
+#include "data/model/EditableDenseThreeDimensionalModel.h"
 #include "data/model/SparseOneDimensionalModel.h"
 #include "data/model/SparseTimeValueModel.h"
 #include "data/model/NoteModel.h"
@@ -423,8 +423,9 @@
 	    READ_MANDATORY(int, windowSize, toInt);
 	    READ_MANDATORY(int, yBinCount, toInt);
 	    
-	    DenseThreeDimensionalModel *model =
-		new DenseThreeDimensionalModel(sampleRate, windowSize, yBinCount);
+            EditableDenseThreeDimensionalModel *model =
+		new EditableDenseThreeDimensionalModel
+                (sampleRate, windowSize, yBinCount);
 	    
 	    float minimum = attributes.value("minimum").trimmed().toFloat(&ok);
 	    if (ok) model->setMinimumLevel(minimum);
@@ -710,7 +711,7 @@
 
     case 3:
 	if (dynamic_cast<NoteModel *>(model)) good = true;
-	else if (dynamic_cast<DenseThreeDimensionalModel *>(model)) {
+	else if (dynamic_cast<EditableDenseThreeDimensionalModel *>(model)) {
 	    m_datasetSeparator = attributes.value("separator");
 	    good = true;
 	}
@@ -784,7 +785,8 @@
 bool
 SVFileReader::addBinToDataset(const QXmlAttributes &attributes)
 {
-    DenseThreeDimensionalModel *dtdm = dynamic_cast<DenseThreeDimensionalModel *>
+    EditableDenseThreeDimensionalModel *dtdm = 
+        dynamic_cast<EditableDenseThreeDimensionalModel *>
 	(m_currentDataset);
 
     if (dtdm) {
@@ -832,7 +834,8 @@
 bool
 SVFileReader::readRowData(const QString &text)
 {
-    DenseThreeDimensionalModel *dtdm = dynamic_cast<DenseThreeDimensionalModel *>
+    EditableDenseThreeDimensionalModel *dtdm =
+        dynamic_cast<EditableDenseThreeDimensionalModel *>
 	(m_currentDataset);
 
     bool warned = false;
@@ -863,7 +866,7 @@
 	    }
 	}
 
-	size_t windowStartFrame = m_rowNumber * dtdm->getWindowSize();
+	size_t windowStartFrame = m_rowNumber * dtdm->getResolution();
 
 	dtdm->setBinValues(windowStartFrame, values);
 	return true;