comparison audioio/AudioGenerator.cpp @ 229:8c13e8219903 debug-output

Convert many cerrs to DEBUGs
author Chris Cannam
date Mon, 16 May 2011 17:19:40 +0100
parents 67cea66bd588
children 8aace2d9f1c2
comparison
equal deleted inserted replaced
228:67cea66bd588 229:8c13e8219903
64 } 64 }
65 65
66 AudioGenerator::~AudioGenerator() 66 AudioGenerator::~AudioGenerator()
67 { 67 {
68 #ifdef DEBUG_AUDIO_GENERATOR 68 #ifdef DEBUG_AUDIO_GENERATOR
69 std::cerr << "AudioGenerator::~AudioGenerator" << std::endl; 69 DEBUG << "AudioGenerator::~AudioGenerator" << endl;
70 #endif 70 #endif
71 } 71 }
72 72
73 void 73 void
74 AudioGenerator::initialiseSampleDir() 74 AudioGenerator::initialiseSampleDir()
158 158
159 void 159 void
160 AudioGenerator::playPluginConfigurationChanged(const Playable *playable, 160 AudioGenerator::playPluginConfigurationChanged(const Playable *playable,
161 QString configurationXml) 161 QString configurationXml)
162 { 162 {
163 // std::cerr << "AudioGenerator::playPluginConfigurationChanged" << std::endl; 163 // DEBUG << "AudioGenerator::playPluginConfigurationChanged" << endl;
164 164
165 const Model *model = dynamic_cast<const Model *>(playable); 165 const Model *model = dynamic_cast<const Model *>(playable);
166 if (!model) { 166 if (!model) {
167 std::cerr << "WARNING: AudioGenerator::playPluginIdChanged: playable " 167 std::cerr << "WARNING: AudioGenerator::playPluginIdChanged: playable "
168 << playable << " is not a supported model type" 168 << playable << " is not a supported model type"
169 << std::endl; 169 << std::endl;
170 return; 170 return;
171 } 171 }
172 172
173 if (m_synthMap.find(model) == m_synthMap.end()) { 173 if (m_synthMap.find(model) == m_synthMap.end()) {
174 std::cerr << "AudioGenerator::playPluginConfigurationChanged: We don't know about this plugin" << std::endl; 174 DEBUG << "AudioGenerator::playPluginConfigurationChanged: We don't know about this plugin" << endl;
175 return; 175 return;
176 } 176 }
177 177
178 RealTimePluginInstance *plugin = m_synthMap[model]; 178 RealTimePluginInstance *plugin = m_synthMap[model];
179 if (plugin) { 179 if (plugin) {
307 void 307 void
308 AudioGenerator::setTargetChannelCount(size_t targetChannelCount) 308 AudioGenerator::setTargetChannelCount(size_t targetChannelCount)
309 { 309 {
310 if (m_targetChannelCount == targetChannelCount) return; 310 if (m_targetChannelCount == targetChannelCount) return;
311 311
312 // std::cerr << "AudioGenerator::setTargetChannelCount(" << targetChannelCount << ")" << std::endl; 312 // DEBUG << "AudioGenerator::setTargetChannelCount(" << targetChannelCount << ")" << endl;
313 313
314 QMutexLocker locker(&m_mutex); 314 QMutexLocker locker(&m_mutex);
315 m_targetChannelCount = targetChannelCount; 315 m_targetChannelCount = targetChannelCount;
316 316
317 for (PluginMap::iterator i = m_synthMap.begin(); i != m_synthMap.end(); ++i) { 317 for (PluginMap::iterator i = m_synthMap.begin(); i != m_synthMap.end(); ++i) {
462 462
463 for (size_t c = 0; c < m_targetChannelCount; ++c) { 463 for (size_t c = 0; c < m_targetChannelCount; ++c) {
464 464
465 size_t sourceChannel = (c % modelChannels); 465 size_t sourceChannel = (c % modelChannels);
466 466
467 // std::cerr << "mixing channel " << c << " from source channel " << sourceChannel << std::endl; 467 // DEBUG << "mixing channel " << c << " from source channel " << sourceChannel << endl;
468 468
469 float channelGain = gain; 469 float channelGain = gain;
470 if (pan != 0.0) { 470 if (pan != 0.0) {
471 if (c == 0) { 471 if (c == 0) {
472 if (pan > 0.0) channelGain *= 1.0 - pan; 472 if (pan > 0.0) channelGain *= 1.0 - pan;