MCPcopy Create free account
hub / github.com/IENT/YUView / goToNextItem

Method goToNextItem

YUViewLib/src/ui/PlaybackController.cpp:481–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479}
480
481void PlaybackController::goToNextItem()
482{
483 if (this->waitForCachingOfItem)
484 {
485 // Set this before the next item is selected so that the timer is not updated
486 this->playbackMode = PlaybackMode::WaitingForCache;
487 // The event itemCachingFinished will restart the timer.
488 this->timer.stop();
489 }
490
491 const auto wrapAround = (this->repeatMode == RepeatMode::All);
492 const auto hasNextItem = this->playlist->selectNextItem(wrapAround, true);
493 if (!hasNextItem)
494 {
495 DEBUG_PLAYBACK("PlaybackController::goToNextItem no next item. Stopping.");
496 this->on_playPauseButton_clicked();
497 }
498 else
499 {
500 DEBUG_PLAYBACK("PlaybackController::goToNextItem next item first frame %d",
501 this->frameSlider->minimum());
502 this->setCurrentFrameAndUpdate(this->ui.frameSlider->minimum());
503
504 if (this->waitForCachingOfItem)
505 {
506 DEBUG_PLAYBACK("PlaybackController::goToNextItem waiting for caching...");
507 emit(waitForItemCaching(this->currentItem[0]));
508
509 if (this->playbackMode == PlaybackMode::WaitingForCache)
510 {
511 // Update the views so that the "caching loading" hourglass indicator is drawn.
512 this->splitViewPrimary->update(false, false);
513 this->splitViewSeparate->update(false, false);
514 }
515 }
516 }
517}
518
519void PlaybackController::goToNextFrame(const int nextFrameIndex)
520{

Callers 1

timerEventMethod · 0.95

Calls 4

selectNextItemMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected