Exemple #1
0
void CSoundCDTimeMgr::PlaySound(const char* soundName, uint32 uCDTime)
{
	MapSoundWithCD::iterator it = ms_mapSoundWithCD.find(soundName);
	if (it == ms_mapSoundWithCD.end())
	{
		PlayCue(soundName);
		CSoundCDTick* pCSoundCDTick = new CSoundCDTick(uCDTime);
		ms_mapSoundWithCD.insert(make_pair(soundName, pCSoundCDTick));
	}
	else
	{
		if (!it->second->IsCoolDwon())
		{
			PlayCue(soundName);
			it->second->EnterCoolDown(uCDTime);
		}
	}
}
void CCueListCtrlImp::PlayCurSelectCue( const bool bPlay )
{
	if( m_strCurCueName.empty() )
		return;

	if( bPlay )
		PlayCue(m_strCurCueName.c_str());
	else
		StopCue(m_strCurCueName.c_str());
}
void FSoundCueEditor::TogglePlayback()
{
	UAudioComponent* PreviewComp = GEditor->GetPreviewAudioComponent();
	if ( PreviewComp && PreviewComp->IsPlaying() )
	{
		Stop();
	}
	else
	{
		PlayCue();
	}
}
void FSoundCueEditor::PlaySingleNode(UEdGraphNode* Node)
{
	USoundCueGraphNode* SoundGraphNode = Cast<USoundCueGraphNode>(Node);

	if (SoundGraphNode)
	{
		GEditor->PlayPreviewSound(NULL, SoundGraphNode->SoundNode);
	}
	else
	{
		// must be root node, play the whole cue
		PlayCue();
	}
}
	//------------------------------------------------------------------------------
	void
	CToolMainPlayer::OnKeyFrame( const IDNAME* name )
	{
		if( m_strCurMatCueName.empty() )
			return;

		if (NULL == name)
			return;

		const TCHAR* strName = *name;
		static const IDNAME FootStep("f");///f == footstep
		if (FootStep == *name)
		{
			PlayCue(m_strCurMatCueName.c_str());
		}
	}