Esempio n. 1
0
//-----------------------------------------------------------------------------
// Name: FrameMove()
// Desc: Called once per frame to update state
//-----------------------------------------------------------------------------
HRESULT CXBoxSample::FrameMove()
{

	// Create a WMA stream
	if(nosound==-1)
	{
		WRAP( m_Stream.Initialize( "d:\\media\\demo.wma" ) );
		nosound=0;
	}

	// Let the WMA decoder do some work
	if(nosound==0)
	{
		m_Stream.Process( &m_dwPercentCompleted );
		DirectSoundDoWork();
	}

	/*
	// Toggle help
	if( m_DefaultGamepad.wPressedButtons & XINPUT_GAMEPAD_BACK ) 
	{
	m_bDrawHelp = !m_bDrawHelp;
	}

	// Toggle pause
	if( m_DefaultGamepad.bPressedAnalogButtons[ XINPUT_GAMEPAD_A ] )
	{
	m_bPaused = !m_bPaused;
	m_Stream.Pause( m_bPaused ? DSSTREAMPAUSE_PAUSE : DSSTREAMPAUSE_RESUME );
	}
	*/

	return S_OK;
}
Esempio n. 2
0
ALvoid alUpdate( ALvoid )
{
	DirectSoundDoWork();

	// update sources
	for (QALState::source_t::iterator i = s_pState->m_Sources.begin();
	i != s_pState->m_Sources.end(); ++i)
	{
		QALState::SourceInfo* info = i->second;
		
		// 3d sounds and dirty sources must be updated
		if (info->m_Is3d || info->m_GainDirty)
		{
			// only playing sources should be updated
			DWORD status;
			info->m_Voices.begin()->second->GetStatus(&status);

			if (status & DSBSTATUS_PLAYING)
			{
				_updateSource(info);
			}
		}
	}

	// update stream
	_updateStream();

	s_pState->m_SoundObject->CommitDeferredSettings();
}