本文整理汇总了C++中MediaPlayer::Play方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaPlayer::Play方法的具体用法?C++ MediaPlayer::Play怎么用?C++ MediaPlayer::Play使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaPlayer
的用法示例。
在下文中一共展示了MediaPlayer::Play方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnCopyData
BOOL CTeenSpiritDlg::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct)
{
if (pCopyDataStruct->dwData == COMMANDLINE_ARG)
{
static BOOL bEnqueue;
if (pCopyDataStruct->cbData != 0)
{
LPCTSTR path = (LPCTSTR)pCopyDataStruct->lpData;
if (_tcsicmp(path, _T("-q")) == 0)
bEnqueue = TRUE;
if (path[0] != '-' && path[0] !='\\')
{
PrgAPI* pAPI = PRGAPI();
MediaPlayer* pPlayer = pAPI->GetMediaPlayer();
MediaPlayListItem mpli;
if (bEnqueue)
pPlayer->Enqueue(path);
else
pPlayer->Play(path);
bEnqueue = TRUE;
}
}
else
bEnqueue = FALSE;
}
return __super::OnCopyData(pWnd, pCopyDataStruct);
}
示例2: main
int main ()
{
printf ("Results of media_player_mt test:\n");
try
{
common::LogFilter log_filter ("*", &log_print);
MediaPlayer player;
MediaPlayer::EventHandler handler = &media_player_event_handler;
for (int i=0; i<MediaPlayerEvent_Num; i++)
player.RegisterEventHandler ((MediaPlayerEvent)i, handler);
player.SetName ("player");
player.SetTarget ("low_level_openal");
Playlist playlist;
playlist.AddSource ("data/track_1.ogg");
playlist.AddSource ("data/track_2.ogg");
player.Open (playlist);
player.SetRepeatMode (MediaPlayerRepeatMode_Last);
player.Play ();
syslib::Application::Run ();
}
catch (std::exception& e)
{
printf ("exception: %s\n", e.what ());
}
return 0;
}