comparison data/model/WaveFileModel.cpp @ 177:aff66ec5aea4

* Audition effects plugins during playback
author Chris Cannam
date Wed, 04 Oct 2006 11:01:39 +0000
parents 570794f6f6a7
children 0ed2b2e26b44
comparison
equal deleted inserted replaced
176:570794f6f6a7 177:aff66ec5aea4
515 515
516 m_fillExtent = frame; 516 m_fillExtent = frame;
517 } 517 }
518 518
519 first = false; 519 first = false;
520 if (m_model.m_exiting) break;
520 if (updating) sleep(1); 521 if (updating) sleep(1);
521 } 522 }
522 523
523 QMutexLocker locker(&m_model.m_mutex); 524 if (!m_model.m_exiting) {
524 for (size_t ct = 0; ct < 2; ++ct) { 525
525 if (count[ct] > 0) { 526 QMutexLocker locker(&m_model.m_mutex);
526 for (size_t ch = 0; ch < size_t(channels); ++ch) { 527 for (size_t ct = 0; ct < 2; ++ct) {
527 size_t rangeIndex = ch * 2 + ct; 528 if (count[ct] > 0) {
528 range[rangeIndex].absmean /= count[ct]; 529 for (size_t ch = 0; ch < size_t(channels); ++ch) {
529 m_model.m_cache[ct].push_back(range[rangeIndex]); 530 size_t rangeIndex = ch * 2 + ct;
530 range[rangeIndex] = Range(); 531 range[rangeIndex].absmean /= count[ct];
532 m_model.m_cache[ct].push_back(range[rangeIndex]);
533 range[rangeIndex] = Range();
534 }
535 count[ct] = 0;
531 } 536 }
532 count[ct] = 0; 537
538 const Range &rr = *m_model.m_cache[ct].begin();
539 MUNLOCK(&rr, m_model.m_cache[ct].capacity() * sizeof(Range));
533 } 540 }
534
535 const Range &rr = *m_model.m_cache[ct].begin();
536 MUNLOCK(&rr, m_model.m_cache[ct].capacity() * sizeof(Range));
537 } 541 }
538 542
539 delete[] range; 543 delete[] range;
540 544
541 m_fillExtent = m_frameCount; 545 m_fillExtent = m_frameCount;