void CGUIDialogSeekBar::FrameMove() { if (!g_application.GetAppPlayer().HasPlayer()) { Close(true); return; } int progress = GetProgress(); if (progress != m_lastProgress) CONTROL_SELECT_ITEM(POPUP_SEEK_PROGRESS, m_lastProgress = progress); int epgEventProgress = GetEpgEventProgress(); if (epgEventProgress != m_lastEpgEventProgress) CONTROL_SELECT_ITEM(POPUP_SEEK_EPG_EVENT_PROGRESS, m_lastEpgEventProgress = epgEventProgress); int timeshiftProgress = GetTimeshiftProgress(); if (timeshiftProgress != m_lastTimeshiftProgress) CONTROL_SELECT_ITEM(POPUP_SEEK_TIMESHIFT_PROGRESS, m_lastTimeshiftProgress = timeshiftProgress); CGUIDialog::FrameMove(); }
int CGUIDialogSeekBar::GetEpgEventSeekPercent() const { int seekSize = g_application.GetAppPlayer().GetSeekHandler().GetSeekSize(); if (seekSize != 0) { CGUIInfoManager& infoMgr = CServiceBroker::GetGUI()->GetInfoManager(); int progress = 0; infoMgr.GetInt(progress, PVR_EPG_EVENT_PROGRESS); int total = 0; infoMgr.GetInt(total, PVR_EPG_EVENT_DURATION); float totalTime = static_cast<float>(total); float percentPerSecond = 100.0f / totalTime; float percent = progress + percentPerSecond * seekSize; return std::lrintf(percent); } else { return GetEpgEventProgress(); } }
void CGUIDialogSeekBar::FrameMove() { if (!g_application.GetAppPlayer().HasPlayer()) { Close(true); return; } unsigned int percent = g_application.GetAppPlayer().GetSeekHandler().InProgress() ? std::lrintf(GetSeekPercent()) : std::lrintf(g_application.GetPercentage()); if (percent != m_lastPercent) CONTROL_SELECT_ITEM(POPUP_SEEK_PROGRESS, m_lastPercent = percent); unsigned int epgEventPercent = g_application.GetAppPlayer().GetSeekHandler().InProgress() ? GetEpgEventSeekPercent() : GetEpgEventProgress(); if (epgEventPercent != m_lastEpgEventPercent) CONTROL_SELECT_ITEM(POPUP_SEEK_EPG_EVENT_PROGRESS, m_lastEpgEventPercent = epgEventPercent); CGUIDialog::FrameMove(); }