comparison data/model/ReadOnlyWaveFileModel.cpp @ 1752:6d09d68165a4 by-id

Further review of ById: make IDs only available when adding a model to the ById store, not by querying the item directly. This means any id encountered in the wild must have been added to the store at some point (even if later released), which simplifies reasoning about lifecycles
author Chris Cannam
date Fri, 05 Jul 2019 15:28:07 +0100
parents 77543124651b
children 73447d746db3
comparison
equal deleted inserted replaced
1751:77543124651b 1752:6d09d68165a4
588 sv_frame_t fillExtent = m_fillThread->getFillExtent(); 588 sv_frame_t fillExtent = m_fillThread->getFillExtent();
589 #ifdef DEBUG_WAVE_FILE_MODEL 589 #ifdef DEBUG_WAVE_FILE_MODEL
590 SVDEBUG << "ReadOnlyWaveFileModel(" << objectName() << ")::fillTimerTimedOut: extent = " << fillExtent << endl; 590 SVDEBUG << "ReadOnlyWaveFileModel(" << objectName() << ")::fillTimerTimedOut: extent = " << fillExtent << endl;
591 #endif 591 #endif
592 if (fillExtent > m_lastFillExtent) { 592 if (fillExtent > m_lastFillExtent) {
593 emit modelChangedWithin(m_lastFillExtent, fillExtent); 593 emit modelChangedWithin(getId(), m_lastFillExtent, fillExtent);
594 m_lastFillExtent = fillExtent; 594 m_lastFillExtent = fillExtent;
595 } 595 }
596 } else { 596 } else {
597 #ifdef DEBUG_WAVE_FILE_MODEL 597 #ifdef DEBUG_WAVE_FILE_MODEL
598 SVDEBUG << "ReadOnlyWaveFileModel(" << objectName() << ")::fillTimerTimedOut: no thread" << endl; 598 SVDEBUG << "ReadOnlyWaveFileModel(" << objectName() << ")::fillTimerTimedOut: no thread" << endl;
599 #endif 599 #endif
600 emit modelChanged(); 600 emit modelChanged(getId());
601 } 601 }
602 } 602 }
603 603
604 void 604 void
605 ReadOnlyWaveFileModel::cacheFilled() 605 ReadOnlyWaveFileModel::cacheFilled()
614 m_mutex.unlock(); 614 m_mutex.unlock();
615 #ifdef DEBUG_WAVE_FILE_MODEL 615 #ifdef DEBUG_WAVE_FILE_MODEL
616 SVDEBUG << "ReadOnlyWaveFileModel(" << objectName() << ")::cacheFilled, about to emit things" << endl; 616 SVDEBUG << "ReadOnlyWaveFileModel(" << objectName() << ")::cacheFilled, about to emit things" << endl;
617 #endif 617 #endif
618 if (getEndFrame() > prevFillExtent) { 618 if (getEndFrame() > prevFillExtent) {
619 emit modelChangedWithin(prevFillExtent, getEndFrame()); 619 emit modelChangedWithin(getId(), prevFillExtent, getEndFrame());
620 } 620 }
621 emit modelChanged(); 621 emit modelChanged(getId());
622 emit ready(); 622 emit ready(getId());
623 } 623 }
624 624
625 void 625 void
626 ReadOnlyWaveFileModel::RangeCacheFillThread::run() 626 ReadOnlyWaveFileModel::RangeCacheFillThread::run()
627 { 627 {