void CGUIWindowSettingsScreenCalibration::UpdateFromControl(int iControl) { CStdString strStatus; if (iControl == CONTROL_PIXEL_RATIO) { CGUIResizeControl *pControl = (CGUIResizeControl*)GetControl(CONTROL_PIXEL_RATIO); if (pControl) { float fWidth = (float)pControl->GetWidth(); float fHeight = (float)pControl->GetHeight(); g_settings.m_ResInfo[m_Res[m_iCurRes]].fPixelRatio = fHeight / fWidth; // recenter our control... pControl->SetPosition((g_settings.m_ResInfo[m_Res[m_iCurRes]].iWidth - pControl->GetWidth()) / 2, (g_settings.m_ResInfo[m_Res[m_iCurRes]].iHeight - pControl->GetHeight()) / 2); strStatus.Format("%s (%5.3f)", g_localizeStrings.Get(275).c_str(), g_settings.m_ResInfo[m_Res[m_iCurRes]].fPixelRatio); SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 278); } } else { CGUIMoverControl *pControl = (CGUIMoverControl*)GetControl(iControl); if (pControl) { switch (iControl) { case CONTROL_TOP_LEFT: { g_settings.m_ResInfo[m_Res[m_iCurRes]].Overscan.left = pControl->GetXLocation(); g_settings.m_ResInfo[m_Res[m_iCurRes]].Overscan.top = pControl->GetYLocation(); strStatus.Format("%s (%i,%i)", g_localizeStrings.Get(272).c_str(), pControl->GetXLocation(), pControl->GetYLocation()); SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 276); } break; case CONTROL_BOTTOM_RIGHT: { g_settings.m_ResInfo[m_Res[m_iCurRes]].Overscan.right = pControl->GetXLocation(); g_settings.m_ResInfo[m_Res[m_iCurRes]].Overscan.bottom = pControl->GetYLocation(); int iXOff1 = g_settings.m_ResInfo[m_Res[m_iCurRes]].iWidth - pControl->GetXLocation(); int iYOff1 = g_settings.m_ResInfo[m_Res[m_iCurRes]].iHeight - pControl->GetYLocation(); strStatus.Format("%s (%i,%i)", g_localizeStrings.Get(273).c_str(), iXOff1, iYOff1); SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 276); } break; case CONTROL_SUBTITLES: { g_settings.m_ResInfo[m_Res[m_iCurRes]].iSubtitles = pControl->GetYLocation(); strStatus.Format("%s (%i)", g_localizeStrings.Get(274).c_str(), pControl->GetYLocation()); SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 277); } break; } } } // set the label control correctly CStdString strText; strText.Format("%s | %s", g_settings.m_ResInfo[m_Res[m_iCurRes]].strMode, strStatus.c_str()); SET_CONTROL_LABEL(CONTROL_LABEL_ROW1, strText); }
void CGUIWindowSettingsScreenCalibration::UpdateFromControl(int iControl) { CStdString strStatus; if (iControl == CONTROL_PIXEL_RATIO) { CGUIResizeControl *pControl = (CGUIResizeControl*)GetControl(CONTROL_PIXEL_RATIO); if (pControl) { float fWidth = (float)pControl->GetWidth(); float fHeight = (float)pControl->GetHeight(); CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).fPixelRatio = fHeight / fWidth; // recenter our control... pControl->SetPosition((CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).iWidth - pControl->GetWidth()) / 2, (CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).iHeight - pControl->GetHeight()) / 2); strStatus.Format("%s (%5.3f)", g_localizeStrings.Get(275).c_str(), CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).fPixelRatio); SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 278); } } else { CGUIMoverControl *pControl = (CGUIMoverControl*)GetControl(iControl); if (pControl) { switch (iControl) { case CONTROL_TOP_LEFT: { CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).Overscan.left = pControl->GetXLocation(); CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).Overscan.top = pControl->GetYLocation(); strStatus.Format("%s (%i,%i)", g_localizeStrings.Get(272).c_str(), pControl->GetXLocation(), pControl->GetYLocation()); SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 276); } break; case CONTROL_BOTTOM_RIGHT: { CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).Overscan.right = pControl->GetXLocation(); CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).Overscan.bottom = pControl->GetYLocation(); int iXOff1 = CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).iWidth - pControl->GetXLocation(); int iYOff1 = CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).iHeight - pControl->GetYLocation(); strStatus.Format("%s (%i,%i)", g_localizeStrings.Get(273).c_str(), iXOff1, iYOff1); SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 276); } break; case CONTROL_SUBTITLES: { CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).iSubtitles = pControl->GetYLocation(); strStatus.Format("%s (%i)", g_localizeStrings.Get(274).c_str(), pControl->GetYLocation()); SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 277); } break; } } } // set the label control correctly CStdString strText; if (g_Windowing.IsFullScreen()) strText.Format("%ix%i@%.2f - %s | %s", CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).iScreenHeight, CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).fRefreshRate, g_localizeStrings.Get(244).c_str(), strStatus.c_str()); else strText.Format("%ix%i - %s | %s", CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(m_Res[m_iCurRes]).iScreenHeight, g_localizeStrings.Get(242).c_str(), strStatus.c_str()); SET_CONTROL_LABEL(CONTROL_LABEL_ROW1, strText); }