1 // SoundTask.cpp: implementation of the CSoundTask class.
\r
3 //////////////////////////////////////////////////////////////////////
\r
7 //////////////////////////////////////////////////////////////////////
\r
8 // Construction/Destruction
\r
9 //////////////////////////////////////////////////////////////////////
\r
11 CSoundTask::CSoundTask(CKernel* kernel) : ITask(kernel)
\r
16 CSoundTask::~CSoundTask()
\r
21 bool CSoundTask::Start()
\r
23 // if(FALSE==FSOUND_Init(44100, 32, 0))return false;
\r
27 void CSoundTask::OnSuspend()
\r
29 /* //pause all channels, storing the pause state in the isPaused array
\r
30 //once the states are stored we can use FSOUND_ALL to pause all channels the easy way
\r
31 int chCount=FSOUND_GetMaxChannels();
\r
32 isPaused=new CMMDynamicBlob<bool>(chCount);
\r
33 for(int i=0;i<chCount;i++)
\r
35 if(FSOUND_IsPlaying(i))
\r
42 FSOUND_SetPaused(FSOUND_ALL,TRUE);
\r
45 void CSoundTask::Update()
\r
47 //we don't need to do anything, FMOD does it all for us :)
\r
50 void CSoundTask::OnResume()
\r
52 /* //unpause all the flagged channels
\r
55 int chCount=FSOUND_GetMaxChannels();
\r
56 for(int i=0;i<chCount;i++)
\r
58 if(isPaused[i])FSOUND_SetPaused(i,FALSE);
\r
64 void CSoundTask::Stop()
\r