本文整理汇总了C++中ISegment::Play方法的典型用法代码示例。如果您正苦于以下问题:C++ ISegment::Play方法的具体用法?C++ ISegment::Play怎么用?C++ ISegment::Play使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISegment
的用法示例。
在下文中一共展示了ISegment::Play方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnSegmentStart
//------------------------------------------------------------------------//
void MusicManager::OnSegmentStart()
{
FN("MusicManager::OnSegmentStart()");
ISegment* pCurrent;
ISegment* pNext;
AudioMgr()->GetCurrentSegment(pCurrent);
if(m_pPlayingInterlude)
{
if(!m_pPlayingInterlude->GetTransition(m_pPreviousTheme, pCurrent, pNext))
{
m_pPlayingInterlude = 0;
if(!m_pPlayingTheme)
return;
m_pPlayingTheme->StartTheme();
if(!m_pPlayingTheme->GetTransition(m_pPreviousTheme, pCurrent, pNext))
return;
}
}
else
{
if(!m_pPlayingTheme)
return;
if(!m_pPlayingTheme->GetTransition(m_pPreviousTheme, pCurrent, pNext))
return;
}
pNext->Play();
}
示例2: UpdateMusic
//------------------------------------------------------------------------//
void AudioManager::UpdateMusic()
{
FN("AudioManager::UpdateMusic()");
DMUS_NOTIFICATION_PMSG* pPmsg;
while(true)
{
WaitForSingleObject(m_hMusicNotify, INFINITE);
if(!m_bInitialized)
{
SetEvent(m_hTerm[MUSIC_EVENT]);
return;
}
while (S_OK == m_pMusicPerformance->GetNotificationPMsg(&pPmsg))
{
if(pPmsg->guidNotificationType == GUID_NOTIFICATION_MEASUREANDBEAT)
{
DebugOut(5, "Music notification: Beat = %d", pPmsg->dwField1);
}
else if(pPmsg->guidNotificationType == GUID_NOTIFICATION_PERFORMANCE)
{
if(pPmsg->dwNotificationOption == DMUS_NOTIFICATION_MUSICALMOSTEND)
{
DebugOut(5, "Music notification: Music almost at end");
if(!m_pCurrentSegment)
break;
if(m_pCurrentSegment->IsLooping() && !m_pNextSegment)
{
ISegment* pSeg = m_pCurrentSegment;
m_pCurrentSegment = 0;
m_pNextSegment = 0;
pSeg->Play();
}
else if(m_pNextSegment)
{
ISegment* pSeg = m_pNextSegment;
m_pCurrentSegment = 0;
m_pNextSegment = 0;
pSeg->Play();
}
}
else if(pPmsg->dwNotificationOption == DMUS_NOTIFICATION_MUSICSTARTED)
{
DebugOut(5, "Music notification: Music started");
}
else if(pPmsg->dwNotificationOption == DMUS_NOTIFICATION_MUSICSTOPPED)
{
DebugOut(5, "Music notification: Music stopped");
}
}
else if(pPmsg->guidNotificationType == GUID_NOTIFICATION_SEGMENT)
{
if(pPmsg->dwNotificationOption == DMUS_NOTIFICATION_SEGABORT)
{
DebugOut(5, "Music notification: Segment aborted");
}
else if(pPmsg->dwNotificationOption == DMUS_NOTIFICATION_SEGALMOSTEND)
{
DebugOut(5, "Music notification: Segment almost at end");
}
else if(pPmsg->dwNotificationOption == DMUS_NOTIFICATION_SEGEND)
{
DebugOut(5, "Music notification: Segment at end");
}
else if(pPmsg->dwNotificationOption == DMUS_NOTIFICATION_SEGLOOP)
{
DebugOut(5, "Music notification: Segment has looped");
}
else if(pPmsg->dwNotificationOption == DMUS_NOTIFICATION_SEGSTART)
{
DebugOut(5, "Music notification: Segment has started");
if(m_Init.m_pMusicCallback)
m_Init.m_pMusicCallback->OnSegmentStart();
}
}
m_pMusicPerformance->FreePMsg((DMUS_PMSG*)pPmsg);
}
}
}