本文整理汇总了C++中CAction::GetID方法的典型用法代码示例。如果您正苦于以下问题:C++ CAction::GetID方法的具体用法?C++ CAction::GetID怎么用?C++ CAction::GetID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAction
的用法示例。
在下文中一共展示了CAction::GetID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnAction
bool CGUISliderControl::OnAction(const CAction &action)
{
switch ( action.GetID() )
{
case ACTION_MOVE_LEFT:
//case ACTION_OSD_SHOW_VALUE_MIN:
Move( -1);
return true;
break;
case ACTION_MOVE_RIGHT:
//case ACTION_OSD_SHOW_VALUE_PLUS:
Move(1);
return true;
break;
default:
return CGUIControl::OnAction(action);
}
}
示例2: OnAction
bool CGUIWindowSettingsScreenCalibration::OnAction(const CAction &action)
{
switch (action.GetID())
{
case ACTION_CALIBRATE_SWAP_ARROWS:
{
NextControl();
return true;
}
break;
case ACTION_CALIBRATE_RESET:
{
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
pDialog->SetHeading(20325);
CStdString strText;
strText.Format(g_localizeStrings.Get(20326).c_str(), g_settings.m_ResInfo[m_Res[m_iCurRes]].strMode.c_str());
pDialog->SetLine(0, strText);
pDialog->SetLine(1, 20327);
pDialog->SetChoice(0, 222);
pDialog->SetChoice(1, 186);
pDialog->DoModal();
if (pDialog->IsConfirmed())
{
g_graphicsContext.ResetScreenParameters(m_Res[m_iCurRes]);
ResetControls();
}
return true;
}
break;
case ACTION_CHANGE_RESOLUTION:
// choose the next resolution in our list
{
m_iCurRes = (m_iCurRes+1) % m_Res.size();
g_graphicsContext.SetVideoResolution(m_Res[m_iCurRes]);
ResetControls();
return true;
}
break;
}
return CGUIWindow::OnAction(action); // base class to handle basic movement etc.
}
示例3: OnAction
bool CGUIDialogPeripheralManager::OnAction(const CAction &action)
{
int iActionId = action.GetID();
if (iActionId == ACTION_PREVIOUS_MENU || iActionId == ACTION_PARENT_DIR)
{
Close();
return true;
}
else if (GetFocusedControlID() == CONTROL_LIST &&
(iActionId == ACTION_MOVE_DOWN || iActionId == ACTION_MOVE_UP ||
iActionId == ACTION_PAGE_DOWN || iActionId == ACTION_PAGE_UP))
{
CGUIDialog::OnAction(action);
int iSelected = m_viewControl.GetSelectedItem();
if (iSelected != m_iSelected)
m_iSelected = iSelected;
UpdateButtons();
return true;
}
return CGUIDialog::OnAction(action);
}
示例4: OnAction
bool CGUIControl::OnAction(const CAction &action)
{
if (HasFocus())
{
switch (action.GetID())
{
case ACTION_MOVE_DOWN:
OnDown();
return true;
case ACTION_MOVE_UP:
OnUp();
return true;
case ACTION_MOVE_LEFT:
OnLeft();
return true;
case ACTION_MOVE_RIGHT:
OnRight();
return true;
case ACTION_SHOW_INFO:
return OnInfo();
case ACTION_NAV_BACK:
return OnBack();
case ACTION_NEXT_CONTROL:
OnNextControl();
return true;
case ACTION_PREV_CONTROL:
OnPrevControl();
return true;
}
}
return false;
}
示例5: OnAction
bool CGUIDialogPVRItemsViewBase::OnAction(const CAction &action)
{
if (m_viewControl.HasControl(GetFocusedControlID()))
{
switch (action.GetID())
{
case ACTION_SHOW_INFO:
case ACTION_SELECT_ITEM:
case ACTION_MOUSE_LEFT_CLICK:
ShowInfo(m_viewControl.GetSelectedItem());
return true;
case ACTION_CONTEXT_MENU:
case ACTION_MOUSE_RIGHT_CLICK:
return ContextMenu(m_viewControl.GetSelectedItem());
default:
break;
}
}
return CGUIDialog::OnAction(action);
}
示例6: OnAction
bool CGUIDialogPictureInfo::OnAction(const CAction& action)
{
switch (action.GetID())
{
// if we're running from slideshow mode, drop the "next picture" and "previous picture" actions through.
case ACTION_NEXT_PICTURE:
case ACTION_PREV_PICTURE:
case ACTION_PLAYER_PLAY:
case ACTION_PAUSE:
if (g_windowManager.GetActiveWindow() == WINDOW_SLIDESHOW)
{
CGUIWindow* pWindow = g_windowManager.GetWindow(WINDOW_SLIDESHOW);
return pWindow->OnAction(action);
}
break;
case ACTION_SHOW_INFO:
Close();
return true;
};
return CGUIDialog::OnAction(action);
}
示例7: OnAction
bool CGUIVisualisationControl::OnAction(const CAction &action)
{
if (!m_addon)
return false;
switch (action.GetID())
{
case ACTION_VIS_PRESET_NEXT:
return m_addon->OnAction(VIS_ACTION_NEXT_PRESET);
case ACTION_VIS_PRESET_PREV:
return m_addon->OnAction(VIS_ACTION_PREV_PRESET);
case ACTION_VIS_PRESET_RANDOM:
return m_addon->OnAction(VIS_ACTION_RANDOM_PRESET);
case ACTION_VIS_RATE_PRESET_PLUS:
return m_addon->OnAction(VIS_ACTION_RATE_PRESET_PLUS);
case ACTION_VIS_RATE_PRESET_MINUS:
return m_addon->OnAction(VIS_ACTION_RATE_PRESET_MINUS);
case ACTION_VIS_PRESET_LOCK:
return m_addon->OnAction(VIS_ACTION_LOCK_PRESET);
default:
return CGUIRenderingControl::OnAction(action);
}
}
示例8: SeekTimeCode
bool CSeekHandler::SeekTimeCode(const CAction &action)
{
if (m_timeCodePosition <= 0)
return false;
switch (action.GetID())
{
case ACTION_SELECT_ITEM:
case ACTION_PLAYER_PLAY:
case ACTION_PAUSE:
{
CSingleLock lock(m_critSection);
g_application.m_pPlayer->SeekTime(GetTimeCodeSeconds() * 1000);
Reset();
return true;
}
case ACTION_SMALL_STEP_BACK:
case ACTION_STEP_BACK:
case ACTION_BIG_STEP_BACK:
case ACTION_CHAPTER_OR_BIG_STEP_BACK:
{
SeekSeconds(-GetTimeCodeSeconds());
return true;
}
case ACTION_STEP_FORWARD:
case ACTION_BIG_STEP_FORWARD:
case ACTION_CHAPTER_OR_BIG_STEP_FORWARD:
{
SeekSeconds(GetTimeCodeSeconds());
return true;
}
default:
break;
}
return false;
}
示例9: OnAction
bool CGUIScrollBar::OnAction(const CAction &action)
{
switch ( action.GetID() )
{
case ACTION_MOVE_LEFT:
if (m_orientation == HORIZONTAL)
{
Move( -1);
return true;
}
break;
case ACTION_MOVE_RIGHT:
if (m_orientation == HORIZONTAL)
{
Move(1);
return true;
}
break;
case ACTION_MOVE_UP:
if (m_orientation == VERTICAL)
{
Move(-1);
return true;
}
break;
case ACTION_MOVE_DOWN:
if (m_orientation == VERTICAL)
{
Move(1);
return true;
}
break;
}
return CGUIControl::OnAction(action);
}
示例10: OnAction
bool CGUIWindowTestPattern::OnAction(const CAction &action)
{
switch (action.GetID())
{
case ACTION_PREVIOUS_MENU:
{
g_windowManager.PreviousWindow();
return true;
}
break;
case ACTION_MOVE_UP:
case ACTION_MOVE_LEFT:
m_pattern = m_pattern > 0 ? m_pattern - 1 : TEST_PATTERNS_COUNT - 1;
break;
case ACTION_MOVE_DOWN:
case ACTION_MOVE_RIGHT:
m_pattern = (m_pattern + 1) % TEST_PATTERNS_COUNT;
break;
}
return CGUIWindow::OnAction(action); // base class to handle basic movement etc.
}
示例11: OnAction
bool CGUISliderControl::OnAction(const CAction &action)
{
switch ( action.GetID() )
{
case ACTION_MOVE_LEFT:
Move(-1);
return true;
case ACTION_MOVE_RIGHT:
Move(1);
return true;
case ACTION_SELECT_ITEM:
// switch between the two sliders
if (m_rangeSelection)
SwitchRangeSelector();
return true;
default:
break;
}
return CGUIControl::OnAction(action);
}
示例12: OnAction
bool CRetroPlayer::OnAction(const CAction &action)
{
switch (action.GetID())
{
case ACTION_PLAYER_RESET:
{
if (m_gameClient)
{
float speed = static_cast<float>(m_gameClient->GetPlayback()->GetSpeed());
m_gameClient->GetPlayback()->SetSpeed(0.0);
m_gameServices.PortManager().HardwareReset();
// If rewinding or paused, begin playback
if (speed <= 0.0f)
speed = 1.0f;
SetSpeed(speed);
}
return true;
}
case ACTION_SHOW_OSD:
{
if (m_gameClient && m_gameClient->GetPlayback()->GetSpeed() == 0.0)
{
CloseOSD();
return true;
}
}
default:
break;
}
return false;
}
示例13: OnAction
bool CGUIDialogKeyboardGeneric::OnAction(const CAction &action)
{
bool handled(true);
if (action.GetID() == ACTION_BACKSPACE)
{
Backspace();
}
else if (action.GetID() == ACTION_ENTER)
{
OnOK();
}
else if (action.GetID() == ACTION_CURSOR_LEFT)
{
MoveCursor( -1);
}
else if (action.GetID() == ACTION_CURSOR_RIGHT)
{
MoveCursor(1);
}
else if (action.GetID() == ACTION_SHIFT)
{
OnShift();
}
else if (action.GetID() == ACTION_SYMBOLS)
{
OnSymbols();
}
else if (action.GetID() >= KEY_ASCII)
{ // send action to the edit control
CGUIControl *edit = GetControl(CTL_EDIT);
if (edit)
edit->OnAction(action);
}
else // unhandled by us - let's see if the baseclass wants it
handled = CGUIDialog::OnAction(action);
return handled;
}
示例14: OnAction
bool CSeekHandler::OnAction(const CAction &action)
{
if (!g_application.m_pPlayer->IsPlaying() || !g_application.m_pPlayer->CanSeek())
return false;
SeekType type = g_application.CurrentFileItem().IsAudio() ? SEEK_TYPE_MUSIC : SEEK_TYPE_VIDEO;
if (SeekTimeCode(action))
return true;
switch (action.GetID())
{
case ACTION_SMALL_STEP_BACK:
case ACTION_STEP_BACK:
{
Seek(false, action.GetAmount(), action.GetRepeat(), false, type);
return true;
}
case ACTION_STEP_FORWARD:
{
Seek(true, action.GetAmount(), action.GetRepeat(), false, type);
return true;
}
case ACTION_BIG_STEP_BACK:
case ACTION_CHAPTER_OR_BIG_STEP_BACK:
{
g_application.m_pPlayer->Seek(false, true, action.GetID() == ACTION_CHAPTER_OR_BIG_STEP_BACK);
return true;
}
case ACTION_BIG_STEP_FORWARD:
case ACTION_CHAPTER_OR_BIG_STEP_FORWARD:
{
g_application.m_pPlayer->Seek(true, true, action.GetID() == ACTION_CHAPTER_OR_BIG_STEP_FORWARD);
return true;
}
case ACTION_NEXT_SCENE:
{
g_application.m_pPlayer->SeekScene(true);
return true;
}
case ACTION_PREV_SCENE:
{
g_application.m_pPlayer->SeekScene(false);
return true;
}
case ACTION_ANALOG_SEEK_FORWARD:
case ACTION_ANALOG_SEEK_BACK:
{
if (action.GetAmount())
Seek(action.GetID() == ACTION_ANALOG_SEEK_FORWARD, action.GetAmount(), action.GetRepeat(), true);
return true;
}
case REMOTE_0:
case REMOTE_1:
case REMOTE_2:
case REMOTE_3:
case REMOTE_4:
case REMOTE_5:
case REMOTE_6:
case REMOTE_7:
case REMOTE_8:
case REMOTE_9:
{
if (!g_application.CurrentFileItem().IsLiveTV())
{
ChangeTimeCode(action.GetID());
return true;
}
}
break;
default:
break;
}
return false;
}
示例15: OnAction
bool CStereoscopicsManager::OnAction(const CAction &action)
{
RENDER_STEREO_MODE mode = GetStereoMode();
if (action.GetID() == ACTION_STEREOMODE_NEXT)
{
SetStereoModeByUser(GetNextSupportedStereoMode(mode));
return true;
}
else if (action.GetID() == ACTION_STEREOMODE_PREVIOUS)
{
SetStereoModeByUser(GetNextSupportedStereoMode(mode, RENDER_STEREO_MODE_COUNT - 1));
return true;
}
else if (action.GetID() == ACTION_STEREOMODE_TOGGLE)
{
if (mode == RENDER_STEREO_MODE_OFF)
{
RENDER_STEREO_MODE targetMode = GetPreferredPlaybackMode();
// if user selected a specific mode before, make sure to
// switch back into that mode on toggle.
if (m_stereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED)
{
// if user mode is set to OFF, he manually turned it off before. In this case use the last user applied mode
if (m_stereoModeSetByUser != RENDER_STEREO_MODE_OFF)
targetMode = m_stereoModeSetByUser;
else if (m_lastStereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED && m_lastStereoModeSetByUser != RENDER_STEREO_MODE_OFF)
targetMode = m_lastStereoModeSetByUser;
}
SetStereoModeByUser(targetMode);
}
else
{
SetStereoModeByUser(RENDER_STEREO_MODE_OFF);
}
return true;
}
else if (action.GetID() == ACTION_STEREOMODE_SELECT)
{
SetStereoModeByUser(GetStereoModeByUserChoice());
return true;
}
else if (action.GetID() == ACTION_STEREOMODE_TOMONO)
{
if (mode == RENDER_STEREO_MODE_MONO)
{
RENDER_STEREO_MODE targetMode = GetPreferredPlaybackMode();
// if we have an old userdefined steremode, use that one as toggle target
if (m_stereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED)
{
// if user mode is set to OFF, he manually turned it off before. In this case use the last user applied mode
if (m_stereoModeSetByUser != RENDER_STEREO_MODE_OFF && m_stereoModeSetByUser != mode)
targetMode = m_stereoModeSetByUser;
else if (m_lastStereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED && m_lastStereoModeSetByUser != RENDER_STEREO_MODE_OFF && m_lastStereoModeSetByUser != mode)
targetMode = m_lastStereoModeSetByUser;
}
SetStereoModeByUser(targetMode);
}
else
{
SetStereoModeByUser(RENDER_STEREO_MODE_MONO);
}
return true;
}
else if (action.GetID() == ACTION_STEREOMODE_SET)
{
int stereoMode = ConvertStringToGuiStereoMode(action.GetName());
if (stereoMode > -1)
SetStereoModeByUser( (RENDER_STEREO_MODE) stereoMode );
return true;
}
return false;
}