comparison audio/AudioCallbackPlaySource.cpp @ 765:eae885290abc

Profiling points and comment
author Chris Cannam
date Thu, 14 May 2020 16:38:37 +0100
parents e7c77c366360
children
comparison
equal deleted inserted replaced
764:4c91c95e146a 765:eae885290abc
169 void 169 void
170 AudioCallbackPlaySource::addModel(ModelId modelId) 170 AudioCallbackPlaySource::addModel(ModelId modelId)
171 { 171 {
172 if (m_models.find(modelId) != m_models.end()) return; 172 if (m_models.find(modelId) != m_models.end()) return;
173 173
174 Profiler profiler("AudioCallbackPlaySource::addModel");
175
174 bool willPlay = m_audioGenerator->addModel(modelId); 176 bool willPlay = m_audioGenerator->addModel(modelId);
175 177
176 auto model = ModelById::get(modelId); 178 auto model = ModelById::get(modelId);
177 if (!model) return; 179 if (!model) return;
178 180
198 #endif 200 #endif
199 201
200 if (m_sourceSampleRate == 0) { 202 if (m_sourceSampleRate == 0) {
201 203
202 SVDEBUG << "AudioCallbackPlaySource::addModel: Source rate changing from 0 to " 204 SVDEBUG << "AudioCallbackPlaySource::addModel: Source rate changing from 0 to "
203 << model->getSampleRate() << endl; 205 << model->getSampleRate() << endl;
204 206
205 m_sourceSampleRate = model->getSampleRate(); 207 m_sourceSampleRate = model->getSampleRate();
206 srChanged = true; 208 srChanged = true;
207 209
208 } else if (model->getSampleRate() != m_sourceSampleRate) { 210 } else if (model->getSampleRate() != m_sourceSampleRate) {
330 AudioCallbackPlaySource::removeModel(ModelId modelId) 332 AudioCallbackPlaySource::removeModel(ModelId modelId)
331 { 333 {
332 auto model = ModelById::get(modelId); 334 auto model = ModelById::get(modelId);
333 if (!model) return; 335 if (!model) return;
334 336
337 Profiler profiler("AudioCallbackPlaySource::removeModel");
338
335 m_mutex.lock(); 339 m_mutex.lock();
336 340
337 #ifdef DEBUG_AUDIO_PLAY_SOURCE 341 #ifdef DEBUG_AUDIO_PLAY_SOURCE
338 cout << "AudioCallbackPlaySource::removeModel(" << modelId << ")" << endl; 342 cout << "AudioCallbackPlaySource::removeModel(" << modelId << ")" << endl;
339 #endif 343 #endif
883 } 887 }
884 888
885 void 889 void
886 AudioCallbackPlaySource::rebuildRangeLists() 890 AudioCallbackPlaySource::rebuildRangeLists()
887 { 891 {
892 Profiler profiler("AudioCallbackPlaySource::rebuildRangeLists");
893
888 bool constrained = (m_viewManager->getPlaySelectionMode()); 894 bool constrained = (m_viewManager->getPlaySelectionMode());
889 895
890 m_rangeStarts.clear(); 896 m_rangeStarts.clear();
891 m_rangeDurations.clear(); 897 m_rangeDurations.clear();
892 898