コード例 #1
0
void CGUIWindowSettingsScreenCalibration::EnableControl(int iControl)
{
  SET_CONTROL_VISIBLE(CONTROL_TOP_LEFT);
  SET_CONTROL_VISIBLE(CONTROL_BOTTOM_RIGHT);
  SET_CONTROL_VISIBLE(CONTROL_SUBTITLES);
  SET_CONTROL_VISIBLE(CONTROL_PIXEL_RATIO);
  SET_CONTROL_FOCUS(iControl, 0);
}
コード例 #2
0
bool CGUIWindowFirstTimeUseCalibration::OnMessage(CGUIMessage& message)
{
    bool retVal = CGUIWindowSettingsScreenCalibration::OnMessage(message);

    switch (message.GetMessage())
    {
    case GUI_MSG_CLICKED:
    {
        switch(message.GetSenderId())
        {
        case TOP_LEFT_MOVER:
        {
            SetProperty("setting-state",SETTING_BOTTOM_RIGHT);
            CLog::Log(LOGDEBUG,"CGUIWindowFirstTimeUseCalibration::OnMessage - GUI_MSG_CLICKED - Finish set TOP_LEFT_MOVER. Set property [setting-state=%d=SETTING_BOTTOM_RIGHT] (ftu)",GetPropertyInt("setting-state"));
            SET_CONTROL_FOCUS(BOTTOM_RIGHT_MOVER,0);
        }
        break;
        case BOTTOM_RIGHT_MOVER:
        {
            SetProperty("setting-state",VALIDATE_STATE);
            CLog::Log(LOGDEBUG,"CGUIWindowFirstTimeUseCalibration::OnMessage - GUI_MSG_CLICKED - Finish set BOTTOM_RIGHT_MOVER. Set property [setting-state=%d=VALIDATE_STATE] (ftu)",GetPropertyInt("setting-state"));

            SET_CONTROL_VISIBLE(TRY_AGAIN_BUTTON);
            SET_CONTROL_VISIBLE(DONE_BUTTON);
            SET_CONTROL_FOCUS(DONE_BUTTON,0);
        }
        break;
        case TRY_AGAIN_BUTTON:
        {
            SET_CONTROL_FOCUS(TOP_LEFT_MOVER,0);
            SetProperty("setting-state",SETTING_TOP_LEFT);
            CLog::Log(LOGDEBUG,"CGUIWindowFirstTimeUseCalibration::OnMessage - GUI_MSG_CLICKED - click on TRY_AGAIN_BUTTON. Set property [setting-state=%d=SETTING_TOP_LEFT] (ftu)",GetPropertyInt("setting-state"));
        }
        break;
        case DONE_BUTTON:
        {
            CLog::Log(LOGDEBUG,"CGUIWindowFirstTimeUseCalibration::OnMessage - GUI_MSG_CLICKED - click on DONE_BUTTON. Call Login() (ftu)");

            g_stSettings.m_doneFTU2 = true;
            g_settings.Save();

            /////////////////////////////////////////////
            // DONE_BUTTON was clicked -> call Login() //
            /////////////////////////////////////////////

            bool loginWasDone = g_application.GetBoxeeLoginManager().Login();
            return loginWasDone;
        }
        break;
        }
    }
    break;
    }

    return retVal;
}
コード例 #3
0
ファイル: GUIDialogBoxeeCtx.cpp プロジェクト: Kr0nZ/boxee
void CGUIDialogBoxeeCtx::OnInitWindow()
{
  m_pDlgVideoQuality = NULL;

  if (BoxeeUtils::HasDescription(m_item))
  {
    SET_CONTROL_VISIBLE(BTN_MORE_INFO);
  }
  else 
  {
    SET_CONTROL_HIDDEN(BTN_MORE_INFO); 
  }
  
  if ( (m_item.GetPropertyBOOL("isloaded") || m_item.IsApp() ) && (m_item.HasVideoInfoTag() || m_item.HasMusicInfoTag() || m_item.IsRSS() || m_item.IsInternetStream()) )
  {
    SET_CONTROL_VISIBLE(BTN_RATE);
    SET_CONTROL_VISIBLE(BTN_SHARE);
  }
  else 
  {
    SET_CONTROL_HIDDEN(BTN_RATE);
    SET_CONTROL_HIDDEN(BTN_SHARE);
  }

  //CONTROL_SELECT_ITEM(INFO_HIDDEN_LIST, 1);

  if (m_item.IsRSS() || m_item.IsLastFM() || m_item.IsShoutCast())
  {
    VECSOURCES *shares = g_settings.GetSourcesFromType(GetItemShareType());
    if (shares)
    {
      bool bFound = false;
      for (size_t i=0; !bFound && i < shares->size(); i++)
      {
        if ((*shares)[i].strPath == m_item.m_strPath)
        {
          m_item.SetProperty("ShareName", (*shares)[i].strName);
          bFound = true;
        }
      }
    
      m_item.SetProperty("IsPreset", bFound);
      m_item.SetProperty("CanPreset", true);
    }
  }

  g_settings.SetSkinString(g_settings.TranslateSkinString("totalTimeMoreThenHour"),g_application.GetTotalTime() < 3600 ? "0" : "1");

  SetAutoClose(5000);

  CGUIDialog::OnInitWindow();
}
コード例 #4
0
void CGUIDialogKeyboard::OnInitWindow()
{
  CGUIDialog::OnInitWindow();

  m_bIsConfirmed = false;

  // set alphabetic (capitals)
  UpdateButtons();

  CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT));
  if (pEdit)
  {
    pEdit->ShowCursor();
  }

  // set heading
  if (!m_strHeading.IsEmpty())
  {
    SET_CONTROL_LABEL(CTL_LABEL_HEADING, m_strHeading);
    SET_CONTROL_VISIBLE(CTL_LABEL_HEADING);
  }
  else
  {
    SET_CONTROL_HIDDEN(CTL_LABEL_HEADING);
  }
}
コード例 #5
0
void CGUIDialogKeyboardGeneric::OnInitWindow()
{
  CGUIDialog::OnInitWindow();

  m_bIsConfirmed = false;

  // set alphabetic (capitals)
  UpdateButtons();

  // set heading
  if (!m_strHeading.empty())
  {
    SET_CONTROL_LABEL(CTL_LABEL_HEADING, m_strHeading);
    SET_CONTROL_VISIBLE(CTL_LABEL_HEADING);
  }
  else
  {
    SET_CONTROL_HIDDEN(CTL_LABEL_HEADING);
  }
  // set type
  {
    CGUIMessage msg(GUI_MSG_SET_TYPE, GetID(), CTL_EDIT, m_hiddenInput ? CGUIEditControl::INPUT_TYPE_PASSWORD : CGUIEditControl::INPUT_TYPE_TEXT);
    OnMessage(msg);
  }
  SetEditText(m_text);

  CVariant data;
  data["title"] = m_strHeading;
  data["type"] = !m_hiddenInput ? "keyboard" : "password";
  data["value"] = GetText();
  ANNOUNCEMENT::CAnnouncementManager::Get().Announce(ANNOUNCEMENT::Input, "xbmc", "OnInputRequested", data);
}
コード例 #6
0
void CGUIDialogKeyboardGeneric::OnInitWindow()
{
  CGUIDialog::OnInitWindow();

  m_bIsConfirmed = false;

  // set alphabetic (capitals)
  UpdateButtons();

  CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT));
  if (pEdit)
  {
    pEdit->ShowCursor();
  }

  // set heading
  if (!m_strHeading.empty())
  {
    SET_CONTROL_LABEL(CTL_LABEL_HEADING, m_strHeading);
    SET_CONTROL_VISIBLE(CTL_LABEL_HEADING);
  }
  else
  {
    SET_CONTROL_HIDDEN(CTL_LABEL_HEADING);
  }

  CVariant data;
  data["title"] = m_strHeading;
  data["type"] = !m_hiddenInput ? "keyboard" : "password";
  data["value"] = GetText();
  ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::Input, "xbmc", "OnInputRequested", data);
}
コード例 #7
0
void CGUIDialogKeyboardGeneric::UpdateButtons()
{
    SET_CONTROL_SELECTED(GetID(), CTL_BUTTON_SHIFT, m_bShift);
    SET_CONTROL_SELECTED(GetID(), CTL_BUTTON_CAPS, m_keyType == CAPS);
    SET_CONTROL_SELECTED(GetID(), CTL_BUTTON_SYMBOLS, m_keyType == SYMBOLS);

    if (m_currentLayout >= m_layouts.size())
        m_currentLayout = 0;
    CKeyboardLayout layout = m_layouts.empty() ? CKeyboardLayout() : m_layouts[m_currentLayout];
    SET_CONTROL_LABEL(CTL_BUTTON_LAYOUT, layout.GetName());

    unsigned int modifiers = CKeyboardLayout::ModifierKeyNone;
    if ((m_keyType == CAPS && !m_bShift) || (m_keyType == LOWER && m_bShift))
        modifiers |= CKeyboardLayout::ModifierKeyShift;
    if (m_keyType == SYMBOLS)
    {
        modifiers |= CKeyboardLayout::ModifierKeySymbol;
        if (m_bShift)
            modifiers |= CKeyboardLayout::ModifierKeyShift;
    }

    for (unsigned int row = 0; row < BUTTONS_MAX_ROWS; row++)
    {
        for (unsigned int column = 0; column < BUTTONS_PER_ROW; column++)
        {
            int buttonID = (row * BUTTONS_PER_ROW) + column + BUTTON_ID_OFFSET;
            std::string label = layout.GetCharAt(row, column, modifiers);
            SetControlLabel(buttonID, label);
            if (!label.empty())
                SET_CONTROL_VISIBLE(buttonID);
            else
                SET_CONTROL_HIDDEN(buttonID);
        }
    }
}
コード例 #8
0
void CGUIDialogKeyboard::OnInitWindow()
{
#ifdef __APPLE__
  // Override skin defaults to always make the defaul control 'DONE' to allow
  // natual entry on keyboards.
  //
  m_dwDefaultFocusControlID = 300;
#endif

  CGUIDialog::OnInitWindow();

  m_bIsConfirmed = false;

  // set alphabetic (capitals)
  UpdateButtons();

  CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT));
  if (pEdit)
  {
    pEdit->ShowCursor();
  }

  // set heading
  if (!m_strHeading.IsEmpty())
  {
    SET_CONTROL_LABEL(CTL_LABEL_HEADING, m_strHeading);
    SET_CONTROL_VISIBLE(CTL_LABEL_HEADING);
  }
  else
  {
    SET_CONTROL_HIDDEN(CTL_LABEL_HEADING);
  }
}
コード例 #9
0
void CGUIDialogVisualisationSettings::SetupPage()
{
  // cleanup first, if necessary
  FreeControls();
  m_pOriginalSpin = (CGUISpinControlEx*)GetControl(CONTROL_DEFAULT_SPIN);
  m_pOriginalRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_DEFAULT_RADIOBUTTON);
  m_pOriginalSettingsButton = (CGUIButtonControl *)GetControl(CONTROL_DEFAULT_BUTTON);
  if (!m_pOriginalSpin || !m_pOriginalRadioButton || !m_pOriginalSettingsButton)
    return;
  m_pOriginalSpin->SetVisible(false);
  m_pOriginalRadioButton->SetVisible(false);
  m_pOriginalSettingsButton->SetVisible(false);

  // update our settings label
  CStdString strSettings;
  strSettings.Format("%s %s", g_infoManager.GetLabel(402).c_str(), g_localizeStrings.Get(5));
  SET_CONTROL_LABEL(CONTROL_SETTINGS_LABEL, strSettings);

  CGUIControlGroupList *group = (CGUIControlGroupList *)GetControl(CONTROL_GROUP_LIST);
#ifdef PRE_SKIN_VERSION_2_1_COMPATIBILITY
  if (!group || group->GetControlType() != CGUIControl::GUICONTROL_GROUPLIST)
  {
    // our controls for layout...
    CGUIControl *pArea = (CGUIControl *)GetControl(CONTROL_AREA);
    const CGUIControl *pGap = GetControl(CONTROL_GAP);
    if (!pArea || !pGap)
      return;
    Remove(CONTROL_AREA);
    group = new CGUIControlGroupList(GetID(), CONTROL_GROUP_LIST, pArea->GetXPosition(), pArea->GetYPosition(),
                                     pArea->GetWidth(), pArea->GetHeight(), pGap->GetHeight() - m_pOriginalSettingsButton->GetHeight(),
                                     0, VERTICAL, false);
    group->SetNavigation(CONTROL_GROUP_LIST, CONTROL_GROUP_LIST, CONTROL_GROUP_LIST, CONTROL_GROUP_LIST);
    Insert(group, pGap);
    pArea->FreeResources();
    delete pArea;
    SET_CONTROL_HIDDEN(CONTROL_PAGE);
  }
#endif
  if (!group)
    return;

  if (!m_pSettings || !m_pSettings->size())
  { // no settings available
    SET_CONTROL_VISIBLE(CONTROL_NONE_AVAILABLE);
    return;
  }
  else
  {
    SET_CONTROL_HIDDEN(CONTROL_NONE_AVAILABLE);
  }


  // run through and create our controls
  for (unsigned int i = 0; i < m_pSettings->size(); i++)
  {
    VisSetting &setting = m_pSettings->at(i);
    AddSetting(setting, group->GetWidth(), CONTROL_START + i);
  }
  UpdateSettings();
}
コード例 #10
0
void CGUIDialogExtendedProgressBar::UpdateState(unsigned int currentTime)
{
  std::string strHeader;
  std::string strTitle;
  float  fProgress(-1.0f);

  {
    CSingleLock lock(m_critSection);

    // delete finished items
    for (int iPtr = m_handles.size() - 1; iPtr >= 0; iPtr--)
    {
      if (m_handles.at(iPtr)->IsFinished())
      {
        delete m_handles.at(iPtr);
        m_handles.erase(m_handles.begin() + iPtr);
      }
    }

    if (!m_handles.size())
    {
      Close(false, 0, true, false);
      return;
    }

    // ensure the current item is in our range
    if (m_iCurrentItem >= m_handles.size())
      m_iCurrentItem = m_handles.size() - 1;

    // update the current item ptr
    if (currentTime > m_iLastSwitchTime &&
        currentTime - m_iLastSwitchTime >= ITEM_SWITCH_TIME_MS)
    {
      m_iLastSwitchTime = currentTime;

      // select next item
      if (++m_iCurrentItem > m_handles.size() - 1)
        m_iCurrentItem = 0;
    }

    CGUIDialogProgressBarHandle *handle = m_handles.at(m_iCurrentItem);
    if (handle)
    {
      strTitle  = handle->Text();
      strHeader = handle->Title();
      fProgress = handle->Percentage();
    }
  }

  SET_CONTROL_LABEL(CONTROL_LABELHEADER, strHeader);
  SET_CONTROL_LABEL(CONTROL_LABELTITLE, strTitle);

  if (fProgress > -1.0f)
  {
    SET_CONTROL_VISIBLE(CONTROL_PROGRESS);
    CONTROL_SELECT_ITEM(CONTROL_PROGRESS, (unsigned int)fProgress);
  }
}
コード例 #11
0
ファイル: GUIDialogSelect.cpp プロジェクト: EternalStare/xbmc
void CGUIDialogSelect::SetupButton()
{
  if (m_bButtonEnabled)
  {
    SET_CONTROL_LABEL(CONTROL_BUTTON, g_localizeStrings.Get(m_buttonString));
    SET_CONTROL_VISIBLE(CONTROL_BUTTON);
  }
  else
    SET_CONTROL_HIDDEN(CONTROL_BUTTON);
}
コード例 #12
0
ファイル: GUIDialogYesNo.cpp プロジェクト: Arcko/xbmc
void CGUIDialogYesNo::OnInitWindow()
{
  if (!m_strChoices[2].empty())
    SET_CONTROL_VISIBLE(CONTROL_CUSTOM_BUTTON);
  else
    SET_CONTROL_HIDDEN(CONTROL_CUSTOM_BUTTON);
  SET_CONTROL_HIDDEN(CONTROL_PROGRESS_BAR);
  SET_CONTROL_FOCUS(CONTROL_NO_BUTTON, 0);

  CGUIDialogBoxBase::OnInitWindow();
}
コード例 #13
0
ファイル: GUIDialogProgress.cpp プロジェクト: 0xheart0/xbmc
void CGUIDialogProgress::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
  if (m_bInvalidated)
  { // take a copy to save holding the lock for too long
    bool showProgress, showCancel;
    {
      CSingleLock lock(m_section);
      showProgress = m_showProgress;
      showCancel   = m_bCanCancel;
    }
    if (showProgress)
      SET_CONTROL_VISIBLE(CONTROL_PROGRESS_BAR);
    else
      SET_CONTROL_HIDDEN(CONTROL_PROGRESS_BAR);
    if (showCancel)
      SET_CONTROL_VISIBLE(CONTROL_NO_BUTTON);
    else
      SET_CONTROL_HIDDEN(CONTROL_NO_BUTTON);
  }
  CGUIDialogBoxBase::Process(currentTime, dirtyregions);
}
コード例 #14
0
void CGUIWindowLoginScreen::OnInitWindow()
{
  m_iSelectedItem = (int)CProfilesManager::Get().GetLastUsedProfileIndex();
  // Update list/thumb control
  m_viewControl.SetCurrentView(DEFAULT_VIEW_LIST);
  Update();
  m_viewControl.SetFocused();
  SET_CONTROL_LABEL(CONTROL_LABEL_HEADER,g_localizeStrings.Get(20115));
  SET_CONTROL_VISIBLE(CONTROL_BIG_LIST);

  CGUIWindow::OnInitWindow();
}
コード例 #15
0
ファイル: GUIDialogMusicOSD.cpp プロジェクト: aaronjb/plex
bool CGUIDialogMusicOSD::OnMessage(CGUIMessage &message)
{
  switch (message.GetMessage())
  {
  case GUI_MSG_CLICKED:
    {
      unsigned int iControl = message.GetSenderId();
      if (iControl == CONTROL_VIS_CHOOSER)
      {
        CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), iControl);
        OnMessage(msg);
        CStdString strLabel = msg.GetLabel();
        if (msg.GetParam1() == 0)
          g_guiSettings.SetString("mymusic.visualisation", "None");
        else
          g_guiSettings.SetString("mymusic.visualisation", strLabel + ".vis");
        // hide the control and reset focus
        SET_CONTROL_HIDDEN(CONTROL_VIS_CHOOSER);
        SET_CONTROL_FOCUS(CONTROL_VIS_BUTTON, 0);
        return true;
      }
      else if (iControl == CONTROL_VIS_BUTTON)
      {
        SET_CONTROL_VISIBLE(CONTROL_VIS_CHOOSER);
        SET_CONTROL_FOCUS(CONTROL_VIS_CHOOSER, 0);
        // fire off an event that we've pressed this button...
        CAction action;
        action.wID = ACTION_SELECT_ITEM;
        OnAction(action);
      }
      else if (iControl == CONTROL_LOCK_BUTTON)
      {
        CGUIMessage msg(GUI_MSG_VISUALISATION_ACTION, 0, 0, ACTION_VIS_PRESET_LOCK);
        g_graphicsContext.SendMessage(msg);
      }
      return true;
    }
    break;
  case GUI_MSG_WINDOW_DEINIT:
  case GUI_MSG_VISUALISATION_UNLOADING:
    {
      m_pVisualisation = NULL;
    }
    break;
  case GUI_MSG_VISUALISATION_LOADED:
    {
      if (message.GetLPVOID())
        m_pVisualisation = (CVisualisation *)message.GetLPVOID();
    }
  }
  return CGUIDialog::OnMessage(message);
}
コード例 #16
0
void CGUIDialogBoxeeOTAFacebookConnect::OnInitWindow()
{
  CGUIDialogBoxeeWizardBase::OnInitWindow();

  if (g_application.GetBoxeeSocialUtilsManager().IsConnected(FACEBOOK_SERVICE_ID, true) &&
      g_application.GetBoxeeSocialUtilsManager().RequiresReconnect(FACEBOOK_SERVICE_ID))
  {
    SET_CONTROL_LABEL(LEFT_SIDE_LABEL, g_localizeStrings.Get(58058));
    SET_CONTROL_HIDDEN(FACEBOOK_BUTTON1);
    SET_CONTROL_VISIBLE(FACEBOOK_BUTTON2);
    SET_CONTROL_FOCUS(FACEBOOK_BUTTON2, 0);
  }
}
コード例 #17
0
ファイル: GUIDialogSelect.cpp プロジェクト: 69thelememt/xbmc
void CGUIDialogSelect::OnInitWindow()
{
  m_viewControl.SetItems(*m_vecList);
  m_selectedItems.clear();
  for(int i = 0 ; i < m_vecList->Size(); i++)
  {
    auto item = m_vecList->Get(i);
    if (item->IsSelected())
    {
      m_selectedItems.push_back(i);
      if (m_selectedItem == nullptr)
        m_selectedItem = item;
    }
  }
  m_viewControl.SetCurrentView(m_useDetails ? CONTROL_DETAILED_LIST : CONTROL_SIMPLE_LIST);

  SET_CONTROL_LABEL(CONTROL_NUMBER_OF_ITEMS, StringUtils::Format("%i %s",
      m_vecList->Size(), g_localizeStrings.Get(127).c_str()));
  
  if (m_multiSelection)
    EnableButton(true, 186);

  if (m_bButtonEnabled)
  {
    SET_CONTROL_LABEL(CONTROL_EXTRA_BUTTON, g_localizeStrings.Get(m_buttonLabel));
    SET_CONTROL_VISIBLE(CONTROL_EXTRA_BUTTON);
  }
  else
    SET_CONTROL_HIDDEN(CONTROL_EXTRA_BUTTON);

  SET_CONTROL_LABEL(CONTROL_CANCEL_BUTTON, g_localizeStrings.Get(222));
  SET_CONTROL_VISIBLE(CONTROL_CANCEL_BUTTON);

  CGUIDialogBoxBase::OnInitWindow();

  // if nothing is selected, select first item
  m_viewControl.SetSelectedItem(std::max(GetSelectedItem(), 0));
}
コード例 #18
0
void CGUIDialogKeyboardGeneric::OnInitWindow()
{
  CGUIDialog::OnInitWindow();

  m_bIsConfirmed = false;

  // fill in the keyboard layouts
  m_currentLayout = 0;
  m_layouts.clear();
  std::vector<CKeyboardLayout> keyLayouts = CKeyboardLayout::LoadLayouts();
  const CSetting *setting = CSettings::Get().GetSetting("locale.keyboardlayouts");
  std::vector<std::string> layouts;
  if (setting)
    layouts = StringUtils::Split(setting->ToString(), '|');
  for (std::vector<CKeyboardLayout>::const_iterator j = keyLayouts.begin(); j != keyLayouts.end(); ++j)
  {
    if (std::find(layouts.begin(), layouts.end(), j->GetName()) != layouts.end())
      m_layouts.push_back(*j);
  }

  // set alphabetic (capitals)
  UpdateButtons();

  // set heading
  if (!m_strHeading.empty())
  {
    SET_CONTROL_LABEL(CTL_LABEL_HEADING, m_strHeading);
    SET_CONTROL_VISIBLE(CTL_LABEL_HEADING);
  }
  else
  {
    SET_CONTROL_HIDDEN(CTL_LABEL_HEADING);
  }
  // set type
  {
    CGUIMessage msg(GUI_MSG_SET_TYPE, GetID(), CTL_EDIT, m_hiddenInput ? CGUIEditControl::INPUT_TYPE_PASSWORD : CGUIEditControl::INPUT_TYPE_TEXT);
    OnMessage(msg);
  }
  SetEditText(m_text);

  CVariant data;
  data["title"] = m_strHeading;
  data["type"] = !m_hiddenInput ? "keyboard" : "password";
  data["value"] = GetText();
  ANNOUNCEMENT::CAnnouncementManager::Get().Announce(ANNOUNCEMENT::Input, "xbmc", "OnInputRequested", data);
}
コード例 #19
0
void CGUIDialogKeyboardGeneric::OnInitWindow()
{
    CGUIDialog::OnInitWindow();

    m_bIsConfirmed = false;
    m_isKeyboardNavigationMode = false;

    // fill in the keyboard layouts
    m_currentLayout = 0;
    m_layouts.clear();
    const KeyboardLayouts& keyboardLayouts = CKeyboardLayoutManager::Get().GetLayouts();
    std::vector<CVariant> layoutNames = CSettings::Get().GetList("locale.keyboardlayouts");

    for (std::vector<CVariant>::const_iterator layoutName = layoutNames.begin(); layoutName != layoutNames.end(); ++layoutName)
    {
        KeyboardLayouts::const_iterator keyboardLayout = keyboardLayouts.find(layoutName->asString());
        if (keyboardLayout != keyboardLayouts.end())
            m_layouts.push_back(keyboardLayout->second);
    }

    // set alphabetic (capitals)
    UpdateButtons();

    // set heading
    if (!m_strHeading.empty())
    {
        SET_CONTROL_LABEL(CTL_LABEL_HEADING, m_strHeading);
        SET_CONTROL_VISIBLE(CTL_LABEL_HEADING);
    }
    else
    {
        SET_CONTROL_HIDDEN(CTL_LABEL_HEADING);
    }
    // set type
    {
        CGUIMessage msg(GUI_MSG_SET_TYPE, GetID(), CTL_EDIT, m_hiddenInput ? CGUIEditControl::INPUT_TYPE_PASSWORD : CGUIEditControl::INPUT_TYPE_TEXT);
        OnMessage(msg);
    }
    SetEditText(m_text);

    CVariant data;
    data["title"] = m_strHeading;
    data["type"] = !m_hiddenInput ? "keyboard" : "password";
    data["value"] = GetText();
    ANNOUNCEMENT::CAnnouncementManager::Get().Announce(ANNOUNCEMENT::Input, "xbmc", "OnInputRequested", data);
}
コード例 #20
0
void CGUIWindowSettingsScreenCalibration::DoProcess(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
  MarkDirtyRegion();

  for (int i = CONTROL_TOP_LEFT; i <= CONTROL_PIXEL_RATIO; i++)
    SET_CONTROL_HIDDEN(i);

  m_needsScaling = true;
  CGUIWindow::DoProcess(currentTime, dirtyregions);
  m_needsScaling = false;

  g_graphicsContext.SetRenderingResolution(m_Res[m_iCurRes], false);
  g_graphicsContext.AddGUITransform();

  // process the movers etc.
  for (int i = CONTROL_TOP_LEFT; i <= CONTROL_PIXEL_RATIO; i++)
  {
    SET_CONTROL_VISIBLE(i);
    CGUIControl *control = GetControl(i);
    if (control)
      control->DoProcess(currentTime, dirtyregions);
  }
  g_graphicsContext.RemoveTransform();
}
コード例 #21
0
void CGUIWindowFullScreen::ChangetheTVGroup(bool next)
{
  CGUISelectButtonControl* pButton = (CGUISelectButtonControl*)GetControl(CONTROL_GROUP_CHOOSER);
  if (!pButton)
    return;

  if (!m_bGroupSelectShow)
  {
    SET_CONTROL_VISIBLE(CONTROL_GROUP_CHOOSER);
    SET_CONTROL_FOCUS(CONTROL_GROUP_CHOOSER, 0);

    // fire off an event that we've pressed this button...
    OnAction(CAction(ACTION_SELECT_ITEM));

    m_bGroupSelectShow = true;
  }
  else
  {
    if (next)
      pButton->OnRight();
    else
      pButton->OnLeft();
  }
}
コード例 #22
0
bool CGUIWindowSettingsScreenCalibration::OnMessage(CGUIMessage& message)
{
  switch ( message.GetMessage() )
  {
  case GUI_MSG_WINDOW_DEINIT:
    {
      CDisplaySettings::GetInstance().UpdateCalibrations();
      CSettings::GetInstance().Save();
      g_graphicsContext.SetCalibrating(false);
      g_windowManager.ShowOverlay(OVERLAY_STATE_SHOWN);
      // reset our screen resolution to what it was initially
      g_graphicsContext.SetVideoResolution(CDisplaySettings::GetInstance().GetCurrentResolution());
      // Inform the player so we can update the resolution
#ifdef HAS_VIDEO_PLAYBACK
      g_renderManager.Update();
#endif
      g_windowManager.SendMessage(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_WINDOW_RESIZE);
    }
    break;

  case GUI_MSG_WINDOW_INIT:
    {
      CGUIWindow::OnMessage(message);
      g_windowManager.ShowOverlay(OVERLAY_STATE_HIDDEN);
      g_graphicsContext.SetCalibrating(true);

      // Get the allowable resolutions that we can calibrate...
      m_Res.clear();
      if (g_application.m_pPlayer->IsPlayingVideo())
      { // don't allow resolution switching if we are playing a video

#ifdef HAS_VIDEO_PLAYBACK
        RESOLUTION res = g_renderManager.GetResolution();
        g_graphicsContext.SetVideoResolution(res);
        // Inform the renderer so we can update the resolution
        g_renderManager.Update();
#endif

        m_iCurRes = 0;
        m_Res.push_back(g_graphicsContext.GetVideoResolution());
        SET_CONTROL_VISIBLE(CONTROL_VIDEO);
      }
      else
      {
        SET_CONTROL_HIDDEN(CONTROL_VIDEO);
        m_iCurRes = (unsigned int)-1;
        g_graphicsContext.GetAllowedResolutions(m_Res);
        // find our starting resolution
        m_iCurRes = FindCurrentResolution();
      }
      if (m_iCurRes==(unsigned int)-1)
      {
        CLog::Log(LOGERROR, "CALIBRATION: Reported current resolution: %d", (int)g_graphicsContext.GetVideoResolution());
        CLog::Log(LOGERROR, "CALIBRATION: Could not determine current resolution, falling back to default");
        m_iCurRes = 0;
      }

      // Setup the first control
      m_iControl = CONTROL_TOP_LEFT;
      ResetControls();
      return true;
    }
    break;
  case GUI_MSG_CLICKED:
    {
      // clicked - change the control...
      NextControl();
    }
    break;
  case GUI_MSG_NOTIFY_ALL:
    {
      if (message.GetParam1() == GUI_MSG_WINDOW_RESIZE)
      {
        m_iCurRes = FindCurrentResolution();
      }
    }
    break;
  // send before touch for requesting gesture features - we don't want this
  // it would result in unfocus in the onmessage below ...
  case GUI_MSG_GESTURE_NOTIFY:
  // send after touch for unfocussing - we don't want this in this window!
  case GUI_MSG_UNFOCUS_ALL:
    return true;
    break;
  }
  return CGUIWindow::OnMessage(message);
}
コード例 #23
0
void CGUIWindowFullScreen::FrameMove()
{
    if (g_application.m_pPlayer->GetPlaySpeed() != 1)
        g_infoManager.SetDisplayAfterSeek();
    if (m_bShowCurrentTime)
        g_infoManager.SetDisplayAfterSeek();

    if (!g_application.m_pPlayer->HasPlayer()) return;

    if( g_application.m_pPlayer->IsCaching() )
    {
        g_infoManager.SetDisplayAfterSeek(0); //Make sure these stuff aren't visible now
    }

    //------------------------
    m_showCodec.Update();
    if (m_showCodec)
    {
        // show audio codec info
        std::string strAudio, strVideo, strGeneral;
        g_application.m_pPlayer->GetAudioInfo(strAudio);
        {
            CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW1);
            msg.SetLabel(strAudio);
            OnMessage(msg);
        }
        // show video codec info
        g_application.m_pPlayer->GetVideoInfo(strVideo);
        {
            CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW2);
            msg.SetLabel(strVideo);
            OnMessage(msg);
        }
        // show general info
        g_application.m_pPlayer->GetGeneralInfo(strGeneral);
        {
            std::string strGeneralFPS;
#if defined(TARGET_DARWIN)
            // We show CPU usage for the entire process, as it's arguably more useful.
            double dCPU = m_resourceCounter.GetCPUUsage();
            std::string strCores;
            strCores = StringUtils::Format("cpu:%.0f%%", dCPU);
#else
            std::string strCores = g_cpuInfo.GetCoresUsageString();
#endif
            int    missedvblanks;
            double refreshrate;
            double clockspeed;
            std::string strClock;

            if (g_VideoReferenceClock.GetClockInfo(missedvblanks, clockspeed, refreshrate))
                strClock = StringUtils::Format("S( refresh:%.3f missed:%i speed:%+.3f%% %s )"
                                               , refreshrate
                                               , missedvblanks
                                               , clockspeed - 100.0
                                               , g_renderManager.GetVSyncState().c_str());

            strGeneralFPS = StringUtils::Format("%s\nW( %s )\n%s"
                                                , strGeneral.c_str()
                                                , strCores.c_str(), strClock.c_str() );

            CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW3);
            msg.SetLabel(strGeneralFPS);
            OnMessage(msg);
        }
    }
    //----------------------
    // ViewMode Information
    //----------------------
    if (m_bShowViewModeInfo && XbmcThreads::SystemClockMillis() - m_dwShowViewModeTimeout > 2500)
    {
        m_bShowViewModeInfo = false;
    }
    if (m_bShowViewModeInfo)
    {
        RESOLUTION_INFO res = g_graphicsContext.GetResInfo();

        {
            // get the "View Mode" string
            std::string strTitle = g_localizeStrings.Get(629);
            std::string strMode = g_localizeStrings.Get(630 + CMediaSettings::Get().GetCurrentVideoSettings().m_ViewMode);
            std::string strInfo = StringUtils::Format("%s : %s", strTitle.c_str(), strMode.c_str());
            CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW1);
            msg.SetLabel(strInfo);
            OnMessage(msg);
        }
        // show sizing information
        SPlayerVideoStreamInfo info;
        g_application.m_pPlayer->GetVideoStreamInfo(info);
        {
            // Splitres scaling factor
            float xscale = (float)res.iScreenWidth  / (float)res.iWidth;
            float yscale = (float)res.iScreenHeight / (float)res.iHeight;

            std::string strSizing = StringUtils::Format(g_localizeStrings.Get(245).c_str(),
                                    (int)info.SrcRect.Width(),
                                    (int)info.SrcRect.Height(),
                                    (int)(info.DestRect.Width() * xscale),
                                    (int)(info.DestRect.Height() * yscale),
                                    CDisplaySettings::Get().GetZoomAmount(),
                                    info.videoAspectRatio*CDisplaySettings::Get().GetPixelRatio(),
                                    CDisplaySettings::Get().GetPixelRatio(),
                                    CDisplaySettings::Get().GetVerticalShift());
            CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW2);
            msg.SetLabel(strSizing);
            OnMessage(msg);
        }
        // show resolution information
        {
            std::string strStatus;
            if (g_Windowing.IsFullScreen())
                strStatus = StringUtils::Format("%s %ix%i@%.2fHz - %s",
                                                g_localizeStrings.Get(13287).c_str(),
                                                res.iScreenWidth,
                                                res.iScreenHeight,
                                                res.fRefreshRate,
                                                g_localizeStrings.Get(244).c_str());
            else
                strStatus = StringUtils::Format("%s %ix%i - %s",
                                                g_localizeStrings.Get(13287).c_str(),
                                                res.iScreenWidth,
                                                res.iScreenHeight,
                                                g_localizeStrings.Get(242).c_str());

            CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW3);
            msg.SetLabel(strStatus);
            OnMessage(msg);
        }
    }

    if (m_timeCodeShow && m_timeCodePosition != 0)
    {
        if ( (XbmcThreads::SystemClockMillis() - m_timeCodeTimeout) >= 2500)
        {
            m_timeCodeShow = false;
            m_timeCodePosition = 0;
        }
        std::string strDispTime = "00:00:00";

        CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW1);

        for (int pos = 7, i = m_timeCodePosition; pos >= 0 && i > 0; pos--)
        {
            if (strDispTime[pos] != ':')
            {
                i -= 1;
                strDispTime[pos] = (char)m_timeCodeStamp[i] + '0';
            }
        }

        strDispTime += "/" + g_infoManager.GetDuration(TIME_FORMAT_HH_MM_SS) + " [" + g_infoManager.GetCurrentPlayTime(TIME_FORMAT_HH_MM_SS) + "]"; // duration [ time ]
        msg.SetLabel(strDispTime);
        OnMessage(msg);
    }

    if (m_showCodec || 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_timeCodeShow)
    {
        SET_CONTROL_VISIBLE(LABEL_ROW1);
        SET_CONTROL_HIDDEN(LABEL_ROW2);
        SET_CONTROL_HIDDEN(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);
    }

    g_renderManager.FrameMove();
}
コード例 #24
0
void CGUIWindowFullScreen::RenderFullScreen()
{
  if (g_application.GetPlaySpeed() != 1)
    g_infoManager.SetDisplayAfterSeek();
  if (m_bShowCurrentTime)
    g_infoManager.SetDisplayAfterSeek();

  m_bLastRender = true;
  if (!g_application.m_pPlayer) return ;

  if( g_application.m_pPlayer->IsCaching() )
  {
    g_infoManager.SetDisplayAfterSeek(0); //Make sure these stuff aren't visible now
  }

  //------------------------
  if (g_infoManager.GetBool(PLAYER_SHOWCODEC))
  {
    // show audio codec info
    CStdString strAudio, strVideo, strGeneral;
    g_application.m_pPlayer->GetAudioInfo(strAudio);
    {
      CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW1);
      msg.SetLabel(strAudio);
      OnMessage(msg);
    }
    // show video codec info
    g_application.m_pPlayer->GetVideoInfo(strVideo);
    {
      CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW2);
      msg.SetLabel(strVideo);
      OnMessage(msg);
    }
    // show general info
    g_application.m_pPlayer->GetGeneralInfo(strGeneral);
    {
      CStdString strGeneralFPS;
#ifdef __APPLE__
      // We show CPU usage for the entire process, as it's arguably more useful.
      double dCPU = m_resourceCounter.GetCPUUsage();
      CStdString strCores;
      strCores.Format("cpu: %.0f%%", dCPU);
#else
      CStdString strCores = g_cpuInfo.GetCoresUsageString();
#endif
      strGeneralFPS.Format("fps: %02.2f %s\n%s", g_infoManager.GetFPS(), strCores.c_str(), strGeneral.c_str() );
      CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW3);
      msg.SetLabel(strGeneralFPS);
      OnMessage(msg);
    }
  }
  //----------------------
  // ViewMode Information
  //----------------------
  if (m_bShowViewModeInfo && timeGetTime() - m_dwShowViewModeTimeout > 2500)
  {
    m_bShowViewModeInfo = false;
  }
  if (m_bShowViewModeInfo)
  {
    {
      // get the "View Mode" string
      CStdString strTitle = g_localizeStrings.Get(629);
      CStdString strMode = g_localizeStrings.Get(630 + g_stSettings.m_currentVideoSettings.m_ViewMode);
      CStdString strInfo;
      strInfo.Format("%s : %s", strTitle.c_str(), strMode.c_str());
      CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW1);
      msg.SetLabel(strInfo);
      OnMessage(msg);
    }
    // show sizing information
    RECT SrcRect, DestRect;
    float fAR;
    g_application.m_pPlayer->GetVideoRect(SrcRect, DestRect);
    g_application.m_pPlayer->GetVideoAspectRatio(fAR);
    {
      CStdString strSizing;
      strSizing.Format("Sizing: (%i,%i)->(%i,%i) (Zoom x%2.2f) AR:%2.2f:1 (Pixels: %2.2f:1)",
                       SrcRect.right - SrcRect.left, SrcRect.bottom - SrcRect.top,
                       DestRect.right - DestRect.left, DestRect.bottom - DestRect.top, g_stSettings.m_fZoomAmount, fAR*g_stSettings.m_fPixelRatio, g_stSettings.m_fPixelRatio);
      CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW2);
      msg.SetLabel(strSizing);
      OnMessage(msg);
    }
    // show resolution information
    int iResolution = g_graphicsContext.GetVideoResolution();
    {
      CStdString strStatus;
      strStatus.Format("%ix%i %s", g_settings.m_ResInfo[iResolution].iWidth, g_settings.m_ResInfo[iResolution].iHeight, g_settings.m_ResInfo[iResolution].strMode);
#ifdef HAS_XBOX_HARDWARE
      if (g_guiSettings.GetBool("videoplayer.soften"))
        strStatus += "  |  Soften";
      else
        strStatus += "  |  No Soften";
      CStdString strFilter;
      strFilter.Format("  |  Flicker Filter: %i", g_guiSettings.GetInt("videoplayer.flicker"));
      strStatus += strFilter;
#endif
      CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW3);
      msg.SetLabel(strStatus);
      OnMessage(msg);
    }
  }

  RenderTTFSubtitles();

  if (m_timeCodeShow && m_timeCodePosition != 0)
  {
    if ( (timeGetTime() - m_timeCodeTimeout) >= 2500)
    {
      m_timeCodeShow = false;
      m_timeCodePosition = 0;
    }
    CStdString strDispTime = "??:??";

    CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW1);
    for (int count = 0; count < m_timeCodePosition; count++)
    {
      if (m_timeCodeStamp[count] == -1)
        strDispTime[count] = ':';
      else
        strDispTime[count] = (char)m_timeCodeStamp[count] + 48;
    }
    strDispTime += "/" + g_infoManager.GetVideoLabel(257) + " [" + g_infoManager.GetVideoLabel(254) + "]"; // duration [ time ]
    msg.SetLabel(strDispTime);
    OnMessage(msg);
  }

  if (g_infoManager.GetBool(PLAYER_SHOWCODEC) || 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_timeCodeShow)
  {
    SET_CONTROL_VISIBLE(LABEL_ROW1);
    SET_CONTROL_HIDDEN(LABEL_ROW2);
    SET_CONTROL_HIDDEN(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);
  }
  CGUIWindow::Render();
}
コード例 #25
0
void CGUIWindowFullScreen::FrameMove()
{
  if (g_application.GetPlaySpeed() != 1)
    g_infoManager.SetDisplayAfterSeek();
  if (m_bShowCurrentTime)
    g_infoManager.SetDisplayAfterSeek();

  if (!g_application.m_pPlayer) return;

  if( g_application.m_pPlayer->IsCaching() )
  {
    g_infoManager.SetDisplayAfterSeek(0); //Make sure these stuff aren't visible now
  }

  //------------------------
  m_showCodec.Update();
  if (m_showCodec)
  {
    // show audio codec info
    CStdString strAudio, strVideo, strGeneral;
    g_application.m_pPlayer->GetAudioInfo(strAudio);
    {
      CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW1);
      msg.SetLabel(strAudio);
      OnMessage(msg);
    }
    // show video codec info
    g_application.m_pPlayer->GetVideoInfo(strVideo);
    {
      CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW2);
      msg.SetLabel(strVideo);
      OnMessage(msg);
    }
    // show general info
    g_application.m_pPlayer->GetGeneralInfo(strGeneral);
    {
      CStdString strGeneralFPS;
#ifdef __APPLE__
      // We show CPU usage for the entire process, as it's arguably more useful.
      double dCPU = m_resourceCounter.GetCPUUsage();
      CStdString strCores;
      strCores.Format("cpu:%.0f%%", dCPU);
#else
      CStdString strCores = g_cpuInfo.GetCoresUsageString();
#endif
      int    missedvblanks;
      int    refreshrate;
      double clockspeed;
      CStdString strClock;

      if (g_VideoReferenceClock.GetClockInfo(missedvblanks, clockspeed, refreshrate))
        strClock.Format("S( refresh:%i missed:%i speed:%+.3f%% %s )"
                       , refreshrate
                       , missedvblanks
                       , clockspeed - 100.0
                       , g_renderManager.GetVSyncState().c_str());

      strGeneralFPS.Format("%s\nW( fps:%02.2f %s ) %s"
                         , strGeneral.c_str()
                         , g_infoManager.GetFPS()
                         , strCores.c_str(), strClock.c_str() );

      CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW3);
      msg.SetLabel(strGeneralFPS);
      OnMessage(msg);
    }
  }
  //----------------------
  // ViewMode Information
  //----------------------
  if (m_bShowViewModeInfo && XbmcThreads::SystemClockMillis() - m_dwShowViewModeTimeout > 2500)
  {
    m_bShowViewModeInfo = false;
  }
  if (m_bShowViewModeInfo)
  {
    {
      // get the "View Mode" string
      CStdString strTitle = g_localizeStrings.Get(629);
      CStdString strMode = g_localizeStrings.Get(630 + g_settings.m_currentVideoSettings.m_ViewMode);
      CStdString strInfo;
      strInfo.Format("%s : %s", strTitle.c_str(), strMode.c_str());
      CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW1);
      msg.SetLabel(strInfo);
      OnMessage(msg);
    }
    // show sizing information
    CRect SrcRect, DestRect;
    float fAR;
    g_application.m_pPlayer->GetVideoRect(SrcRect, DestRect);
    g_application.m_pPlayer->GetVideoAspectRatio(fAR);
    {
      CStdString strSizing;
      strSizing.Format(g_localizeStrings.Get(245),
                       (int)SrcRect.Width(), (int)SrcRect.Height(),
                       (int)DestRect.Width(), (int)DestRect.Height(),
                       g_settings.m_fZoomAmount, fAR*g_settings.m_fPixelRatio, 
                       g_settings.m_fPixelRatio, g_settings.m_fVerticalShift);
      CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW2);
      msg.SetLabel(strSizing);
      OnMessage(msg);
    }
    // show resolution information
    int iResolution = g_graphicsContext.GetVideoResolution();
    {
      CStdString strStatus;
      if (g_settings.m_ResInfo[iResolution].bFullScreen)
        strStatus.Format("%s %ix%i@%.2fHz - %s",
          g_localizeStrings.Get(13287), g_settings.m_ResInfo[iResolution].iWidth,
          g_settings.m_ResInfo[iResolution].iHeight, g_settings.m_ResInfo[iResolution].fRefreshRate,
          g_localizeStrings.Get(244));
      else
        strStatus.Format("%s %ix%i - %s",
          g_localizeStrings.Get(13287), g_settings.m_ResInfo[iResolution].iWidth,
          g_settings.m_ResInfo[iResolution].iHeight, g_localizeStrings.Get(242));

      CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW3);
      msg.SetLabel(strStatus);
      OnMessage(msg);
    }
  }

  if (m_timeCodeShow && m_timeCodePosition != 0)
  {
    if ( (XbmcThreads::SystemClockMillis() - m_timeCodeTimeout) >= 2500)
    {
      m_timeCodeShow = false;
      m_timeCodePosition = 0;
    }
    CStdString strDispTime = "00:00:00";

    CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW1);

    for (int pos = 7, i = m_timeCodePosition; pos >= 0 && i > 0; pos--)
    {
      if (strDispTime[pos] != ':')
      {
        i -= 1;
        strDispTime[pos] = (char)m_timeCodeStamp[i] + '0';
      }
    }

    strDispTime += "/" + g_infoManager.GetDuration(TIME_FORMAT_HH_MM_SS) + " [" + g_infoManager.GetCurrentPlayTime(TIME_FORMAT_HH_MM_SS) + "]"; // duration [ time ]
    msg.SetLabel(strDispTime);
    OnMessage(msg);
  }

  if (m_showCodec || 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_timeCodeShow)
  {
    SET_CONTROL_VISIBLE(LABEL_ROW1);
    SET_CONTROL_HIDDEN(LABEL_ROW2);
    SET_CONTROL_HIDDEN(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);
  }
}
コード例 #26
0
bool CGUIDialogFileStacking::OnMessage(CGUIMessage& message)
{
  switch ( message.GetMessage() )
  {
  case GUI_MSG_WINDOW_DEINIT:
    CGUIDialog::OnMessage(message);
    if (m_stackItems)
      m_stackItems->Clear();
    return true;
  case GUI_MSG_WINDOW_INIT:
    {
      CGUIDialog::OnMessage(message);
      m_iSelectedFile = -1;
#ifdef PRE_SKIN_VERSION_2_1_COMPATIBILITY
      m_iFrames = 0;

      // enable the CD's
      for (int i = 1; i <= m_iNumberOfFiles; ++i)
      {
        CONTROL_ENABLE(i);
        SET_CONTROL_VISIBLE(i);
      }

      // disable CD's we dont use
      for (int i = m_iNumberOfFiles + 1; i <= 40; ++i)
      {
        SET_CONTROL_HIDDEN(i);
        CONTROL_DISABLE(i);
      }
#endif
      if (GetControl(STACK_LIST))
      { // have the new stack list instead - fill it up
        CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), STACK_LIST);
        OnMessage(msg);
        for (int i = 0; i < m_iNumberOfFiles; i++)
        {
          CStdString label;
          label.Format("Part %i", i+1);
          CFileItem *item = new CFileItem(label);
          m_stackItems->Add(item);
          CGUIMessage msg(GUI_MSG_LABEL_ADD, GetID(), STACK_LIST, 0, 0, item);
          OnMessage(msg);
        }
      }
      return true;
    }
    break;

  case GUI_MSG_CLICKED:
    {
#ifdef PRE_SKIN_VERSION_2_1_COMPATIBILITY
      if (message.GetSenderId() != STACK_LIST)
        m_iSelectedFile = message.GetSenderId();
      else if (message.GetParam1() == ACTION_SELECT_ITEM)
      {
        // grab the selected item
        CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), STACK_LIST);
        OnMessage(msg);
        m_iSelectedFile = msg.GetParam1() + 1;
      }
#endif
      Close();
      return true;
    }
    break;
  }
  return CGUIDialog::OnMessage(message);
}
コード例 #27
0
bool CGUIWindowSettingsScreenCalibration::OnMessage(CGUIMessage& message)
{
  switch ( message.GetMessage() )
  {
  case GUI_MSG_WINDOW_DEINIT:
    {
      CDisplaySettings::GetInstance().UpdateCalibrations();
      CServiceBroker::GetSettings()->Save();
      CServiceBroker::GetWinSystem()->GetGfxContext().SetCalibrating(false);
      // reset our screen resolution to what it was initially
      CServiceBroker::GetWinSystem()->GetGfxContext().SetVideoResolution(CDisplaySettings::GetInstance().GetCurrentResolution(), false);
      CServiceBroker::GetGUI()->GetWindowManager().SendMessage(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_WINDOW_RESIZE);
    }
    break;

  case GUI_MSG_WINDOW_INIT:
    {
      CGUIWindow::OnMessage(message);
      CServiceBroker::GetWinSystem()->GetGfxContext().SetCalibrating(true);

      // Get the allowable resolutions that we can calibrate...
      m_Res.clear();
      if (g_application.GetAppPlayer().IsPlayingVideo())
      { // don't allow resolution switching if we are playing a video

        g_application.GetAppPlayer().TriggerUpdateResolution();

        m_iCurRes = 0;
        m_Res.push_back(CServiceBroker::GetWinSystem()->GetGfxContext().GetVideoResolution());
        SET_CONTROL_VISIBLE(CONTROL_VIDEO);
      }
      else
      {
        SET_CONTROL_HIDDEN(CONTROL_VIDEO);
        m_iCurRes = (unsigned int)-1;
        CServiceBroker::GetWinSystem()->GetGfxContext().GetAllowedResolutions(m_Res);
        // find our starting resolution
        m_iCurRes = FindCurrentResolution();
      }
      if (m_iCurRes==(unsigned int)-1)
      {
        CLog::Log(LOGERROR, "CALIBRATION: Reported current resolution: %d", (int)CServiceBroker::GetWinSystem()->GetGfxContext().GetVideoResolution());
        CLog::Log(LOGERROR, "CALIBRATION: Could not determine current resolution, falling back to default");
        m_iCurRes = 0;
      }

      // Setup the first control
      m_iControl = CONTROL_TOP_LEFT;
      ResetControls();
      return true;
    }
    break;
  case GUI_MSG_CLICKED:
    {
      // clicked - change the control...
      NextControl();
    }
    break;
  case GUI_MSG_NOTIFY_ALL:
    {
      if (message.GetParam1() == GUI_MSG_WINDOW_RESIZE)
      {
        m_iCurRes = FindCurrentResolution();
      }
    }
    break;
  // send before touch for requesting gesture features - we don't want this
  // it would result in unfocus in the onmessage below ...
  case GUI_MSG_GESTURE_NOTIFY:
  // send after touch for unfocussing - we don't want this in this window!
  case GUI_MSG_UNFOCUS_ALL:
    return true;
    break;
  }
  return CGUIWindow::OnMessage(message);
}