本文整理汇总了C++中TrackPointer::getAnalyzerProgress方法的典型用法代码示例。如果您正苦于以下问题:C++ TrackPointer::getAnalyzerProgress方法的具体用法?C++ TrackPointer::getAnalyzerProgress怎么用?C++ TrackPointer::getAnalyzerProgress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TrackPointer
的用法示例。
在下文中一共展示了TrackPointer::getAnalyzerProgress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isLoadedTrackWaiting
// This is called from the AnalyzerQueue thread
bool AnalyzerQueue::isLoadedTrackWaiting(TrackPointer analysingTrack) {
const PlayerInfo& info = PlayerInfo::instance();
TrackPointer pTrack;
bool trackWaiting = false;
QList<TrackPointer> progress100List;
QList<TrackPointer> progress0List;
m_qm.lock();
QMutableListIterator<TrackPointer> it(m_tioq);
while (it.hasNext()) {
TrackPointer& pTrack = it.next();
if (!pTrack) {
it.remove();
continue;
}
if (!trackWaiting) {
trackWaiting = info.isTrackLoaded(pTrack);
}
// try to load waveforms for all new tracks first
// and remove them from queue if already analysed
// This avoids waiting for a running analysis for those tracks.
int progress = pTrack->getAnalyzerProgress();
if (progress < 0) {
// Load stored analysis
QListIterator<Analyzer*> ita(m_aq);
bool processTrack = false;
while (ita.hasNext()) {
if (!ita.next()->isDisabledOrLoadStoredSuccess(pTrack)) {
processTrack = true;
}
}
if (!processTrack) {
progress100List.append(pTrack);
it.remove(); // since pTrack is a reference it is invalid now.
} else {
progress0List.append(pTrack);
}
} else if (progress == 1000) {
it.remove();
}
}
m_qm.unlock();
// update progress after unlock to avoid a deadlock
foreach (TrackPointer pTrack, progress100List) {
emitUpdateProgress(pTrack, 1000);
}