当前位置: 首页>>代码示例>>C++>>正文


C++ ISegment::Play方法代码示例

本文整理汇总了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();

}
开发者ID:F5000,项目名称:spree,代码行数:30,代码来源:MusicMgr.cpp

示例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); 
		}
	}
}
开发者ID:F5000,项目名称:spree,代码行数:83,代码来源:AudioMgr.cpp


注:本文中的ISegment::Play方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。