Game Development Reference
In-Depth Information
m_isLooping = false;
m_Volume = 0;
} // disable public construction
shared_ptr<ResHandle> m_Resource;
// Is the sound paused
bool m_isPaused;
// Is the sound looping
bool m_isLooping;
//the volume
int m_Volume;
};
This class holds the precious smart pointer to your sound data managed by the
resource cache and implements the IAudioBuffer interface. VIsLooping() and
VGetVolume() tell you if your sound is a looping sound and the current volume
setting. VGetResource() returns a smart pointer to the sound resource, which
manages the sound data.
We
re nearly to the point where you have to dig into DirectSound. Before that hap-
pens, take a look at the classes that encapsulate the system that manages the list of
active sounds: IAudio and Audio .
'
IAudio Interface and Audio Class
IAudio has three main purposes: create, manage, and release audio buffers.
class IAudio
{
public:
virtual bool VActive()=0;
virtual IAudioBuffer *VInitAudioBuffer(shared_ptr<ResHandle> soundResource)=0;
virtual void VReleaseAudioBuffer(IAudioBuffer* audioBuffer)=0;
virtual void VStopAllSounds()=0;
virtual void VPauseAllSounds()=0;
virtual void VResumeAllSounds()=0;
virtual bool VInitialize()=0;
virtual void VShutdown()=0;
};
 
Search WWH ::




Custom Search