| 479 | } |
| 480 | |
| 481 | void 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 | |
| 519 | void PlaybackController::goToNextFrame(const int nextFrameIndex) |
| 520 | { |
no test coverage detected