comparison data/model/WritableWaveFileModel.cpp @ 690:1424aa29ae95

Seems to be a bad idea to use plain DEBUG symbol on OS/X (system wants it)
author Chris Cannam
date Tue, 14 Jun 2011 15:26:52 +0100
parents 573d45e9487b
children 21d39720d5da
comparison
equal deleted inserted replaced
689:573d45e9487b 690:1424aa29ae95
107 WritableWaveFileModel::addSamples(float **samples, size_t count) 107 WritableWaveFileModel::addSamples(float **samples, size_t count)
108 { 108 {
109 if (!m_writer) return false; 109 if (!m_writer) return false;
110 110
111 #ifdef DEBUG_WRITABLE_WAVE_FILE_MODEL 111 #ifdef DEBUG_WRITABLE_WAVE_FILE_MODEL
112 // DEBUG << "WritableWaveFileModel::addSamples(" << count << ")" << endl; 112 // SVDEBUG << "WritableWaveFileModel::addSamples(" << count << ")" << endl;
113 #endif 113 #endif
114 114
115 if (!m_writer->writeSamples(samples, count)) { 115 if (!m_writer->writeSamples(samples, count)) {
116 std::cerr << "ERROR: WritableWaveFileModel::addSamples: writer failed: " << m_writer->getError() << std::endl; 116 std::cerr << "ERROR: WritableWaveFileModel::addSamples: writer failed: " << m_writer->getError() << std::endl;
117 return false; 117 return false;
121 121
122 static int updateCounter = 0; 122 static int updateCounter = 0;
123 123
124 if (m_reader && m_reader->getChannelCount() == 0) { 124 if (m_reader && m_reader->getChannelCount() == 0) {
125 #ifdef DEBUG_WRITABLE_WAVE_FILE_MODEL 125 #ifdef DEBUG_WRITABLE_WAVE_FILE_MODEL
126 DEBUG << "WritableWaveFileModel::addSamples(" << count << "): calling updateFrameCount (initial)" << endl; 126 SVDEBUG << "WritableWaveFileModel::addSamples(" << count << "): calling updateFrameCount (initial)" << endl;
127 #endif 127 #endif
128 m_reader->updateFrameCount(); 128 m_reader->updateFrameCount();
129 } else if (++updateCounter == 100) { 129 } else if (++updateCounter == 100) {
130 #ifdef DEBUG_WRITABLE_WAVE_FILE_MODEL 130 #ifdef DEBUG_WRITABLE_WAVE_FILE_MODEL
131 DEBUG << "WritableWaveFileModel::addSamples(" << count << "): calling updateFrameCount (periodic)" << endl; 131 SVDEBUG << "WritableWaveFileModel::addSamples(" << count << "): calling updateFrameCount (periodic)" << endl;
132 #endif 132 #endif
133 if (m_reader) m_reader->updateFrameCount(); 133 if (m_reader) m_reader->updateFrameCount();
134 updateCounter = 0; 134 updateCounter = 0;
135 } 135 }
136 136
139 139
140 bool 140 bool
141 WritableWaveFileModel::isOK() const 141 WritableWaveFileModel::isOK() const
142 { 142 {
143 bool ok = (m_writer && m_writer->isOK()); 143 bool ok = (m_writer && m_writer->isOK());
144 // DEBUG << "WritableWaveFileModel::isOK(): ok = " << ok << endl; 144 // SVDEBUG << "WritableWaveFileModel::isOK(): ok = " << ok << endl;
145 return ok; 145 return ok;
146 } 146 }
147 147
148 bool 148 bool
149 WritableWaveFileModel::isReady(int *completion) const 149 WritableWaveFileModel::isReady(int *completion) const
162 } 162 }
163 163
164 size_t 164 size_t
165 WritableWaveFileModel::getFrameCount() const 165 WritableWaveFileModel::getFrameCount() const
166 { 166 {
167 // DEBUG << "WritableWaveFileModel::getFrameCount: count = " << m_frameCount << endl; 167 // SVDEBUG << "WritableWaveFileModel::getFrameCount: count = " << m_frameCount << endl;
168 return m_frameCount; 168 return m_frameCount;
169 } 169 }
170 170
171 Model * 171 Model *
172 WritableWaveFileModel::clone() const 172 WritableWaveFileModel::clone() const