int MediaQueuePrivate::nextPosition(int count, bool forced) const { // Ignore count…
- User
int MediaQueuePrivate::nextPosition(int count, bool forced) const { // Ignore count parameter in kRepeatOnce mode qInfo() << count << "forced " << forced << "m_repeat" << m_repeat << " m_index" << m_index; int next = -1; if (m_queue.count() == 0) { } else { // we already pre-processed nowPlaying indexes, so its just a matter of // moving m_index and get realIndex from the list of indexes
// This works like Spotify / Android Auto // Pretty similar to Qt as well. I mean, MediaPlayer works like this. Is not rocket science next = m_index + count; switch (m_repeat) { case Art::Repeat::kRepeatNone: if (next >= m_queue.count()) next = m_queue.count() - 1; break; case Art::Repeat::kRepeatOnce: if (forced == false) next = m_index; else if (next >= m_queue.count()) next = m_queue.count() - 1; break; case Art::Repeat::kRepeatAll: next %= m_queue.count(); break; } } qInfo() << "next" << next; return next;} explain whats happening here and how is it related to seek functionality?
- Assistant
- User
void MediaPlayerPlatformInterface::PlayPrev(int count) { if (m_srcManager->IsCurrentSourceStorage() == true) { // AITI-834 auto pbProgress = m_srcManager->GetCurrentSourceHandler()->GetPlaybackProgress(); if (pbProgress.ElapsedMsec < PREV_NAVIGATION_THRESHOLD_MS) { if (m_audioManEP->takeAudio() == true) m_queue->prev(count); } else { m_player->setMute(true); m_player->seekPositionTo(multimediamanager::helper::millisecToQTime(0)); m_player->setMute(false); } } } explain whats happening in terms of seek
- Assistant
The
PlayPrevfunction in theMediaPlayerPlatformInterfaceclass is responsible for handling the logic when a request is made to play the previous item in the media queue. Here’s a breakdown of what happens in terms of seeking within the context of a media player, especially focusing on how this function may relate to seeking behavior:Breakdown of the Code