comparison audioio/AudioGenerator.cpp @ 445:c48bc6ddfe17 tonioni

Remove some debug; set some gain values
author Chris Cannam
date Tue, 31 Mar 2015 13:06:29 +0100
parents 88ae0e53a5da
children 3485d324c172
comparison
equal deleted inserted replaced
444:ba789baf642b 445:c48bc6ddfe17
215 PlayParameterRepository::getInstance()->getPlayParameters(playable); 215 PlayParameterRepository::getInstance()->getPlayParameters(playable);
216 if (parameters) { 216 if (parameters) {
217 clipId = parameters->getPlayClipId(); 217 clipId = parameters->getPlayClipId();
218 } 218 }
219 219
220 #ifdef DEBUG_AUDIO_GENERATOR
220 std::cerr << "AudioGenerator::makeClipMixerFor(" << model << "): sample id = " << clipId << std::endl; 221 std::cerr << "AudioGenerator::makeClipMixerFor(" << model << "): sample id = " << clipId << std::endl;
222 #endif
221 223
222 if (clipId == "") { 224 if (clipId == "") {
223 SVDEBUG << "AudioGenerator::makeClipMixerFor(" << model << "): no sample, skipping" << endl; 225 SVDEBUG << "AudioGenerator::makeClipMixerFor(" << model << "): no sample, skipping" << endl;
224 return 0; 226 return 0;
225 } 227 }
236 if (!mixer->loadClipData(clipPath, clipF0, level)) { 238 if (!mixer->loadClipData(clipPath, clipF0, level)) {
237 delete mixer; 239 delete mixer;
238 return 0; 240 return 0;
239 } 241 }
240 242
243 #ifdef DEBUG_AUDIO_GENERATOR
241 std::cerr << "AudioGenerator::makeClipMixerFor(" << model << "): loaded clip " << clipId << std::endl; 244 std::cerr << "AudioGenerator::makeClipMixerFor(" << model << "): loaded clip " << clipId << std::endl;
245 #endif
242 246
243 return mixer; 247 return mixer;
244 } 248 }
245 249
246 ContinuousSynth * 250 ContinuousSynth *
252 ContinuousSynth *synth = new ContinuousSynth(m_targetChannelCount, 256 ContinuousSynth *synth = new ContinuousSynth(m_targetChannelCount,
253 m_sourceSampleRate, 257 m_sourceSampleRate,
254 m_processingBlockSize, 258 m_processingBlockSize,
255 m_waveType); 259 m_waveType);
256 260
261 #ifdef DEBUG_AUDIO_GENERATOR
257 std::cerr << "AudioGenerator::makeSynthFor(" << model << "): created synth" << std::endl; 262 std::cerr << "AudioGenerator::makeSynthFor(" << model << "): created synth" << std::endl;
263 #endif
258 264
259 return synth; 265 return synth;
260 } 266 }
261 267
262 void 268 void
290 void 296 void
291 AudioGenerator::reset() 297 AudioGenerator::reset()
292 { 298 {
293 QMutexLocker locker(&m_mutex); 299 QMutexLocker locker(&m_mutex);
294 300
301 #ifdef DEBUG_AUDIO_GENERATOR
295 cerr << "AudioGenerator::reset()" << endl; 302 cerr << "AudioGenerator::reset()" << endl;
303 #endif
296 304
297 for (ClipMixerMap::iterator i = m_clipMixerMap.begin(); i != m_clipMixerMap.end(); ++i) { 305 for (ClipMixerMap::iterator i = m_clipMixerMap.begin(); i != m_clipMixerMap.end(); ++i) {
298 if (i->second) { 306 if (i->second) {
299 i->second->reset(); 307 i->second->reset();
300 } 308 }