Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Toggle ViewMode of ModeInfo dialog only on change
  • Loading branch information
peak3d authored and popcornmix committed Jun 5, 2017
1 parent 990ab52 commit d822599
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 20 deletions.
47 changes: 28 additions & 19 deletions xbmc/video/windows/GUIWindowFullScreen.cpp
Expand Up @@ -78,7 +78,7 @@ static CLinuxResourceCounter m_resourceCounter;
CGUIWindowFullScreen::CGUIWindowFullScreen(void)
: CGUIWindow(WINDOW_FULLSCREEN_VIDEO, "VideoFullScreen.xml")
{
m_bShowViewModeInfo = false;
m_viewModeChanged = true;
m_dwShowViewModeTimeout = 0;
m_bShowCurrentTime = false;
m_loadType = KEEP_IN_MEMORY;
Expand Down Expand Up @@ -155,13 +155,14 @@ bool CGUIWindowFullScreen::OnAction(const CAction &action)

case ACTION_ASPECT_RATIO:
{ // toggle the aspect ratio mode (only if the info is onscreen)
if (m_bShowViewModeInfo)
if (m_dwShowViewModeTimeout)
{
#ifdef HAS_VIDEO_PLAYBACK
g_application.m_pPlayer->SetRenderViewMode(CViewModeSettings::GetNextQuickCycleViewMode(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_ViewMode));
#endif
}
m_bShowViewModeInfo = true;
else
m_viewModeChanged = true;
m_dwShowViewModeTimeout = XbmcThreads::SystemClockMillis();
}
return true;
Expand Down Expand Up @@ -258,7 +259,9 @@ bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
// now call the base class to load our windows
CGUIWindow::OnMessage(message);

m_bShowViewModeInfo = false;
m_dwShowViewModeTimeout = 0;
m_viewModeChanged = true;


return true;
}
Expand Down Expand Up @@ -318,11 +321,13 @@ void CGUIWindowFullScreen::FrameMove()
//----------------------
// ViewMode Information
//----------------------
if (m_bShowViewModeInfo && XbmcThreads::SystemClockMillis() - m_dwShowViewModeTimeout > 2500)
if (m_dwShowViewModeTimeout && XbmcThreads::SystemClockMillis() - m_dwShowViewModeTimeout > 2500)
{
m_bShowViewModeInfo = false;
m_dwShowViewModeTimeout = 0;
m_viewModeChanged = true;
}
if (m_bShowViewModeInfo)

if (m_dwShowViewModeTimeout)
{
RESOLUTION_INFO res = g_graphicsContext.GetResInfo();

Expand Down Expand Up @@ -381,19 +386,23 @@ void CGUIWindowFullScreen::FrameMove()
}
}

if (m_bShowViewModeInfo)
{
SET_CONTROL_VISIBLE(LABEL_ROW1);
SET_CONTROL_VISIBLE(LABEL_ROW2);
SET_CONTROL_VISIBLE(LABEL_ROW3);
SET_CONTROL_VISIBLE(BLUE_BAR);
}
else
if (m_viewModeChanged)
{
SET_CONTROL_HIDDEN(LABEL_ROW1);
SET_CONTROL_HIDDEN(LABEL_ROW2);
SET_CONTROL_HIDDEN(LABEL_ROW3);
SET_CONTROL_HIDDEN(BLUE_BAR);
if (m_dwShowViewModeTimeout)
{
SET_CONTROL_VISIBLE(LABEL_ROW1);
SET_CONTROL_VISIBLE(LABEL_ROW2);
SET_CONTROL_VISIBLE(LABEL_ROW3);
SET_CONTROL_VISIBLE(BLUE_BAR);
}
else
{
SET_CONTROL_HIDDEN(LABEL_ROW1);
SET_CONTROL_HIDDEN(LABEL_ROW2);
SET_CONTROL_HIDDEN(LABEL_ROW3);
SET_CONTROL_HIDDEN(BLUE_BAR);
}
m_viewModeChanged = false;
}
}

Expand Down
2 changes: 1 addition & 1 deletion xbmc/video/windows/GUIWindowFullScreen.h
Expand Up @@ -44,7 +44,7 @@ class CGUIWindowFullScreen : public CGUIWindow
void ToggleOSD();
void TriggerOSD();

bool m_bShowViewModeInfo;
bool m_viewModeChanged;
unsigned int m_dwShowViewModeTimeout;

bool m_bShowCurrentTime;
Expand Down

0 comments on commit d822599

Please sign in to comment.