Logo Search packages:      
Sourcecode: scummvm version File versions  Download package

Audio::MixerImpl Class Reference

#include <mixer_intern.h>

Inheritance diagram for Audio::MixerImpl:

Audio::Mixer

List of all members.


Detailed Description

The (default) implementation of the ScummVM audio mixing subsystem.

Backends are responsible for allocating (and later releasing) an instance of this class, which engines can access via OSystem::getMixer().

Initialisation of instances of this class usually happens as follows: 1) Creat a new Audio::MixerImpl instance. 2) Set the hardware output sample rate via the setSampleRate() method. 3) Hook up the mixCallback() in a suitable audio processing thread/callback. 4) Change the mixer into ready mode via setReady(true). 5) Start audio processing (e.g. by resuming the audio thread, if applicable).

In the future, we might make it possible for backends to provide (partial) alternative implementations of the mixer, e.g. to make better use of native sound mixing support on low-end devices.

See also:
OSystem::getMixer()

Definition at line 54 of file mixer_intern.h.


Public Types

enum  { kMaxChannelVolume = 255, kMaxMixerVolume = 256 }
enum  SoundType { kPlainSoundType = 0, kMusicSoundType = 1, kSFXSoundType = 2, kSpeechSoundType = 3 }

Public Member Functions

virtual Timestamp getElapsedTime (SoundHandle handle)
virtual uint getOutputRate () const
virtual uint32 getSoundElapsedTime (SoundHandle handle)
virtual int getSoundID (SoundHandle handle)
virtual int getVolumeForSoundType (SoundType type) const
virtual bool hasActiveChannelOfType (SoundType type)
virtual bool isReady () const
virtual bool isSoundHandleActive (SoundHandle handle)
virtual bool isSoundIDActive (int id)
void mixCallback (byte *samples, uint len)
 MixerImpl (OSystem *system, uint sampleRate)
virtual void pauseAll (bool paused)
virtual void pauseHandle (SoundHandle handle, bool paused)
virtual void pauseID (int id, bool paused)
virtual void playStream (SoundType type, SoundHandle *handle, AudioStream *input, int id, byte volume, int8 balance, DisposeAfterUse::Flag autofreeStream, bool permanent, bool reverseStereo)
virtual void setChannelBalance (SoundHandle handle, int8 balance)
virtual void setChannelVolume (SoundHandle handle, byte volume)
void setReady (bool ready)
virtual void setVolumeForSoundType (SoundType type, int volume)
virtual void stopAll ()
virtual void stopHandle (SoundHandle handle)
virtual void stopID (int id)

Protected Member Functions

void insertChannel (SoundHandle *handle, Channel *chan)

Private Types

enum  { NUM_CHANNELS = 16 }

Private Attributes

Channel_channels [NUM_CHANNELS]
uint32 _handleSeed
bool _mixerReady
Common::Mutex _mutex
const uint _sampleRate
OSystem_syst
int _volumeForSoundType [4]

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index