Class Hierarchy   Compound List   Compound Members   Related Pages  

CSoundMix Class Reference

#include <sndmix.h>

Class diagram for CSoundMix:

NativeSoundMix

List of all members.

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)

Detailed Description

Class CSoundMix continually mixes the sound output stream. It is the parent class of NativeSoundMix which actually talks to the hardware device.

Member Function Documentation

void CSoundMix::FreeBuffers ()

Deletes all the sound buffers.

void CSoundMix::AllocBuffers ()

Allocates 'nBuffers' buffers, each of size bufferBytes. Sets up the waveHdr structure associated with the buffers.

void CSoundMix::EnlargeBuffers ()

Increases the buffer count by one, allocates the memory for that buffer, and sets up the waveHdr structure.

void * CSoundMix::GetScratch ()

The scratch is a block of memory used for mixing sound channels.

void CSoundMix::BuildBuffer (int bufferId)

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.

void CSoundMix::OpenDevice ()

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()

void CSoundMix::CloseDevice ()

Calls through to NativeSoundMix::CloseNativeDevice().

void CSoundMix::Construct ()

Has the same functionality as a constructor - done so global does not need _atexit.

void CSoundMix::Destruct ()

Same functionality as a destructor.

void CSoundMix::AddSound (CSoundChannel *)

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.

void CSoundMix::MarkBufferComplete (int i)

Given a buffer index, marks that buffer as completed playing.


The documentation for this classwas generated from the following file:

Version 1.0 of the Flash 4 Porting SDK                        Middlesoft, Inc.