Class Hierarchy   Compound List   Compound Members   Related Pages  

NativeSoundMix Class Reference

#include <Sound.h>

Class diagram for NativeSoundMix:

CSoundMix

List of all members.

Public Members

virtual void NativeConstruct ()
virtual void NativeDestruct ()
virtual void EnterCritical ()
virtual void LeaveCritical ()
virtual void BuildAndWrite ( WaveHeader* hdr, BOOL silence )
virtual void GetNativeSoundCap ( S32* format )
virtual BOOL OpenNativeDevice ( CSound* format )
virtual void BuffersReady ()
virtual void BuffersUpdated ()
virtual void CloseNativeDevice ()
virtual BOOL IsDeviceOpen ()

Detailed Description

NativeSoundMix encapselates a hardware device. It has methods for opening and closing the device, managing data shared my multiple threads, and some buffer management. Sound is not completely portable. This interface may need to be modified for a particular OS. Please refer to the Design document.

Member Function Documentation

virtual void NativeSoundMix::NativeConstruct () [virtual]

CSoundMix does not use a contructor. For compatibility with CSoundMix, NativeConstruct is called for object "construction."

Reimplemented from CSoundMix.

virtual void NativeSoundMix::NativeDestruct () [virtual]

CSoundMix does not use a destructor. For compatibility with CSoundMix, NativeDestruct is called for object "destruction."

Reimplemented from CSoundMix.

virtual void NativeSoundMix::EnterCritical () [virtual]

The sound data needs to be protected is multi-threaded systems. Only one thread can have the critical semaphor. This call requests, and blocks, access to the critical sound semaphor.

Reimplemented from CSoundMix.

virtual void NativeSoundMix::BuildAndWrite (WaveHeader * hdr, BOOL silence) [virtual]

BuildAndWrite is passed the WaveHeader to an available buffer. It should call BuildBuffer to repack the buffer and then send the buffer to the hardware device. If silence is true, BuildBuffer should not be called, and BuildAndWrite should write silence to the buffer and send it to the hardware.
BuildAndWrite is called from core code when the device is opened, and called by the Native code when a buffer completes playing.

Reimplemented from CSoundMix.

virtual void NativeSoundMix::GetNativeSoundCap (S32 * format) [virtual]

GetNativeSoundCap gets the best native sound format. Called inside a critical section, when the hardware device is closed. This format is OR'd from the following variables:
sndMono, sndStereo
snd8Bit, snd16Bit
snd5K, snd11K, snd22K, snd44K

Reimplemented from CSoundMix.

virtual BOOL NativeSoundMix::OpenNativeDevice (CSound * format) [virtual]

Opens the hardware device in the given format. This call should not change CSound* format.

Reimplemented from CSoundMix.

virtual void NativeSoundMix::BuffersReady () [virtual]

BuffersReady is called when the device is open, the buffers are allocated, and the buffers are filled with data. A signal to start playing sound.

Reimplemented from CSoundMix.

virtual void NativeSoundMix::BuffersUpdated () [virtual]

When the buffers are allocated or enlarged, BuffersUpdated is called to inform the native code.

Reimplemented from CSoundMix.

virtual void NativeSoundMix::CloseNativeDevice () [virtual]

Closes the hardware device.

Reimplemented from CSoundMix.

virtual BOOL NativeSoundMix::IsDeviceOpen () [virtual]

Queries the state of the hardware device. Should be a fast call - it may be prudent to buffer the device state rather than actually asking the device.

Reimplemented from CSoundMix.


The documentation for this classwas generated from the following file:

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