changeset 236:3e6fee4e4257

* remove some debug and some obsolete moc file includes
author Chris Cannam
date Mon, 26 Feb 2007 14:55:08 +0000
parents 84ff7ba52993
children 3a6af0e5e2d1
files data/data.pro data/fft/FFTDataServer.cpp data/fileio/MatrixFile.cpp data/model/DenseTimeValueModel.cpp data/model/EditableDenseThreeDimensionalModel.cpp data/model/Model.cpp data/model/RangeSummarisableTimeValueModel.cpp data/model/WaveFileModel.cpp
diffstat 8 files changed, 36 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/data/data.pro	Fri Feb 16 15:47:23 2007 +0000
+++ b/data/data.pro	Mon Feb 26 14:55:08 2007 +0000
@@ -79,6 +79,5 @@
            model/NoteModel.cpp \
            model/PowerOfSqrtTwoZoomConstraint.cpp \
            model/PowerOfTwoZoomConstraint.cpp \
-           model/RangeSummarisableTimeValueModel.cpp \
            model/WaveFileModel.cpp \
            model/WritableWaveFileModel.cpp
--- a/data/fft/FFTDataServer.cpp	Fri Feb 16 15:47:23 2007 +0000
+++ b/data/fft/FFTDataServer.cpp	Mon Feb 26 14:55:08 2007 +0000
@@ -30,7 +30,7 @@
 #include <QApplication>
 
 
-#define DEBUG_FFT_SERVER 1
+//#define DEBUG_FFT_SERVER 1
 //#define DEBUG_FFT_SERVER_FILL 1
 
 #ifdef DEBUG_FFT_SERVER_FILL
--- a/data/fileio/MatrixFile.cpp	Fri Feb 16 15:47:23 2007 +0000
+++ b/data/fileio/MatrixFile.cpp	Mon Feb 26 14:55:08 2007 +0000
@@ -134,7 +134,7 @@
     } else {
         size_t header[2];
         if (::read(m_fd, header, 2 * sizeof(size_t)) < 0) {
-            perror("Read failed");
+            ::perror("MatrixFile::MatrixFile: read failed");
             std::cerr << "ERROR: MatrixFile::MatrixFile: "
                       << "Failed to read header (fd " << m_fd << ", file \""
                       << fileName.toStdString() << "\")" << std::endl;
@@ -359,6 +359,9 @@
     
     if (r < 0) {
         ::perror("MatrixFile::getColumnAt: read failed");
+        std::cerr << "ERROR: MatrixFile::getColumnAt: "
+                  << "Failed to read column " << x << " (height " << m_height << ", cell size " << m_cellSize << ", fd " << m_fd << ", file \""
+                  << m_fileName.toStdString() << "\")" << std::endl;
         throw FileReadFailed(m_fileName);
     }
 
--- a/data/model/DenseTimeValueModel.cpp	Fri Feb 16 15:47:23 2007 +0000
+++ b/data/model/DenseTimeValueModel.cpp	Mon Feb 26 14:55:08 2007 +0000
@@ -21,8 +21,3 @@
     PlayParameterRepository::getInstance()->addModel(this);
 }
 	
-
-#ifdef INCLUDE_MOCFILES
-#include "DenseTimeValueModel.moc.cpp"
-#endif
-
--- a/data/model/EditableDenseThreeDimensionalModel.cpp	Fri Feb 16 15:47:23 2007 +0000
+++ b/data/model/EditableDenseThreeDimensionalModel.cpp	Mon Feb 26 14:55:08 2007 +0000
@@ -317,7 +317,3 @@
     return s;
 }
 
-#ifdef INCLUDE_MOCFILES
-#include "EditableDenseThreeDimensionalModel.moc.cpp"
-#endif
-
--- a/data/model/Model.cpp	Fri Feb 16 15:47:23 2007 +0000
+++ b/data/model/Model.cpp	Mon Feb 26 14:55:08 2007 +0000
@@ -65,7 +65,3 @@
     return s;
 }
 
-#ifdef INCLUDE_MOCFILES
-#include "Model.moc.cpp"
-#endif
-
--- a/data/model/RangeSummarisableTimeValueModel.cpp	Fri Feb 16 15:47:23 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-
-#ifdef INCLUDE_MOCFILES
-#include "RangeSummarisableTimeValueModel.moc.cpp"
-#endif
-
--- a/data/model/WaveFileModel.cpp	Fri Feb 16 15:47:23 2007 +0000
+++ b/data/model/WaveFileModel.cpp	Mon Feb 26 14:55:08 2007 +0000
@@ -30,6 +30,8 @@
 
 #include <cassert>
 
+//#define DEBUG_WAVE_FILE_MODEL 1
+
 using std::cerr;
 using std::endl;
 
@@ -95,7 +97,9 @@
     bool ready = (isOK() && (m_fillThread == 0));
     double c = double(m_lastFillExtent) / double(getEndFrame() - getStartFrame());
     if (completion) *completion = int(c * 100.0 + 0.01);
-//    std::cerr << "WaveFileModel::isReady(): ready = " << ready << ", completion = " << (completion ? *completion : -1) << std::endl;
+#ifdef DEBUG_WAVE_FILE_MODEL
+    std::cerr << "WaveFileModel::isReady(): ready = " << ready << ", completion = " << (completion ? *completion : -1) << std::endl;
+#endif
     return ready;
 }
 
@@ -143,8 +147,10 @@
 
     if (!m_reader || !m_reader->isOK()) return 0;
 
-//    std::cerr << "WaveFileModel::getValues(" << channel << ", "
-//              << start << ", " << end << "): calling reader" << std::endl;
+#ifdef DEBUG_WAVE_FILE_MODEL
+    std::cerr << "WaveFileModel::getValues(" << channel << ", "
+              << start << ", " << end << "): calling reader" << std::endl;
+#endif
 
     SampleBlock frames;
     m_reader->getInterleavedFrames(start, end - start, frames);
@@ -300,7 +306,9 @@
 	float max = 0.0, min = 0.0, total = 0.0;
 	size_t i = 0, count = 0;
 
+#ifdef DEBUG_WAVE_FILE_MODEL
 	cerr << "blockSize is " << blockSize << ", cacheBlock " << cacheBlock << ", start " << start << ", end " << end << " (frame count " << getFrameCount() << "), power is " << power << ", div is " << div << ", startIndex " << startIndex << ", endIndex " << endIndex << endl;
+#endif
 
 	for (i = 0; i < endIndex - startIndex; ) {
         
@@ -327,7 +335,9 @@
 	}
     }
 
+#ifdef DEBUG_WAVE_FILE_MODEL
     cerr << "returning " << ranges.size() << " ranges" << endl;
+#endif
     return;
 }
 
@@ -396,7 +406,9 @@
     m_mutex.unlock();
     m_fillThread->start();
 
-//    std::cerr << "WaveFileModel::fillCache: started fill thread" << std::endl;
+#ifdef DEBUG_WAVE_FILE_MODEL
+    std::cerr << "WaveFileModel::fillCache: started fill thread" << std::endl;
+#endif
 }   
 
 void
@@ -404,13 +416,17 @@
 {
     if (m_fillThread) {
 	size_t fillExtent = m_fillThread->getFillExtent();
-//        cerr << "WaveFileModel::fillTimerTimedOut: extent = " << fillExtent << endl;
+#ifdef DEBUG_WAVE_FILE_MODEL
+        cerr << "WaveFileModel::fillTimerTimedOut: extent = " << fillExtent << endl;
+#endif
 	if (fillExtent > m_lastFillExtent) {
 	    emit modelChanged(m_lastFillExtent, fillExtent);
 	    m_lastFillExtent = fillExtent;
 	}
     } else {
-//        cerr << "WaveFileModel::fillTimerTimedOut: no thread" << std::endl;
+#ifdef DEBUG_WAVE_FILE_MODEL
+        cerr << "WaveFileModel::fillTimerTimedOut: no thread" << std::endl;
+#endif
 	emit modelChanged();
     }
 }
@@ -425,7 +441,9 @@
     m_updateTimer = 0;
     m_mutex.unlock();
     emit modelChanged();
-//    cerr << "WaveFileModel::cacheFilled" << endl;
+#ifdef DEBUG_WAVE_FILE_MODEL
+    cerr << "WaveFileModel::cacheFilled" << endl;
+#endif
 }
 
 void
@@ -553,10 +571,12 @@
     delete[] range;
 
     m_fillExtent = m_frameCount;
-        
-//    for (size_t ct = 0; ct < 2; ++ct) {
-//        cerr << "Cache type " << ct << " now contains " << m_model.m_cache[ct].size() << " ranges" << endl;
-//    }
+
+#ifdef DEBUG_WAVE_FILE_MODEL        
+    for (size_t ct = 0; ct < 2; ++ct) {
+        cerr << "Cache type " << ct << " now contains " << m_model.m_cache[ct].size() << " ranges" << endl;
+    }
+#endif
 }
 
 void
@@ -578,10 +598,3 @@
 			      .arg(m_path).arg(extraAttributes));
 }
     
-
-#ifdef INCLUDE_MOCFILES
-#ifdef INCLUDE_MOCFILES
-#include "WaveFileModel.moc.cpp"
-#endif
-#endif
-