comparison audioio/AudioGenerator.cpp @ 233:8aace2d9f1c2

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:27:12 +0100
parents 8c13e8219903
children a98f1638c5ec eb9a16538173 64724dbc5f05
comparison
equal deleted inserted replaced
232:025065fd5b49 233:8aace2d9f1c2
64 } 64 }
65 65
66 AudioGenerator::~AudioGenerator() 66 AudioGenerator::~AudioGenerator()
67 { 67 {
68 #ifdef DEBUG_AUDIO_GENERATOR 68 #ifdef DEBUG_AUDIO_GENERATOR
69 DEBUG << "AudioGenerator::~AudioGenerator" << endl; 69 SVDEBUG << "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 // DEBUG << "AudioGenerator::playPluginConfigurationChanged" << endl; 163 // SVDEBUG << "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 DEBUG << "AudioGenerator::playPluginConfigurationChanged: We don't know about this plugin" << endl; 174 SVDEBUG << "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 // DEBUG << "AudioGenerator::setTargetChannelCount(" << targetChannelCount << ")" << endl; 312 // SVDEBUG << "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 // DEBUG << "mixing channel " << c << " from source channel " << sourceChannel << endl; 467 // SVDEBUG << "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;