本文整理汇总了C++中CGUIWindowSlideShow::Shuffle方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIWindowSlideShow::Shuffle方法的具体用法?C++ CGUIWindowSlideShow::Shuffle怎么用?C++ CGUIWindowSlideShow::Shuffle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIWindowSlideShow
的用法示例。
在下文中一共展示了CGUIWindowSlideShow::Shuffle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetShuffle
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: Shuffle
JSON_STATUS CPlayerOperations::Shuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CGUIWindowSlideShow *slideshow = NULL;
switch (GetPlayer(parameterObject["playerid"]))
{
case Video:
case Audio:
g_application.getApplicationMessenger().PlayListPlayerShuffle(GetPlaylist(GetPlayer(parameterObject["playerid"])), true);
OnPlaylistChanged();
break;
case Picture:
slideshow = (CGUIWindowSlideShow*)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (slideshow && !slideshow->IsShuffled())
slideshow->Shuffle();
else if (!slideshow)
return FailedToExecute;
break;
default:
return FailedToExecute;
}
return ACK;
}
示例3: ProcessMessage
//.........这里部分代码省略.........
g_windowManager.PreviousWindow();
g_application.ResetScreenSaver();
g_application.WakeUpScreenSaverAndDPMS();
//g_application.StopPlaying();
// play file
if(pMsg->lpVoid)
{
CFileItemList *list = (CFileItemList *)pMsg->lpVoid;
if (list->Size() > 0)
{
int playlist = PLAYLIST_MUSIC;
for (int i = 0; i < list->Size(); i++)
{
if ((*list)[i]->IsVideo())
{
playlist = PLAYLIST_VIDEO;
break;
}
}
g_playlistPlayer.ClearPlaylist(playlist);
g_playlistPlayer.SetCurrentPlaylist(playlist);
//For single item lists try PlayMedia. This covers some more cases where a playlist is not appropriate
//It will fall through to PlayFile
if (list->Size() == 1 && !(*list)[0]->IsPlayList())
g_application.PlayMedia(*((*list)[0]), playlist);
else
{
// Handle "shuffled" option if present
if (list->HasProperty("shuffled") && list->GetProperty("shuffled").isBoolean())
g_playlistPlayer.SetShuffle(playlist, list->GetProperty("shuffled").asBoolean(), false);
// Handle "repeat" option if present
if (list->HasProperty("repeat") && list->GetProperty("repeat").isInteger())
g_playlistPlayer.SetRepeat(playlist, (PLAYLIST::REPEAT_STATE)list->GetProperty("repeat").asInteger(), false);
g_playlistPlayer.Add(playlist, (*list));
g_playlistPlayer.Play(pMsg->dwParam1);
}
}
delete list;
}
else if (pMsg->dwParam1 == PLAYLIST_MUSIC || pMsg->dwParam1 == PLAYLIST_VIDEO)
{
if (g_playlistPlayer.GetCurrentPlaylist() != (int)pMsg->dwParam1)
g_playlistPlayer.SetCurrentPlaylist(pMsg->dwParam1);
PlayListPlayerPlay(pMsg->dwParam2);
}
}
break;
case TMSG_MEDIA_RESTART:
g_application.Restart(true);
break;
case TMSG_PICTURE_SHOW:
{
CGUIWindowSlideShow *pSlideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (!pSlideShow) return ;
// stop playing file
if (g_application.IsPlayingVideo()) g_application.StopPlaying();
示例4: ProcessMessage
//.........这里部分代码省略.........
pSlideShow->Add(&item);
pSlideShow->Select(pMsg->strParam);
}
g_graphicsContext.Unlock();
}
break;
case TMSG_SLIDESHOW_SCREENSAVER:
case TMSG_PICTURE_SLIDESHOW:
{
CGUIWindowSlideShow *pSlideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (!pSlideShow) return ;
if (g_application.IsPlayingVideo())
g_application.StopPlaying();
g_graphicsContext.Lock();
pSlideShow->Reset();
CFileItemList items;
CStdString strPath = pMsg->strParam;
CStdString extensions = g_settings.m_pictureExtensions;
if (pMsg->dwParam1)
extensions += "|.tbn";
CUtil::GetRecursiveListing(strPath, items, extensions);
if (items.Size() > 0)
{
for (int i=0;i<items.Size();++i)
pSlideShow->Add(items[i].get());
pSlideShow->StartSlideShow(pMsg->dwMessage == TMSG_SLIDESHOW_SCREENSAVER); //Start the slideshow!
}
if (pMsg->dwMessage == TMSG_SLIDESHOW_SCREENSAVER)
pSlideShow->Shuffle();
if (g_windowManager.GetActiveWindow() != WINDOW_SLIDESHOW)
{
if(items.Size() == 0)
{
g_guiSettings.SetString("screensaver.mode", "screensaver.xbmc.builtin.dim");
g_application.ActivateScreenSaver();
}
else
g_windowManager.ActivateWindow(WINDOW_SLIDESHOW);
}
g_graphicsContext.Unlock();
}
break;
case TMSG_SETLANGUAGE:
g_guiSettings.SetLanguage(pMsg->strParam);
break;
case TMSG_MEDIA_STOP:
{
// restore to previous window if needed
if (g_windowManager.GetActiveWindow() == WINDOW_SLIDESHOW ||
g_windowManager.GetActiveWindow() == WINDOW_FULLSCREEN_VIDEO ||
g_windowManager.GetActiveWindow() == WINDOW_VISUALISATION)
g_windowManager.PreviousWindow();
g_application.ResetScreenSaver();
g_application.WakeUpScreenSaverAndDPMS();
// stop playing file
if (g_application.IsPlaying()) g_application.StopPlaying();
示例5: ProcessMessage
//.........这里部分代码省略.........
pSlideShow->Select(pMsg->strParam);
}
g_graphicsContext.Unlock();
}
break;
case TMSG_SLIDESHOW_SCREENSAVER:
case TMSG_PICTURE_SLIDESHOW:
{
CGUIWindowSlideShow *pSlideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (!pSlideShow) return ;
g_graphicsContext.Lock();
pSlideShow->Reset();
CFileItemList items;
CStdString strPath = pMsg->strParam;
if (pMsg->dwMessage == TMSG_SLIDESHOW_SCREENSAVER &&
g_guiSettings.GetString("screensaver.mode").Equals("Fanart Slideshow"))
{
CUtil::GetRecursiveListing(g_settings.GetVideoFanartFolder(), items, ".tbn");
CUtil::GetRecursiveListing(g_settings.GetMusicFanartFolder(), items, ".tbn");
}
else
CUtil::GetRecursiveListing(strPath, items, g_stSettings.m_pictureExtensions);
if (items.Size() > 0)
{
for (int i=0;i<items.Size();++i)
pSlideShow->Add(items[i].get());
pSlideShow->StartSlideShow(pMsg->dwMessage == TMSG_SLIDESHOW_SCREENSAVER); //Start the slideshow!
}
if (pMsg->dwMessage == TMSG_SLIDESHOW_SCREENSAVER)
pSlideShow->Shuffle();
if (g_windowManager.GetActiveWindow() != WINDOW_SLIDESHOW)
g_windowManager.ActivateWindow(WINDOW_SLIDESHOW);
g_graphicsContext.Unlock();
}
break;
case TMSG_MEDIA_STOP:
{
// This check ensures we actually need to switch to the previous window, set by FlashVideoPlayer
if (pMsg->dwParam1 != 1)
{
// restore to previous window if needed
if (g_windowManager.GetActiveWindow() == WINDOW_SLIDESHOW ||
g_windowManager.GetActiveWindow() == WINDOW_FULLSCREEN_VIDEO ||
g_windowManager.GetActiveWindow() == WINDOW_VISUALISATION)
g_windowManager.PreviousWindow();
}
g_application.ResetScreenSaver();
g_application.WakeUpScreenSaverAndDPMS();
// stop playing file
if (g_application.IsPlaying()) g_application.StopPlaying();
}
break;
case TMSG_MEDIA_PAUSE:
if (g_application.m_pPlayer)
{
g_application.ResetScreenSaver();
示例6: Open
JSONRPC_STATUS CPlayerOperations::Open(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result)
{
CVariant optionShuffled = parameterObject["options"]["shuffled"];
CVariant optionRepeat = parameterObject["options"]["repeat"];
CVariant optionResume = parameterObject["options"]["resume"];
if (parameterObject["item"].isObject() && parameterObject["item"].isMember("playlistid"))
{
int playlistid = (int)parameterObject["item"]["playlistid"].asInteger();
if (playlistid < PLAYLIST_PICTURE)
{
// Apply the "shuffled" option if available
if (optionShuffled.isBoolean())
g_playlistPlayer.SetShuffle(playlistid, optionShuffled.asBoolean(), false);
// Apply the "repeat" option if available
if (!optionRepeat.isNull())
g_playlistPlayer.SetRepeat(playlistid, (REPEAT_STATE)ParseRepeatState(optionRepeat), false);
}
switch (playlistid)
{
case PLAYLIST_MUSIC:
case PLAYLIST_VIDEO:
g_application.getApplicationMessenger().MediaPlay(playlistid, (int)parameterObject["item"]["position"].asInteger());
OnPlaylistChanged();
break;
case PLAYLIST_PICTURE:
return StartSlideshow();
break;
}
return ACK;
}
else if (parameterObject["item"].isObject() && parameterObject["item"].isMember("path"))
{
CStdString exec = "slideShow(";
exec += parameterObject["item"]["path"].asString();
if ((optionShuffled.isBoolean() && optionShuffled.asBoolean()) ||
(!optionShuffled.isBoolean() && parameterObject["item"]["random"].asBoolean()))
exec += ", random";
else
exec += ", notrandom";
if (parameterObject["item"]["recursive"].asBoolean())
exec += ", recursive";
exec += ")";
ThreadMessage msg = { TMSG_EXECUTE_BUILT_IN, (DWORD)0, (DWORD)0, exec };
g_application.getApplicationMessenger().SendMessage(msg);
return ACK;
}
else
{
CFileItemList list;
if (FillFileItemList(parameterObject["item"], list) && list.Size() > 0)
{
bool slideshow = true;
for (int index = 0; index < list.Size(); index++)
{
if (!list[index]->IsPicture())
{
slideshow = false;
break;
}
}
if (slideshow)
{
CGUIWindowSlideShow *slideshow = (CGUIWindowSlideShow*)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (!slideshow)
return FailedToExecute;
SendSlideshowAction(ACTION_STOP);
slideshow->Reset();
for (int index = 0; index < list.Size(); index++)
slideshow->Add(list[index].get());
if (optionShuffled.isBoolean() && optionShuffled.asBoolean())
slideshow->Shuffle();
return StartSlideshow();
}
else
{
// Handle "shuffled" option
if (optionShuffled.isBoolean())
list.SetProperty("shuffled", optionShuffled);
// Handle "repeat" option
if (!optionRepeat.isNull())
list.SetProperty("repeat", ParseRepeatState(optionRepeat));
// Handle "resume" option
if (list.Size() == 1)
{
if (optionResume.isBoolean() && optionResume.asBoolean())
list[0]->m_lStartOffset = STARTOFFSET_RESUME;
//.........这里部分代码省略.........