#include <sndmix.h>
Class diagram for CSoundMix:

Public Members | |||
![]() | ![]() | void | FreeBuffers () |
![]() | ![]() | void | AllocBuffers () |
![]() | ![]() | void | EnlargeBuffers () |
![]() | ![]() | void* | GetScratch () |
![]() | ![]() | void | ReleaseScratch () |
![]() | ![]() | void | BuildBuffer ( int bufferId ) |
![]() | ![]() | void | OpenDevice () |
![]() | ![]() | void | CloseDevice () |
![]() | ![]() | void | Construct () |
![]() | ![]() | void | Destruct () |
![]() | ![]() | void | AddSound (CSoundChannel*) |
![]() | ![]() | void | MarkBufferComplete (int i) |
Deletes all the sound buffers.
Allocates 'nBuffers' buffers, each of size bufferBytes. Sets up the waveHdr structure associated with the buffers.
Increases the buffer count by one, allocates the memory for that buffer, and sets up the waveHdr structure.
The scratch is a block of memory used for mixing sound channels.
BuildBuffer mixes and prepares the specified buffer. The next chunk of sound that is waiting to be played is mixed to the buffer specified by bufferId. After this call, the buffer should be sent to be sent to the sound card.
Open device goes through the following sequence of events:
1) Enters a critical section
2) Gets the device capabilities
3) Calls NativeSoundMix::OpenNativeDevice()
4) Allocates and buffers calls BuildAndWrite
5) Calls NativeSoundMix::BuffersReady()
Calls through to NativeSoundMix::CloseNativeDevice().
Has the same functionality as a constructor - done so global does not need _atexit.
Same functionality as a destructor.
AddSound takes a pointer to a CSoundChannel and prepares the CSoundChannel for playing. It then enters a critical section, and adds the sound to the list of sounds being played. If the sound device is not open, AddSound will open it.
Given a buffer index, marks that buffer as completed playing.