Mercurial > hg > svapp
comparison audio/AudioCallbackPlaySource.cpp @ 568:022d6a9e6d75 3.0-integration
Merge from branch svg, and thus (in some subrepos) from levelpanwidget
author | Chris Cannam |
---|---|
date | Mon, 19 Dec 2016 16:34:38 +0000 |
parents | 36076ef960fb |
children | 6f54789f3127 |
comparison
equal
deleted
inserted
replaced
563:ce3818cd16c5 | 568:022d6a9e6d75 |
---|---|
176 cout << "AudioCallbackPlaySource: Adding model with " << modelChannels << " channels at rate " << model->getSampleRate() << endl; | 176 cout << "AudioCallbackPlaySource: Adding model with " << modelChannels << " channels at rate " << model->getSampleRate() << endl; |
177 #endif | 177 #endif |
178 | 178 |
179 if (m_sourceSampleRate == 0) { | 179 if (m_sourceSampleRate == 0) { |
180 | 180 |
181 SVDEBUG << "AudioCallbackPlaySource::addModel: Source rate changing from 0 to " | |
182 << model->getSampleRate() << endl; | |
183 | |
181 m_sourceSampleRate = model->getSampleRate(); | 184 m_sourceSampleRate = model->getSampleRate(); |
182 srChanged = true; | 185 srChanged = true; |
183 | 186 |
184 } else if (model->getSampleRate() != m_sourceSampleRate) { | 187 } else if (model->getSampleRate() != m_sourceSampleRate) { |
185 | 188 |
220 | 223 |
221 emit sampleRateMismatch(model->getSampleRate(), | 224 emit sampleRateMismatch(model->getSampleRate(), |
222 m_sourceSampleRate, | 225 m_sourceSampleRate, |
223 false); | 226 false); |
224 } else { | 227 } else { |
228 SVDEBUG << "AudioCallbackPlaySource::addModel: Source rate changing from " | |
229 << m_sourceSampleRate << " to " << model->getSampleRate() << endl; | |
230 | |
225 m_sourceSampleRate = model->getSampleRate(); | 231 m_sourceSampleRate = model->getSampleRate(); |
226 srChanged = true; | 232 srChanged = true; |
227 } | 233 } |
228 } | 234 } |
229 } | 235 } |
315 disconnect(model, SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t)), | 321 disconnect(model, SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t)), |
316 this, SLOT(modelChangedWithin(sv_frame_t, sv_frame_t))); | 322 this, SLOT(modelChangedWithin(sv_frame_t, sv_frame_t))); |
317 | 323 |
318 m_models.erase(model); | 324 m_models.erase(model); |
319 | 325 |
320 if (m_models.empty()) { | 326 // I don't think we have to do this any more: if a new model is |
321 m_sourceSampleRate = 0; | 327 // loaded at a different rate, we'll hit the non-conflicting path |
322 } | 328 // in addModel and the rate will be updated without problems; but |
329 // if a new model is loaded at the rate that we were using for the | |
330 // last one, then we save work by not having reset this here | |
331 // | |
332 // if (m_models.empty()) { | |
333 // m_sourceSampleRate = 0; | |
334 // } | |
323 | 335 |
324 sv_frame_t lastEnd = 0; | 336 sv_frame_t lastEnd = 0; |
325 for (std::set<Model *>::const_iterator i = m_models.begin(); | 337 for (std::set<Model *>::const_iterator i = m_models.begin(); |
326 i != m_models.end(); ++i) { | 338 i != m_models.end(); ++i) { |
327 #ifdef DEBUG_AUDIO_PLAY_SOURCE | 339 #ifdef DEBUG_AUDIO_PLAY_SOURCE |