comparison data/model/WritableWaveFileModel.cpp @ 687:06f13a3b9e9e debug-output

Convert many cerrs to DEBUGs
author Chris Cannam
date Mon, 16 May 2011 17:19:09 +0100
parents b4a8d8221eaf
children 573d45e9487b
comparison
equal deleted inserted replaced
686:b4a8d8221eaf 687:06f13a3b9e9e
104 WritableWaveFileModel::addSamples(float **samples, size_t count) 104 WritableWaveFileModel::addSamples(float **samples, size_t count)
105 { 105 {
106 if (!m_writer) return false; 106 if (!m_writer) return false;
107 107
108 #ifdef DEBUG_WRITABLE_WAVE_FILE_MODEL 108 #ifdef DEBUG_WRITABLE_WAVE_FILE_MODEL
109 // std::cerr << "WritableWaveFileModel::addSamples(" << count << ")" << std::endl; 109 // DEBUG << "WritableWaveFileModel::addSamples(" << count << ")" << endl;
110 #endif 110 #endif
111 111
112 if (!m_writer->writeSamples(samples, count)) { 112 if (!m_writer->writeSamples(samples, count)) {
113 std::cerr << "ERROR: WritableWaveFileModel::addSamples: writer failed: " << m_writer->getError() << std::endl; 113 std::cerr << "ERROR: WritableWaveFileModel::addSamples: writer failed: " << m_writer->getError() << std::endl;
114 return false; 114 return false;
118 118
119 static int updateCounter = 0; 119 static int updateCounter = 0;
120 120
121 if (m_reader && m_reader->getChannelCount() == 0) { 121 if (m_reader && m_reader->getChannelCount() == 0) {
122 #ifdef DEBUG_WRITABLE_WAVE_FILE_MODEL 122 #ifdef DEBUG_WRITABLE_WAVE_FILE_MODEL
123 std::cerr << "WritableWaveFileModel::addSamples(" << count << "): calling updateFrameCount (initial)" << std::endl; 123 DEBUG << "WritableWaveFileModel::addSamples(" << count << "): calling updateFrameCount (initial)" << endl;
124 #endif 124 #endif
125 m_reader->updateFrameCount(); 125 m_reader->updateFrameCount();
126 } else if (++updateCounter == 100) { 126 } else if (++updateCounter == 100) {
127 #ifdef DEBUG_WRITABLE_WAVE_FILE_MODEL 127 #ifdef DEBUG_WRITABLE_WAVE_FILE_MODEL
128 std::cerr << "WritableWaveFileModel::addSamples(" << count << "): calling updateFrameCount (periodic)" << std::endl; 128 DEBUG << "WritableWaveFileModel::addSamples(" << count << "): calling updateFrameCount (periodic)" << endl;
129 #endif 129 #endif
130 if (m_reader) m_reader->updateFrameCount(); 130 if (m_reader) m_reader->updateFrameCount();
131 updateCounter = 0; 131 updateCounter = 0;
132 } 132 }
133 133
136 136
137 bool 137 bool
138 WritableWaveFileModel::isOK() const 138 WritableWaveFileModel::isOK() const
139 { 139 {
140 bool ok = (m_writer && m_writer->isOK()); 140 bool ok = (m_writer && m_writer->isOK());
141 // std::cerr << "WritableWaveFileModel::isOK(): ok = " << ok << std::endl; 141 // DEBUG << "WritableWaveFileModel::isOK(): ok = " << ok << endl;
142 return ok; 142 return ok;
143 } 143 }
144 144
145 bool 145 bool
146 WritableWaveFileModel::isReady(int *completion) const 146 WritableWaveFileModel::isReady(int *completion) const
159 } 159 }
160 160
161 size_t 161 size_t
162 WritableWaveFileModel::getFrameCount() const 162 WritableWaveFileModel::getFrameCount() const
163 { 163 {
164 // std::cerr << "WritableWaveFileModel::getFrameCount: count = " << m_frameCount << std::endl; 164 // DEBUG << "WritableWaveFileModel::getFrameCount: count = " << m_frameCount << endl;
165 return m_frameCount; 165 return m_frameCount;
166 } 166 }
167 167
168 Model * 168 Model *
169 WritableWaveFileModel::clone() const 169 WritableWaveFileModel::clone() const