本文整理汇总了C++中playlist::CPlayList类的典型用法代码示例。如果您正苦于以下问题:C++ CPlayList类的具体用法?C++ CPlayList怎么用?C++ CPlayList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CPlayList类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessMessage
//.........这里部分代码省略.........
delete list;
}
break;
case TMSG_PLAYLISTPLAYER_INSERT:
if (pMsg->lpVoid)
{
CFileItemList *list = (CFileItemList *)pMsg->lpVoid;
g_playlistPlayer.Insert(pMsg->dwParam1, (*list), pMsg->dwParam2);
delete list;
}
break;
case TMSG_PLAYLISTPLAYER_REMOVE:
if (pMsg->dwParam1 != (DWORD) -1)
g_playlistPlayer.Remove(pMsg->dwParam1,pMsg->dwParam2);
break;
case TMSG_PLAYLISTPLAYER_CLEAR:
g_playlistPlayer.ClearPlaylist(pMsg->dwParam1);
break;
case TMSG_PLAYLISTPLAYER_SHUFFLE:
g_playlistPlayer.SetShuffle(pMsg->dwParam1, pMsg->dwParam2 > 0);
break;
case TMSG_PLAYLISTPLAYER_REPEAT:
g_playlistPlayer.SetRepeat(pMsg->dwParam1, (PLAYLIST::REPEAT_STATE)pMsg->dwParam2);
break;
case TMSG_PLAYLISTPLAYER_GET_ITEMS:
if (pMsg->lpVoid)
{
PLAYLIST::CPlayList playlist = g_playlistPlayer.GetPlaylist(pMsg->dwParam1);
CFileItemList *list = (CFileItemList *)pMsg->lpVoid;
for (int i = 0; i < playlist.size(); i++)
list->Add(CFileItemPtr(new CFileItem(*playlist[i])));
}
break;
case TMSG_PLAYLISTPLAYER_SWAP:
if (pMsg->lpVoid)
{
vector<int> *indexes = (vector<int> *)pMsg->lpVoid;
if (indexes->size() == 2)
g_playlistPlayer.Swap(pMsg->dwParam1, indexes->at(0), indexes->at(1));
delete indexes;
}
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_NETWORKMESSAGE:
{
g_application.getNetwork().NetworkMessage((CNetwork::EMESSAGE)pMsg->dwParam1, (int)pMsg->dwParam2);
}
break;
示例2: ProcessMessage
//.........这里部分代码省略.........
delete list;
}
break;
case TMSG_PLAYLISTPLAYER_INSERT:
if (pMsg->lpVoid)
{
CFileItemList *list = (CFileItemList *)pMsg->lpVoid;
g_playlistPlayer.Insert(pMsg->param1, (*list), pMsg->param2);
delete list;
}
break;
case TMSG_PLAYLISTPLAYER_REMOVE:
if (pMsg->param1 != -1)
g_playlistPlayer.Remove(pMsg->param1,pMsg->param2);
break;
case TMSG_PLAYLISTPLAYER_CLEAR:
g_playlistPlayer.ClearPlaylist(pMsg->param1);
break;
case TMSG_PLAYLISTPLAYER_SHUFFLE:
g_playlistPlayer.SetShuffle(pMsg->param1, pMsg->param2 > 0);
break;
case TMSG_PLAYLISTPLAYER_REPEAT:
g_playlistPlayer.SetRepeat(pMsg->param1, (PLAYLIST::REPEAT_STATE)pMsg->param2);
break;
case TMSG_PLAYLISTPLAYER_GET_ITEMS:
if (pMsg->lpVoid)
{
PLAYLIST::CPlayList playlist = g_playlistPlayer.GetPlaylist(pMsg->param1);
CFileItemList *list = (CFileItemList *)pMsg->lpVoid;
for (int i = 0; i < playlist.size(); i++)
list->Add(CFileItemPtr(new CFileItem(*playlist[i])));
}
break;
case TMSG_PLAYLISTPLAYER_SWAP:
if (pMsg->lpVoid)
{
vector<int> *indexes = (vector<int> *)pMsg->lpVoid;
if (indexes->size() == 2)
g_playlistPlayer.Swap(pMsg->param1, indexes->at(0), indexes->at(1));
delete indexes;
}
break;
// Window messages below here...
case TMSG_DIALOG_DOMODAL: //doModel of window
{
CGUIDialog* pDialog = (CGUIDialog*)g_windowManager.GetWindow(pMsg->param1);
if (!pDialog) return ;
pDialog->DoModal();
}
break;
case TMSG_NETWORKMESSAGE:
{
g_application.getNetwork().NetworkMessage((CNetwork::EMESSAGE)pMsg->param1, pMsg->param2);
}
break;
示例3: if
void PLAYLIST::CPlayListPlayer::OnApplicationMessage(KODI::MESSAGING::ThreadMessage* pMsg)
{
switch (pMsg->dwMessage)
{
case TMSG_PLAYLISTPLAYER_PLAY:
if (pMsg->param1 != -1)
Play(pMsg->param1, "");
else
Play();
break;
case TMSG_PLAYLISTPLAYER_PLAY_SONG_ID:
if (pMsg->param1 != -1)
{
bool *result = (bool*)pMsg->lpVoid;
*result = PlaySongId(pMsg->param1);
}
else
Play();
break;
case TMSG_PLAYLISTPLAYER_NEXT:
PlayNext();
break;
case TMSG_PLAYLISTPLAYER_PREV:
PlayPrevious();
break;
case TMSG_PLAYLISTPLAYER_ADD:
if (pMsg->lpVoid)
{
CFileItemList *list = (CFileItemList *)pMsg->lpVoid;
Add(pMsg->param1, (*list));
delete list;
}
break;
case TMSG_PLAYLISTPLAYER_INSERT:
if (pMsg->lpVoid)
{
CFileItemList *list = (CFileItemList *)pMsg->lpVoid;
Insert(pMsg->param1, (*list), pMsg->param2);
delete list;
}
break;
case TMSG_PLAYLISTPLAYER_REMOVE:
if (pMsg->param1 != -1)
Remove(pMsg->param1, pMsg->param2);
break;
case TMSG_PLAYLISTPLAYER_CLEAR:
ClearPlaylist(pMsg->param1);
break;
case TMSG_PLAYLISTPLAYER_SHUFFLE:
SetShuffle(pMsg->param1, pMsg->param2 > 0);
break;
case TMSG_PLAYLISTPLAYER_REPEAT:
SetRepeat(pMsg->param1, (PLAYLIST::REPEAT_STATE)pMsg->param2);
break;
case TMSG_PLAYLISTPLAYER_GET_ITEMS:
if (pMsg->lpVoid)
{
PLAYLIST::CPlayList playlist = GetPlaylist(pMsg->param1);
CFileItemList *list = static_cast<CFileItemList*>(pMsg->lpVoid);
for (int i = 0; i < playlist.size(); i++)
list->Add(std::make_shared<CFileItem>(*playlist[i]));
}
break;
case TMSG_PLAYLISTPLAYER_SWAP:
if (pMsg->lpVoid)
{
auto indexes = static_cast<std::vector<int>*>(pMsg->lpVoid);
if (indexes->size() == 2)
Swap(pMsg->param1, indexes->at(0), indexes->at(1));
delete indexes;
}
break;
case TMSG_MEDIA_PLAY:
{
// first check if we were called from the PlayFile() function
if (pMsg->lpVoid && pMsg->param2 == 0)
{
CFileItem *item = (CFileItem *)pMsg->lpVoid;
g_application.PlayFile(*item, "", pMsg->param1 != 0);
delete item;
return;
}
// restore to previous window if needed
if (g_windowManager.GetActiveWindow() == WINDOW_SLIDESHOW ||
g_windowManager.GetActiveWindow() == WINDOW_FULLSCREEN_VIDEO ||
g_windowManager.GetActiveWindow() == WINDOW_VISUALISATION)
//.........这里部分代码省略.........