本文整理汇总了C++中CGUIDialog类的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialog类的具体用法?C++ CGUIDialog怎么用?C++ CGUIDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CGUIDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetOSD
void CGameWindowFullScreen::TriggerOSD()
{
CGUIDialog *pOSD = GetOSD();
if (pOSD != nullptr)
{
if (!pOSD->IsDialogRunning())
pOSD->Open();
}
}
示例2: if
void CPVRActionListener::OnSettingAction(const CSetting *setting)
{
if (setting == nullptr)
return;
const std::string &settingId = setting->GetId();
if (settingId == CSettings::SETTING_PVRMANAGER_RESETDB)
{
CServiceBroker::GetPVRManager().GUIActions()->ResetPVRDatabase(false);
}
else if (settingId == CSettings::SETTING_EPG_RESETEPG)
{
CServiceBroker::GetPVRManager().GUIActions()->ResetPVRDatabase(true);
}
else if (settingId == CSettings::SETTING_PVRMANAGER_CHANNELMANAGER)
{
if (CServiceBroker::GetPVRManager().IsStarted())
{
CGUIDialog *dialog = g_windowManager.GetDialog(WINDOW_DIALOG_PVR_CHANNEL_MANAGER);
if (dialog)
dialog->Open();
}
}
else if (settingId == CSettings::SETTING_PVRMANAGER_GROUPMANAGER)
{
if (CServiceBroker::GetPVRManager().IsStarted())
{
CGUIDialog *dialog = g_windowManager.GetDialog(WINDOW_DIALOG_PVR_GROUP_MANAGER);
if (dialog)
dialog->Open();
}
}
else if (settingId == CSettings::SETTING_PVRMANAGER_CHANNELSCAN)
{
CServiceBroker::GetPVRManager().GUIActions()->StartChannelScan();
}
else if (settingId == CSettings::SETTING_PVRMENU_SEARCHICONS)
{
CServiceBroker::GetPVRManager().TriggerSearchMissingChannelIcons();
}
else if (settingId == CSettings::SETTING_PVRCLIENT_MENUHOOK)
{
CServiceBroker::GetPVRManager().GUIActions()->ProcessMenuHooks(CFileItemPtr());
}
}
示例3: OnAction
EVENT_RESULT CGUIWindowVisualisation::OnMouseEvent(const CPoint &point, const CMouseEvent &event)
{
if (event.m_id == ACTION_MOUSE_RIGHT_CLICK)
{ // no control found to absorb this click - go back to GUI
OnAction(CAction(ACTION_SHOW_GUI));
return EVENT_RESULT_HANDLED;
}
if (event.m_id != ACTION_MOUSE_MOVE || event.m_offsetX || event.m_offsetY)
{ // some other mouse action has occurred - bring up the OSD
CGUIDialog *pOSD = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_OSD);
if (pOSD)
{
pOSD->SetAutoClose(3000);
pOSD->DoModal();
}
return EVENT_RESULT_HANDLED;
}
return EVENT_RESULT_UNHANDLED;
}
示例4: lock
bool CGUIWindowManager::HasModalDialog(const std::vector<DialogModalityType>& types) const
{
CSingleLock lock(g_graphicsContext);
for (ciDialog it = m_activeDialogs.begin(); it != m_activeDialogs.end(); ++it)
{
if ((*it)->IsDialog() &&
(*it)->IsModalDialog() &&
!(*it)->IsAnimating(ANIM_TYPE_WINDOW_CLOSE))
{
if (!types.empty())
{
CGUIDialog *dialog = static_cast<CGUIDialog*>(*it);
for (const auto &type : types)
{
if (dialog->GetModalityType() == type)
return true;
}
}
else
return true;
}
}
return false;
}
示例5: lock
bool CGUIWindowManager::HasModalDialog(const std::vector<DialogModalityType>& types, bool ignoreClosing /* = true */) const
{
CSingleLock lock(g_graphicsContext);
for (const auto& window : m_activeDialogs)
{
if (window->IsDialog() &&
window->IsModalDialog() &&
(!ignoreClosing || !window->IsAnimating(ANIM_TYPE_WINDOW_CLOSE)))
{
if (!types.empty())
{
CGUIDialog *dialog = static_cast<CGUIDialog*>(window);
for (const auto &type : types)
{
if (dialog->GetModalityType() == type)
return true;
}
}
else
return true;
}
}
return false;
}
示例6: switch
bool CGUIDialogVideoOSD::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_VIDEO_MENU_STARTED:
{
// We have gone to the DVD menu, so close the OSD.
Close();
}
break;
case GUI_MSG_WINDOW_DEINIT: // fired when OSD is hidden
{
// Remove our subdialogs if visible
CGUIDialog *pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_AUDIO_DSP_OSD_SETTINGS);
if (pDialog && pDialog->IsDialogRunning())
pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_AUDIO_OSD_SETTINGS);
if (pDialog && pDialog->IsDialogRunning())
pDialog->Close(true);
}
break;
}
return CGUIDialog::OnMessage(message);
}
示例7: switch
bool CPlayerGUIInfo::GetBool(bool& value, const CGUIListItem *gitem, int contextWindow, const CGUIInfo &info) const
{
const CFileItem *item = nullptr;
if (gitem->IsFileItem())
item = static_cast<const CFileItem*>(gitem);
switch (info.m_info)
{
///////////////////////////////////////////////////////////////////////////////////////////////
// PLAYER_*
///////////////////////////////////////////////////////////////////////////////////////////////
case PLAYER_SHOWINFO:
value = m_playerShowInfo;
return true;
case PLAYER_DISPLAY_AFTER_SEEK:
value = GetDisplayAfterSeek();
return true;
case PLAYER_SHOWTIME:
value = m_playerShowTime;
return true;
case PLAYER_MUTED:
value = (g_application.IsMuted() || g_application.GetVolume(false) <= VOLUME_MINIMUM);
return true;
case PLAYER_HAS_MEDIA:
value = g_application.GetAppPlayer().IsPlaying();
return true;
case PLAYER_HAS_AUDIO:
value = g_application.GetAppPlayer().IsPlayingAudio();
return true;
case PLAYER_HAS_VIDEO:
value = g_application.GetAppPlayer().IsPlayingVideo();
return true;
case PLAYER_HAS_GAME:
value = g_application.GetAppPlayer().IsPlayingGame();
return true;
case PLAYER_PLAYING:
value = g_application.GetAppPlayer().GetPlaySpeed() == 1.0;
return true;
case PLAYER_PAUSED:
value = g_application.GetAppPlayer().IsPausedPlayback();
return true;
case PLAYER_REWINDING:
value = g_application.GetAppPlayer().GetPlaySpeed() < 0;
return true;
case PLAYER_FORWARDING:
value = g_application.GetAppPlayer().GetPlaySpeed() > 1.5;
return true;
case PLAYER_REWINDING_2x:
value = g_application.GetAppPlayer().GetPlaySpeed() == -2;
return true;
case PLAYER_REWINDING_4x:
value = g_application.GetAppPlayer().GetPlaySpeed() == -4;
return true;
case PLAYER_REWINDING_8x:
value = g_application.GetAppPlayer().GetPlaySpeed() == -8;
return true;
case PLAYER_REWINDING_16x:
value = g_application.GetAppPlayer().GetPlaySpeed() == -16;
return true;
case PLAYER_REWINDING_32x:
value = g_application.GetAppPlayer().GetPlaySpeed() == -32;
return true;
case PLAYER_FORWARDING_2x:
value = g_application.GetAppPlayer().GetPlaySpeed() == 2;
return true;
case PLAYER_FORWARDING_4x:
value = g_application.GetAppPlayer().GetPlaySpeed() == 4;
return true;
case PLAYER_FORWARDING_8x:
value = g_application.GetAppPlayer().GetPlaySpeed() == 8;
return true;
case PLAYER_FORWARDING_16x:
value = g_application.GetAppPlayer().GetPlaySpeed() == 16;
return true;
case PLAYER_FORWARDING_32x:
value = g_application.GetAppPlayer().GetPlaySpeed() == 32;
return true;
case PLAYER_CAN_PAUSE:
value = g_application.GetAppPlayer().CanPause();
return true;
case PLAYER_CAN_SEEK:
value = g_application.GetAppPlayer().CanSeek();
return true;
case PLAYER_SUPPORTS_TEMPO:
value = g_application.GetAppPlayer().SupportsTempo();
return true;
case PLAYER_IS_TEMPO:
{
value = (g_application.GetAppPlayer().GetPlayTempo() != 1.0 &&
g_application.GetAppPlayer().GetPlaySpeed() == 1.0);
return true;
}
case PLAYER_CACHING:
value = g_application.GetAppPlayer().IsCaching();
return true;
case PLAYER_SEEKBAR:
{
CGUIDialog *seekBar = CServiceBroker::GetGUI()->GetWindowManager().GetDialog(WINDOW_DIALOG_SEEK_BAR);
value = seekBar ? seekBar->IsDialogRunning() : false;
return true;
//.........这里部分代码省略.........
示例8: switch
bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_INIT:
{
// check whether we've come back here from a window during which time we've actually
// stopped playing videos
if (message.GetParam1() == WINDOW_INVALID && !g_application.IsPlayingVideo())
{ // why are we here if nothing is playing???
g_windowManager.PreviousWindow();
return true;
}
g_infoManager.SetShowInfo(false);
g_infoManager.SetShowCodec(false);
m_bShowCurrentTime = false;
g_infoManager.SetDisplayAfterSeek(0); // Make sure display after seek is off.
// switch resolution
g_graphicsContext.SetFullScreenVideo(true);
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update(false);
#endif
// now call the base class to load our windows
CGUIWindow::OnMessage(message);
m_bShowViewModeInfo = false;
if (CUtil::IsUsingTTFSubtitles())
{
CSingleLock lock (m_fontLock);
CStdString fontPath = "special://xbmc/media/Fonts/";
fontPath += g_guiSettings.GetString("subtitles.font");
// We scale based on PAL4x3 - this at least ensures all sizing is constant across resolutions.
RESOLUTION_INFO pal(720, 576, 0);
CGUIFont *subFont = g_fontManager.LoadTTF("__subtitle__", fontPath, color[g_guiSettings.GetInt("subtitles.color")], 0, g_guiSettings.GetInt("subtitles.height"), g_guiSettings.GetInt("subtitles.style"), false, 1.0f, 1.0f, &pal, true);
CGUIFont *borderFont = g_fontManager.LoadTTF("__subtitleborder__", fontPath, 0xFF000000, 0, g_guiSettings.GetInt("subtitles.height"), g_guiSettings.GetInt("subtitles.style"), true, 1.0f, 1.0f, &pal, true);
if (!subFont || !borderFont)
CLog::Log(LOGERROR, "CGUIWindowFullScreen::OnMessage(WINDOW_INIT) - Unable to load subtitle font");
else
m_subsLayout = new CGUITextLayout(subFont, true, 0, borderFont);
}
else
m_subsLayout = NULL;
return true;
}
case GUI_MSG_WINDOW_DEINIT:
{
CGUIWindow::OnMessage(message);
CGUIDialog *pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_OSD_TELETEXT);
if (pDialog) pDialog->Close(true);
CGUIDialogSlider *slider = (CGUIDialogSlider *)g_windowManager.GetWindow(WINDOW_DIALOG_SLIDER);
if (slider) slider->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_OSD);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_FULLSCREEN_INFO);
if (pDialog) pDialog->Close(true);
FreeResources(true);
CSingleLock lock (g_graphicsContext);
g_graphicsContext.SetFullScreenVideo(false);
lock.Leave();
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update(false);
#endif
CSingleLock lockFont(m_fontLock);
if (m_subsLayout)
{
g_fontManager.Unload("__subtitle__");
g_fontManager.Unload("__subtitleborder__");
delete m_subsLayout;
m_subsLayout = NULL;
}
return true;
}
case GUI_MSG_SETFOCUS:
case GUI_MSG_LOSTFOCUS:
if (message.GetSenderId() != WINDOW_FULLSCREEN_VIDEO) return true;
break;
}
return CGUIWindow::OnMessage(message);
}
示例9: switch
bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_INIT:
{
// check whether we've come back here from a window during which time we've actually
// stopped playing videos
if (message.GetParam1() == WINDOW_INVALID && !g_application.IsPlayingVideo())
{ // why are we here if nothing is playing???
g_windowManager.PreviousWindow();
return true;
}
g_infoManager.SetShowInfo(false);
g_infoManager.SetShowCodec(false);
m_bShowCurrentTime = false;
m_bGroupSelectShow = false;
g_infoManager.SetDisplayAfterSeek(0); // Make sure display after seek is off.
// switch resolution
g_graphicsContext.SetFullScreenVideo(true);
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update(false);
#endif
// now call the base class to load our windows
CGUIWindow::OnMessage(message);
m_bShowViewModeInfo = false;
if (CUtil::IsUsingTTFSubtitles())
{
CSingleLock lock (m_fontLock);
CStdString fontPath = "special://xbmc/media/Fonts/";
fontPath += g_guiSettings.GetString("subtitles.font");
// We scale based on PAL4x3 - this at least ensures all sizing is constant across resolutions.
RESOLUTION_INFO pal(720, 576, 0);
CGUIFont *subFont = g_fontManager.LoadTTF("__subtitle__", fontPath, color[g_guiSettings.GetInt("subtitles.color")], 0, g_guiSettings.GetInt("subtitles.height"), g_guiSettings.GetInt("subtitles.style"), false, 1.0f, 1.0f, &pal, true);
CGUIFont *borderFont = g_fontManager.LoadTTF("__subtitleborder__", fontPath, 0xFF000000, 0, g_guiSettings.GetInt("subtitles.height"), g_guiSettings.GetInt("subtitles.style"), true, 1.0f, 1.0f, &pal, true);
if (!subFont || !borderFont)
CLog::Log(LOGERROR, "CGUIWindowFullScreen::OnMessage(WINDOW_INIT) - Unable to load subtitle font");
else
m_subsLayout = new CGUITextLayout(subFont, true, 0, borderFont);
}
else
m_subsLayout = NULL;
return true;
}
case GUI_MSG_WINDOW_DEINIT:
{
CGUIWindow::OnMessage(message);
CGUIDialog *pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_OSD_TELETEXT);
if (pDialog) pDialog->Close(true);
CGUIDialogSlider *slider = (CGUIDialogSlider *)g_windowManager.GetWindow(WINDOW_DIALOG_SLIDER);
if (slider) slider->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_OSD);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_FULLSCREEN_INFO);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_CHANNELS);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_GUIDE);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_DIRECTOR);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_CUTTER);
if (pDialog) pDialog->Close(true);
FreeResources(true);
CSingleLock lock (g_graphicsContext);
g_graphicsContext.SetFullScreenVideo(false);
lock.Leave();
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update(false);
#endif
CSingleLock lockFont(m_fontLock);
if (m_subsLayout)
{
g_fontManager.Unload("__subtitle__");
g_fontManager.Unload("__subtitleborder__");
delete m_subsLayout;
m_subsLayout = NULL;
}
return true;
}
case GUI_MSG_CLICKED:
{
unsigned int iControl = message.GetSenderId();
if (iControl == CONTROL_GROUP_CHOOSER && g_PVRManager.IsStarted())
{
//.........这里部分代码省略.........
示例10: switch
bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_INIT:
{
// check whether we've come back here from a window during which time we've actually
// stopped playing videos
if (message.GetParam1() == WINDOW_INVALID && !g_application.m_pPlayer->IsPlayingVideo())
{ // why are we here if nothing is playing???
g_windowManager.PreviousWindow();
return true;
}
g_infoManager.SetShowInfo(false);
g_infoManager.SetShowCodec(false);
m_bShowCurrentTime = false;
m_bGroupSelectShow = false;
g_infoManager.SetDisplayAfterSeek(0); // Make sure display after seek is off.
// switch resolution
g_graphicsContext.SetFullScreenVideo(true);
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update();
#endif
// now call the base class to load our windows
CGUIWindow::OnMessage(message);
m_bShowViewModeInfo = false;
return true;
}
case GUI_MSG_WINDOW_DEINIT:
{
CGUIDialog *pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_OSD_TELETEXT);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_SLIDER);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_OSD);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_FULLSCREEN_INFO);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_CHANNELS);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_GUIDE);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_DIRECTOR);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_CUTTER);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_SUBTITLES);
if (pDialog) pDialog->Close(true);
CGUIWindow::OnMessage(message);
CSettings::Get().Save();
CSingleLock lock (g_graphicsContext);
g_graphicsContext.SetFullScreenVideo(false);
lock.Leave();
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update();
#endif
return true;
}
case GUI_MSG_CLICKED:
{
unsigned int iControl = message.GetSenderId();
if (iControl == CONTROL_GROUP_CHOOSER && g_PVRManager.IsStarted())
{
// Get the currently selected label of the Select button
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), iControl);
OnMessage(msg);
CStdString strLabel = msg.GetLabel();
CPVRChannelPtr playingChannel;
if (g_PVRManager.GetCurrentChannel(playingChannel))
{
CPVRChannelGroupPtr selectedGroup = g_PVRChannelGroups->Get(playingChannel->IsRadio())->GetByName(strLabel);
if (selectedGroup)
{
g_PVRManager.SetPlayingGroup(selectedGroup);
CLog::Log(LOGDEBUG, "%s - switched to group '%s'", __FUNCTION__, selectedGroup->GroupName().c_str());
if (!selectedGroup->IsGroupMember(*playingChannel))
{
CLog::Log(LOGDEBUG, "%s - channel '%s' is not a member of '%s', switching to channel 1 of the new group",
__FUNCTION__, playingChannel->ChannelName().c_str(), selectedGroup->GroupName().c_str());
CFileItemPtr switchChannel = selectedGroup->GetByChannelNumber(1);
if (switchChannel && switchChannel->HasPVRChannelInfoTag())
g_application.OnAction(CAction(ACTION_CHANNEL_SWITCH, (float) switchChannel->GetPVRChannelInfoTag()->ChannelNumber()));
else
{
CLog::Log(LOGERROR, "%s - cannot find channel '1' in group %s", __FUNCTION__, selectedGroup->GroupName().c_str());
CApplicationMessenger::Get().MediaStop(false);
}
//.........这里部分代码省略.........
示例11: switch
bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_INIT:
{
// check whether we've come back here from a window during which time we've actually
// stopped playing videos
if (message.GetParam1() == WINDOW_INVALID && !g_application.m_pPlayer->IsPlayingVideo())
{ // why are we here if nothing is playing???
g_windowManager.PreviousWindow();
return true;
}
g_infoManager.SetShowInfo(false);
g_infoManager.SetShowCodec(false);
m_bShowCurrentTime = false;
g_infoManager.SetDisplayAfterSeek(0); // Make sure display after seek is off.
// switch resolution
g_graphicsContext.SetFullScreenVideo(true);
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update();
#endif
// now call the base class to load our windows
CGUIWindow::OnMessage(message);
m_bShowViewModeInfo = false;
return true;
}
case GUI_MSG_WINDOW_DEINIT:
{
CGUIDialog *pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_OSD_TELETEXT);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_SLIDER);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_OSD);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_FULLSCREEN_INFO);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_CHANNELS);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_GUIDE);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_SUBTITLES);
if (pDialog) pDialog->Close(true);
CGUIWindow::OnMessage(message);
CSettings::Get().Save();
CSingleLock lock (g_graphicsContext);
g_graphicsContext.SetFullScreenVideo(false);
lock.Leave();
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update();
g_renderManager.FrameFinish();
#endif
return true;
}
case GUI_MSG_SETFOCUS:
case GUI_MSG_LOSTFOCUS:
if (message.GetSenderId() != WINDOW_FULLSCREEN_VIDEO) return true;
break;
}
return CGUIWindow::OnMessage(message);
}
示例12: GetFocusedControlID
bool CGUIWindowBoxeeWizardNetwork::OnAction(const CAction &action)
{
int iControl = GetFocusedControlID();
if (action.wID == ACTION_PREVIOUS_MENU || (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_BACK))
{
Close();
}
else if (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_INTERFACES)
{
ShowWirelessNetworksIfNeeded();
CGUIListContainer *pList = (CGUIListContainer *)GetControl(CONTROL_INTERFACES);
if (pList)
pList->SetSingleSelectedItem();
return true;
}
else if (action.wID == ACTION_MOVE_LEFT && iControl == CONTROL_WIRELESS)
{
ShowInterfaces();
SET_CONTROL_FOCUS(CONTROL_INTERFACES, 0);
CGUIListContainer *pList = (CGUIListContainer *)GetControl(CONTROL_WIRELESS);
if (pList)
pList->SetSingleSelectedItem();
return true;
}
else if (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_WIRELESS)
{
ShowPasswordIfNeeded();
CGUIListContainer *pList = (CGUIListContainer *)GetControl(CONTROL_WIRELESS);
if (pList)
pList->SetSingleSelectedItem();
return true;
}
else if (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_PASSWORD)
{
CGUIButtonControl* passwordButton = (CGUIButtonControl*) GetControl(iControl);
CStdString password = passwordButton->GetLabel();
if (CGUIDialogKeyboard::ShowAndGetInput(password, g_localizeStrings.Get(789), false))
{
passwordButton->SetLabel(password);
CONTROL_ENABLE(CONTROL_NEXT);
SET_CONTROL_FOCUS(CONTROL_NEXT, 0);
}
return true;
}
else if (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_ENC)
{
CGUIButtonControl* encSelectionButton = (CGUIButtonControl*) GetControl(CONTROL_ENC_SELECTION);
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_ENC);
OnMessage(msg);
int iItem = msg.GetParam1();
encSelectionButton->SetLabel(ENC_LABELS[iItem]);
SET_CONTROL_HIDDEN(CONTROL_ENC);
if (iItem == ENC_NONE)
{
SET_CONTROL_HIDDEN(CONTROL_PASSWORD_GROUP);
SET_CONTROL_FOCUS(CONTROL_NEXT, 0);
}
else
{
SET_CONTROL_FOCUS(CONTROL_PASSWORD, 0);
}
return true;
}
else if (action.wID == ACTION_MOVE_LEFT && (iControl == CONTROL_ENC_SELECTION || iControl == CONTROL_PASSWORD))
{
SET_CONTROL_HIDDEN(CONTROL_ENC_GROUP);
SET_CONTROL_HIDDEN(CONTROL_PASSWORD_GROUP);
SET_CONTROL_FOCUS(CONTROL_WIRELESS, 0);
return true;
}
else if (action.wID == ACTION_MOVE_DOWN && iControl == CONTROL_ENC_SELECTION)
{
if (GetControl(CONTROL_PASSWORD_GROUP)->IsVisible())
{
SET_CONTROL_FOCUS(CONTROL_PASSWORD, 0);
}
else if (!GetControl(CONTROL_NEXT)->IsDisabled())
{
SET_CONTROL_FOCUS(CONTROL_NEXT, 0);
}
return true;
}
else if (action.wID == ACTION_MOVE_UP && (iControl == CONTROL_NEXT || iControl == CONTROL_BACK))
{
if (GetControl(CONTROL_PASSWORD_GROUP)->IsVisible())
{
SET_CONTROL_FOCUS(CONTROL_PASSWORD, 0);
}
else if (GetControl(CONTROL_ENC_GROUP)->IsVisible())
{
SET_CONTROL_FOCUS(CONTROL_ENC_SELECTION, 0);
}
else
{
//.........这里部分代码省略.........
示例13: switch
//.........这里部分代码省略.........
#endif
}
break;
case TMSG_EXECUTE_SCRIPT:
#ifdef HAS_PYTHON
g_pythonParser.evalFile(pMsg->strParam.c_str());
#endif
break;
case TMSG_EXECUTE_BUILT_IN:
CBuiltins::Execute(pMsg->strParam.c_str());
break;
case TMSG_PLAYLISTPLAYER_PLAY:
if (pMsg->dwParam1 != (DWORD) -1)
g_playlistPlayer.Play(pMsg->dwParam1);
else
g_playlistPlayer.Play();
break;
case TMSG_PLAYLISTPLAYER_NEXT:
g_playlistPlayer.PlayNext();
break;
case TMSG_PLAYLISTPLAYER_PREV:
g_playlistPlayer.PlayPrevious();
break;
// Window messages below here...
case TMSG_DIALOG_DOMODAL: //doModel of window
{
CGUIDialog* pDialog = (CGUIDialog*)g_windowManager.GetWindow(pMsg->dwParam1);
if (!pDialog) return ;
pDialog->DoModal();
}
break;
case TMSG_DIALOG_PROGRESS_SHOWMODAL:
{
CGUIDialogProgress* pDialog = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
if (!pDialog) return ;
pDialog->StartModal();
}
break;
case TMSG_WRITE_SCRIPT_OUTPUT:
{
//send message to window 2004 (CGUIWindowScriptsInfo)
CGUIMessage msg(GUI_MSG_USER, 0, 0);
msg.SetLabel(pMsg->strParam);
CGUIWindow* pWindowScripts = g_windowManager.GetWindow(WINDOW_SCRIPTS_INFO);
if (pWindowScripts) pWindowScripts->OnMessage(msg);
}
break;
case TMSG_NETWORKMESSAGE:
{
g_application.getNetwork().NetworkMessage((CNetwork::EMESSAGE)pMsg->dwParam1, (int)pMsg->dwParam2);
}
break;
case TMSG_GUI_DO_MODAL:
{
CGUIDialog *pDialog = (CGUIDialog *)pMsg->lpVoid;
示例14: switch
void CGUIWindowManager::OnApplicationMessage(ThreadMessage* pMsg)
{
switch (pMsg->dwMessage)
{
case TMSG_GUI_DIALOG_OPEN:
{
if (pMsg->lpVoid)
static_cast<CGUIDialog*>(pMsg->lpVoid)->Open();
else
{
CGUIDialog* pDialog = static_cast<CGUIDialog*>(GetWindow(pMsg->param1));
if (pDialog)
pDialog->Open();
}
}
break;
case TMSG_GUI_WINDOW_CLOSE:
{
CGUIWindow *window = static_cast<CGUIWindow *>(pMsg->lpVoid);
if (window)
window->Close(pMsg->param1 & 0x1 ? true : false, pMsg->param1, pMsg->param1 & 0x2 ? true : false);
}
break;
case TMSG_GUI_ACTIVATE_WINDOW:
{
ActivateWindow(pMsg->param1, pMsg->params, pMsg->param2 > 0);
}
break;
case TMSG_GUI_ADDON_DIALOG:
{
if (pMsg->lpVoid)
{ // TODO: This is ugly - really these python dialogs should just be normal XBMC dialogs
static_cast<ADDON::CGUIAddonWindowDialog *>(pMsg->lpVoid)->Show_Internal(pMsg->param2 > 0);
}
}
break;
#ifdef HAS_PYTHON
case TMSG_GUI_PYTHON_DIALOG:
{
// This hack is not much better but at least I don't need to make ApplicationMessenger
// know about Addon (Python) specific classes.
CAction caction(pMsg->param1);
static_cast<CGUIWindow*>(pMsg->lpVoid)->OnAction(caction);
}
break;
#endif
case TMSG_GUI_ACTION:
{
if (pMsg->lpVoid)
{
CAction *action = static_cast<CAction *>(pMsg->lpVoid);
if (pMsg->param1 == WINDOW_INVALID)
g_application.OnAction(*action);
else
{
CGUIWindow *pWindow = GetWindow(pMsg->param1);
if (pWindow)
pWindow->OnAction(*action);
else
CLog::Log(LOGWARNING, "Failed to get window with ID %i to send an action to", pMsg->param1);
}
delete action;
}
}
break;
case TMSG_GUI_MESSAGE:
{
if (pMsg->lpVoid)
{
CGUIMessage *message = static_cast<CGUIMessage *>(pMsg->lpVoid);
SendMessage(*message, pMsg->param1);
delete message;
}
}
break;
}
}
示例15: switch
void CGUIWindowManager::OnApplicationMessage(ThreadMessage* pMsg)
{
switch (pMsg->dwMessage)
{
case TMSG_GUI_DIALOG_OPEN:
{
if (pMsg->lpVoid)
static_cast<CGUIDialog*>(pMsg->lpVoid)->Open(pMsg->strParam);
else
{
CGUIDialog* pDialog = static_cast<CGUIDialog*>(GetWindow(pMsg->param1));
if (pDialog)
pDialog->Open(pMsg->strParam);
}
}
break;
case TMSG_GUI_WINDOW_CLOSE:
{
CGUIWindow *window = static_cast<CGUIWindow *>(pMsg->lpVoid);
if (window)
window->Close((pMsg->param1 & 0x1) ? true : false, pMsg->param1, (pMsg->param1 & 0x2) ? true : false);
}
break;
case TMSG_GUI_ACTIVATE_WINDOW:
{
ActivateWindow(pMsg->param1, pMsg->params, pMsg->param2 > 0);
}
break;
case TMSG_GUI_ADDON_DIALOG:
{
if (pMsg->lpVoid)
{ // TODO: This is ugly - really these python dialogs should just be normal XBMC dialogs
static_cast<ADDON::CGUIAddonWindowDialog *>(pMsg->lpVoid)->Show_Internal(pMsg->param2 > 0);
}
}
break;
#ifdef HAS_PYTHON
case TMSG_GUI_PYTHON_DIALOG:
{
// This hack is not much better but at least I don't need to make ApplicationMessenger
// know about Addon (Python) specific classes.
CAction caction(pMsg->param1);
static_cast<CGUIWindow*>(pMsg->lpVoid)->OnAction(caction);
}
break;
#endif
case TMSG_GUI_ACTION:
{
if (pMsg->lpVoid)
{
CAction *action = static_cast<CAction *>(pMsg->lpVoid);
if (pMsg->param1 == WINDOW_INVALID)
g_application.OnAction(*action);
else
{
CGUIWindow *pWindow = GetWindow(pMsg->param1);
if (pWindow)
pWindow->OnAction(*action);
else
CLog::Log(LOGWARNING, "Failed to get window with ID %i to send an action to", pMsg->param1);
}
delete action;
}
}
break;
case TMSG_GUI_MESSAGE:
if (pMsg->lpVoid)
{
CGUIMessage *message = static_cast<CGUIMessage *>(pMsg->lpVoid);
SendMessage(*message, pMsg->param1);
delete message;
}
break;
case TMSG_GUI_DIALOG_YESNO:
if (!pMsg->lpVoid && pMsg->param1 < 0 && pMsg->param2 < 0)
return;
auto dialog = static_cast<CGUIDialogYesNo*>(GetWindow(WINDOW_DIALOG_YES_NO));
if (!dialog)
return;
if (pMsg->lpVoid)
pMsg->SetResult(dialog->ShowAndGetInput(*static_cast<HELPERS::DialogYesNoMessage*>(pMsg->lpVoid)));
else
{
HELPERS::DialogYesNoMessage options;
options.heading = pMsg->param1;
options.text = pMsg->param2;
pMsg->SetResult(dialog->ShowAndGetInput(options));
}
break;
}
//.........这里部分代码省略.........