本文整理汇总了C++中CGUIWindowSlideShow类的典型用法代码示例。如果您正苦于以下问题:C++ CGUIWindowSlideShow类的具体用法?C++ CGUIWindowSlideShow怎么用?C++ CGUIWindowSlideShow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CGUIWindowSlideShow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
JSONRPC_STATUS CPlayerOperations::SetShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CGUIWindowSlideShow *slideshow = NULL;
CVariant shuffle = parameterObject["shuffle"];
switch (GetPlayer(parameterObject["playerid"]))
{
case Video:
case Audio:
{
if (IsPVRChannel())
return FailedToExecute;
int playlistid = GetPlaylist(GetPlayer(parameterObject["playerid"]));
if (g_playlistPlayer.IsShuffled(playlistid))
{
if ((shuffle.isBoolean() && !shuffle.asBoolean()) ||
(shuffle.isString() && shuffle.asString() == "toggle"))
{
CApplicationMessenger::Get().PlayListPlayerShuffle(playlistid, false);
OnPlaylistChanged();
}
}
else
{
if ((shuffle.isBoolean() && shuffle.asBoolean()) ||
(shuffle.isString() && shuffle.asString() == "toggle"))
{
CApplicationMessenger::Get().PlayListPlayerShuffle(playlistid, true);
OnPlaylistChanged();
}
}
break;
}
case Picture:
slideshow = (CGUIWindowSlideShow*)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (slideshow == NULL)
return FailedToExecute;
if (slideshow->IsShuffled())
{
if ((shuffle.isBoolean() && !shuffle.asBoolean()) ||
(shuffle.isString() && shuffle.asString() == "toggle"))
return FailedToExecute;
}
else
{
if ((shuffle.isBoolean() && shuffle.asBoolean()) ||
(shuffle.isString() && shuffle.asString() == "toggle"))
slideshow->Shuffle();
}
break;
default:
return FailedToExecute;
}
return ACK;
}
示例2: switch
bool CPicturesGUIInfo::GetBool(bool& value, const CGUIListItem *gitem, int contextWindow, const CGUIInfo &info) const
{
switch (info.m_info)
{
///////////////////////////////////////////////////////////////////////////////////////////////
// SLIDESHOW_*
///////////////////////////////////////////////////////////////////////////////////////////////
case SLIDESHOW_ISPAUSED:
{
CGUIWindowSlideShow *slideShow = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIWindowSlideShow>(WINDOW_SLIDESHOW);
value = (slideShow && slideShow->IsPaused());
return true;
}
case SLIDESHOW_ISRANDOM:
{
CGUIWindowSlideShow *slideShow = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIWindowSlideShow>(WINDOW_SLIDESHOW);
value = (slideShow && slideShow->IsShuffled());
return true;
}
case SLIDESHOW_ISACTIVE:
{
CGUIWindowSlideShow *slideShow = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIWindowSlideShow>(WINDOW_SLIDESHOW);
value = (slideShow && slideShow->InSlideShow());
return true;
}
case SLIDESHOW_ISVIDEO:
{
CGUIWindowSlideShow *slideShow = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIWindowSlideShow>(WINDOW_SLIDESHOW);
value = (slideShow && slideShow->GetCurrentSlide() && slideShow->GetCurrentSlide()->IsVideo());
return true;
}
}
return false;
}
示例3: pPlayList
//! @todo 2.0: Can this be removed, or should we run without the "special" file directories while
// in filemanager view.
void CGUIWindowFileManager::OnStart(CFileItem *pItem, const std::string &player)
{
// start playlists from file manager
if (pItem->IsPlayList())
{
std::string strPlayList = pItem->GetPath();
std::unique_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList));
if (NULL != pPlayList.get())
{
if (!pPlayList->Load(strPlayList))
{
HELPERS::ShowOKDialogText(CVariant{6}, CVariant{477});
return;
}
}
g_application.ProcessAndStartPlaylist(strPlayList, *pPlayList, PLAYLIST_MUSIC);
return;
}
if (pItem->IsAudio() || pItem->IsVideo())
{
CServiceBroker::GetPlaylistPlayer().Play(std::make_shared<CFileItem>(*pItem), player);
return;
}
if (pItem->IsGame())
{
g_application.PlayFile(*pItem, player);
return ;
}
#ifdef HAS_PYTHON
if (pItem->IsPythonScript())
{
CScriptInvocationManager::GetInstance().ExecuteAsync(pItem->GetPath());
return ;
}
#endif
if (pItem->IsPicture())
{
CGUIWindowSlideShow *pSlideShow = g_windowManager.GetWindow<CGUIWindowSlideShow>(WINDOW_SLIDESHOW);
if (!pSlideShow)
return ;
if (g_application.m_pPlayer->IsPlayingVideo())
g_application.StopPlaying();
pSlideShow->Reset();
pSlideShow->Add(pItem);
pSlideShow->Select(pItem->GetPath());
g_windowManager.ActivateWindow(WINDOW_SLIDESHOW);
return;
}
if (pItem->IsType(".txt") || pItem->IsType(".xml"))
CGUIDialogTextViewer::ShowForFile(pItem->GetPath(), true);
}
示例4: switch
JSONRPC_STATUS CPlaylistOperations::GetPropertyValue(int playlist, const CStdString &property, CVariant &result)
{
if (property.Equals("type"))
{
switch (playlist)
{
case PLAYLIST_MUSIC:
result = "audio";
break;
case PLAYLIST_VIDEO:
result = "video";
break;
case PLAYLIST_PICTURE:
result = "pictures";
break;
default:
result = "unknown";
break;
}
}
else if (property.Equals("size"))
{
CFileItemList list;
CGUIWindowSlideShow *slideshow = NULL;
switch (playlist)
{
case PLAYLIST_MUSIC:
case PLAYLIST_VIDEO:
CApplicationMessenger::Get().PlayListPlayerGetItems(playlist, list);
result = list.Size();
break;
case PLAYLIST_PICTURE:
slideshow = (CGUIWindowSlideShow*)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (slideshow)
result = slideshow->NumSlides();
else
result = 0;
break;
default:
result = 0;
break;
}
}
else
return InvalidParams;
return OK;
}
示例5: switch
JSONRPC_STATUS CPlaylistOperations::GetPropertyValue(int playlist, const std::string &property, CVariant &result)
{
if (property == "type")
{
switch (playlist)
{
case PLAYLIST_MUSIC:
result = "audio";
break;
case PLAYLIST_VIDEO:
result = "video";
break;
case PLAYLIST_PICTURE:
result = "pictures";
break;
default:
result = "unknown";
break;
}
}
else if (property == "size")
{
CFileItemList list;
CGUIWindowSlideShow *slideshow = NULL;
switch (playlist)
{
case PLAYLIST_MUSIC:
case PLAYLIST_VIDEO:
CApplicationMessenger::GetInstance().SendMsg(TMSG_PLAYLISTPLAYER_GET_ITEMS, playlist, -1, static_cast<void*>(&list));
result = list.Size();
break;
case PLAYLIST_PICTURE:
slideshow = (CGUIWindowSlideShow*)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (slideshow)
result = slideshow->NumSlides();
else
result = 0;
break;
default:
result = 0;
break;
}
}
else
return InvalidParams;
return OK;
}
示例6: GetPlaylist
JSONRPC_STATUS CPlaylistOperations::Add(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int playlist = GetPlaylist(parameterObject["playlistid"]);
CFileItemList list;
CVariant params = parameterObject;
if (!CheckMediaParameter(playlist, parameterObject))
return InvalidParams;
CGUIWindowSlideShow *slideshow = NULL;
switch (playlist)
{
case PLAYLIST_VIDEO:
case PLAYLIST_MUSIC:
if (playlist == PLAYLIST_VIDEO)
params["item"]["media"] = "video";
else if (playlist == PLAYLIST_MUSIC)
params["item"]["media"] = "music";
if (!FillFileItemList(params["item"], list))
return InvalidParams;
CApplicationMessenger::Get().PlayListPlayerAdd(playlist, list);
break;
case PLAYLIST_PICTURE:
slideshow = (CGUIWindowSlideShow*)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (!slideshow)
return FailedToExecute;
if (!parameterObject["item"].isMember("media"))
params["item"]["media"] = "pictures";
if (!FillFileItemList(params["item"], list))
return InvalidParams;
for (int index = 0; index < list.Size(); index++)
{
CPictureInfoTag picture = CPictureInfoTag();
if (!picture.Load(list[index]->GetPath()))
continue;
*list[index]->GetPictureInfoTag() = picture;
slideshow->Add(list[index].get());
}
break;
}
NotifyAll();
return ACK;
}
示例7: pPlayList
// TODO 2.0: Can this be removed, or should we run without the "special" file directories while
// in filemanager view.
void CGUIWindowFileManager::OnStart(CFileItem *pItem)
{
// start playlists from file manager
if (pItem->IsPlayList())
{
CStdString strPlayList = pItem->m_strPath;
auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList));
if (NULL != pPlayList.get())
{
if (!pPlayList->Load(strPlayList))
{
CGUIDialogOK::ShowAndGetInput(6, 0, 477, 0);
return;
}
}
g_application.ProcessAndStartPlaylist(strPlayList, *pPlayList, PLAYLIST_MUSIC);
return;
}
if (pItem->IsAudio() || pItem->IsVideo())
{
g_application.PlayFile(*pItem);
return ;
}
#ifdef HAS_PYTHON
if (pItem->IsPythonScript())
{
g_pythonParser.evalFile(pItem->m_strPath.c_str());
return ;
}
#endif
if (pItem->IsShortCut())
CUtil::RunShortcut(pItem->m_strPath);
if (pItem->IsPicture())
{
CGUIWindowSlideShow *pSlideShow = (CGUIWindowSlideShow *)m_gWindowManager.GetWindow(WINDOW_SLIDESHOW);
if (!pSlideShow)
return ;
if (g_application.IsPlayingVideo())
g_application.StopPlaying();
pSlideShow->Reset();
pSlideShow->Add(pItem);
pSlideShow->Select(pItem->m_strPath);
m_gWindowManager.ActivateWindow(WINDOW_SLIDESHOW);
}
}
示例8: GetPlaylist
JSONRPC_STATUS CPlaylistOperations::Add(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
int playlist = GetPlaylist(parameterObject["playlistid"]);
CGUIWindowSlideShow *slideshow = NULL;
if (playlist == PLAYLIST_PICTURE)
{
slideshow = (CGUIWindowSlideShow*)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (slideshow == NULL)
return FailedToExecute;
}
CFileItemList list;
if (!HandleItemsParameter(playlist, parameterObject["item"], list))
return InvalidParams;
switch (playlist)
{
case PLAYLIST_VIDEO:
case PLAYLIST_MUSIC:
{
auto tmpList = new CFileItemList();
tmpList->Copy(list);
CApplicationMessenger::GetInstance().SendMsg(TMSG_PLAYLISTPLAYER_ADD, playlist, -1, static_cast<void*>(tmpList));
break;
}
case PLAYLIST_PICTURE:
for (int index = 0; index < list.Size(); index++)
{
CPictureInfoTag picture = CPictureInfoTag();
if (!picture.Load(list[index]->GetPath()))
continue;
*list[index]->GetPictureInfoTag() = picture;
slideshow->Add(list[index].get());
}
break;
default:
return InvalidParams;
}
NotifyAll();
return ACK;
}
示例9: switch
JSONRPC_STATUS CPlayerOperations::PlayPause(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CGUIWindowSlideShow *slideshow = NULL;
switch (GetPlayer(parameterObject["playerid"]))
{
case Video:
case Audio:
if (!g_application.m_pPlayer->CanPause())
return FailedToExecute;
if (parameterObject["play"].isString())
CBuiltins::GetInstance().Execute("playercontrol(play)");
else
{
if (parameterObject["play"].asBoolean())
{
if (g_application.m_pPlayer->IsPausedPlayback())
CApplicationMessenger::GetInstance().SendMsg(TMSG_MEDIA_PAUSE);
else if (g_application.m_pPlayer->GetPlaySpeed() != 1)
g_application.m_pPlayer->SetPlaySpeed(1);
}
else if (!g_application.m_pPlayer->IsPausedPlayback())
CApplicationMessenger::GetInstance().SendMsg(TMSG_MEDIA_PAUSE);
}
result["speed"] = g_application.m_pPlayer->IsPausedPlayback() ? 0 : g_application.m_pPlayer->GetPlaySpeed();
return OK;
case Picture:
slideshow = (CGUIWindowSlideShow*)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (slideshow && slideshow->IsPlaying() &&
(parameterObject["play"].isString() ||
(parameterObject["play"].isBoolean() && parameterObject["play"].asBoolean() == slideshow->IsPaused())))
SendSlideshowAction(ACTION_PAUSE);
if (slideshow && slideshow->IsPlaying() && !slideshow->IsPaused())
result["speed"] = slideshow->GetDirection();
else
result["speed"] = 0;
return OK;
case None:
default:
return FailedToExecute;
}
}
示例10: pPlayList
// TODO 2.0: Can this be removed, or should we run without the "special" file directories while
// in filemanager view.
void CGUIWindowFileManager::OnStart(CFileItem *pItem)
{
// start playlists from file manager
if (pItem->IsPlayList())
{
std::string strPlayList = pItem->GetPath();
std::unique_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList));
if (NULL != pPlayList.get())
{
if (!pPlayList->Load(strPlayList))
{
CGUIDialogOK::ShowAndGetInput(CVariant{6}, CVariant{477});
return;
}
}
g_application.ProcessAndStartPlaylist(strPlayList, *pPlayList, PLAYLIST_MUSIC);
return;
}
if (pItem->IsAudio() || pItem->IsVideo())
{
g_application.PlayFile(*pItem);
return ;
}
#ifdef HAS_PYTHON
if (pItem->IsPythonScript())
{
CScriptInvocationManager::Get().ExecuteAsync(pItem->GetPath());
return ;
}
#endif
if (pItem->IsPicture())
{
CGUIWindowSlideShow *pSlideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (!pSlideShow)
return ;
if (g_application.m_pPlayer->IsPlayingVideo())
g_application.StopPlaying();
pSlideShow->Reset();
pSlideShow->Add(pItem);
pSlideShow->Select(pItem->GetPath());
g_windowManager.ActivateWindow(WINDOW_SLIDESHOW);
}
}
示例11: OnInitWindow
void CGUIWindowPictures::OnInitWindow()
{
CGUIMediaWindow::OnInitWindow();
if (m_slideShowStarted)
{
CGUIWindowSlideShow* wndw = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIWindowSlideShow>(WINDOW_SLIDESHOW);
std::string path;
if (wndw && wndw->GetCurrentSlide())
path = URIUtils::GetDirectory(wndw->GetCurrentSlide()->GetPath());
if (m_vecItems->IsPath(path))
{
if (wndw && wndw->GetCurrentSlide())
m_viewControl.SetSelectedItem(wndw->GetCurrentSlide()->GetPath());
SaveSelectedItemInHistory();
}
m_slideShowStarted = false;
}
}
示例12: OnInitWindow
void CGUIWindowPictures::OnInitWindow()
{
CGUIMediaWindow::OnInitWindow();
if (m_slideShowStarted)
{
CGUIWindowSlideShow* wndw = (CGUIWindowSlideShow*)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
CStdString path;
if (wndw && wndw->GetCurrentSlide())
path = URIUtils::GetDirectory(wndw->GetCurrentSlide()->GetPath());
if (path.Equals(m_vecItems->GetPath()))
{
if (wndw && wndw->GetCurrentSlide())
m_viewControl.SetSelectedItem(wndw->GetCurrentSlide()->GetPath());
m_iSelectedItem = m_viewControl.GetSelectedItem();
}
m_slideShowStarted = false;
}
}
示例13: OnShowPictureRecursive
void CGUIWindowPictures::OnShowPictureRecursive(const CStdString& strPath)
{
CGUIWindowSlideShow *pSlideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (pSlideShow)
{
// stop any video
if (g_application.m_pPlayer->IsPlayingVideo())
g_application.StopPlaying();
SortDescription sorting = m_guiState->GetSortMethod();
pSlideShow->AddFromPath(strPath, true,
sorting.sortBy, sorting.sortOrder, sorting.sortAttributes);
if (pSlideShow->NumSlides())
{
m_slideShowStarted = true;
g_windowManager.ActivateWindow(WINDOW_SLIDESHOW);
}
}
}
示例14: OnShowPictureRecursive
void CGUIWindowPictures::OnShowPictureRecursive(const std::string& strPath)
{
CGUIWindowSlideShow *pSlideShow = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIWindowSlideShow>(WINDOW_SLIDESHOW);
if (pSlideShow)
{
// stop any video
if (g_application.GetAppPlayer().IsPlayingVideo())
g_application.StopPlaying();
SortDescription sorting = m_guiState->GetSortMethod();
pSlideShow->AddFromPath(strPath, true,
sorting.sortBy, sorting.sortOrder, sorting.sortAttributes);
if (pSlideShow->NumSlides())
{
m_slideShowStarted = true;
CServiceBroker::GetGUI()->GetWindowManager().ActivateWindow(WINDOW_SLIDESHOW);
}
}
}
示例15: OnSlideShowRecursive
void CGUIWindowPictures::OnSlideShowRecursive(const CStdString &strPicture)
{
CGUIWindowSlideShow *pSlideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (pSlideShow)
{
CStdString strExtensions;
CFileItemList items;
CGUIViewState* viewState=CGUIViewState::GetViewState(GetID(), items);
if (viewState)
{
strExtensions = viewState->GetExtensions();
delete viewState;
}
m_slideShowStarted = true;
pSlideShow->RunSlideShow(strPicture, true,
g_guiSettings.GetBool("slideshow.shuffle"),false,
m_guiState->GetSortMethod(),
m_guiState->GetSortOrder(),
strExtensions);
}
}