ScummVM API documentation
Titanic::QSoundManager Class Reference

#include <sound_manager.h>

Inheritance diagram for Titanic::QSoundManager:
Titanic::CSoundManager Titanic::QMixer

Public Member Functions

 QSoundManager (Audio::Mixer *mixer)
 
CWaveFileloadSound (const CString &name) override
 
CWaveFileloadSpeech (CDialogueFile *dialogueFile, int speechId) override
 
CWaveFileloadMusic (const CString &name) override
 
CWaveFileloadMusic (CAudioBuffer *buffer, DisposeAfterUse::Flag disposeAfterUse) override
 
int playSound (CWaveFile &waveFile, CProximity &prox) override
 
void stopSound (int handle) override
 
void stopChannel (int channel) override
 
virtual void setCanFree (int handle)
 
void stopAllChannels () override
 
void setVolume (int handle, uint volume, uint seconds) override
 
void setVectorPosition (int handle, double x, double y, double z, uint panRate) override
 
void setPolarPosition (int handle, double range, double azimuth, double elevation, uint panRate) override
 
bool isActive (int handle) override
 
bool isActive (const CWaveFile *waveFile) override
 
void waveMixPump () override
 
uint getLatency () const override
 
void setMusicPercent (double percent) override
 
void setSpeechPercent (double percent) override
 
void setMasterPercent (double percent) override
 
void setParrotPercent (double percent) override
 
void setListenerPosition (double posX, double posY, double posZ, double directionX, double directionY, double directionZ, bool stopSounds) override
 
virtual int playWave (CWaveFile *waveFile, int iChannel, uint flags, CProximity &prox)
 
void soundFreed (Audio::SoundHandle &handle)
 
- Public Member Functions inherited from Titanic::CSoundManager
virtual void proc9 (int handle)
 
virtual void preLoad ()
 
void load (SimpleFile *file)
 
virtual void postLoad ()
 
virtual void preSave ()
 
void save (SimpleFile *file) const
 
virtual void postSave ()
 
double getMusicVolume () const
 
double getSpeechVolume () const
 
double getParrotVolume () const
 
uint getModeVolume (VolumeMode mode)
 
- Public Member Functions inherited from Titanic::QMixer
 QMixer (Audio::Mixer *mixer)
 
bool qsWaveMixInitEx (const QMIXCONFIG &config)
 
void qsWaveMixActivate (bool fActivate)
 
int qsWaveMixOpenChannel (int iChannel, QMixFlag mode)
 
int qsWaveMixEnableChannel (int iChannel, uint flags, bool enabled)
 
void qsWaveMixCloseSession ()
 
void qsWaveMixFreeWave (Audio::SoundHandle &handle)
 
void qsWaveMixFlushChannel (int iChannel, uint flags=0)
 
void qsWaveMixSetPanRate (int iChannel, uint flags, uint rate)
 
void qsWaveMixSetVolume (int iChannel, uint flags, uint volume)
 
void qsWaveMixSetSourcePosition (int iChannel, uint flags, const QSVECTOR &position)
 
void qsWaveMixSetPolarPosition (int iChannel, uint flags, const QSPOLAR &position)
 
void qsWaveMixSetListenerPosition (const QSVECTOR &position, uint flags=0)
 
void qsWaveMixSetListenerOrientation (const QSVECTOR &direction, const QSVECTOR &up, uint flags=0)
 
void qsWaveMixSetDistanceMapping (int iChannel, uint flags, const QMIX_DISTANCES &distances)
 
void qsWaveMixSetFrequency (int iChannel, uint flags, uint frequency)
 
void qsWaveMixSetSourceVelocity (int iChannel, uint flags, const QSVECTOR &velocity)
 
int qsWaveMixPlayEx (int iChannel, uint flags, CWaveFile *waveFile, int loops, const QMIXPLAYPARAMS &params)
 
bool qsWaveMixIsChannelDone (int iChannel) const
 
void qsWaveMixPump ()
 

Public Attributes

int _field18
 
int _field1C
 

Additional Inherited Members

- Protected Attributes inherited from Titanic::CSoundManager
uint _handleCtr
 
double _musicPercent
 
double _speechPercent
 
double _masterPercent
 
double _parrotPercent
 
- Protected Attributes inherited from Titanic::QMixer
Audio::Mixer_mixer
 

Detailed Description

Concrete sound manager class that handles interfacing with the QMixer sound mixer class

Member Function Documentation

◆ loadSound()

CWaveFile* Titanic::QSoundManager::loadSound ( const CString name)
overridevirtual

Loads a sound

Parameters
nameName of sound resource
Returns
Loaded wave file

Reimplemented from Titanic::CSoundManager.

◆ loadSpeech()

CWaveFile* Titanic::QSoundManager::loadSpeech ( CDialogueFile dialogueFile,
int  speechId 
)
overridevirtual

Loads a speech resource from a dialogue file

Parameters
nameName of sound resource
Returns
Loaded wave file

Reimplemented from Titanic::CSoundManager.

◆ loadMusic() [1/2]

CWaveFile* Titanic::QSoundManager::loadMusic ( const CString name)
overridevirtual

Loads a music file

Parameters
nameName of music resource
Returns
Loaded wave file
Remarks
The original only classified music as what's produced in the music room puzzle. For ScummVM, we've reclassified some wave files that contain background music as music as well.

Reimplemented from Titanic::CSoundManager.

◆ loadMusic() [2/2]

CWaveFile* Titanic::QSoundManager::loadMusic ( CAudioBuffer buffer,
DisposeAfterUse::Flag  disposeAfterUse 
)
overridevirtual

Loads a music file from a streaming audio buffer

Parameters
bufferAudio buffer
Returns
Loaded wave file

Reimplemented from Titanic::CSoundManager.

◆ playSound()

int Titanic::QSoundManager::playSound ( CWaveFile waveFile,
CProximity prox 
)
overridevirtual

Start playing a previously loaded sound resource

Implements Titanic::CSoundManager.

◆ stopSound()

void Titanic::QSoundManager::stopSound ( int  handle)
overridevirtual

Stop playing the specified sound

Implements Titanic::CSoundManager.

◆ stopChannel()

void Titanic::QSoundManager::stopChannel ( int  channel)
overridevirtual

Stops a designated range of channels

Implements Titanic::CSoundManager.

◆ setCanFree()

virtual void Titanic::QSoundManager::setCanFree ( int  handle)
virtual

Flags that a sound can be freed if a timeout is set

◆ stopAllChannels()

void Titanic::QSoundManager::stopAllChannels ( )
overridevirtual

Stops sounds on all playing channels

Implements Titanic::CSoundManager.

◆ setVolume()

void Titanic::QSoundManager::setVolume ( int  handle,
uint  volume,
uint  seconds 
)
overridevirtual

Sets the volume for a sound

Parameters
handleHandle for sound
volumeNew volume
secondsNumber of seconds to transition to the new volume

Implements Titanic::CSoundManager.

◆ setVectorPosition()

void Titanic::QSoundManager::setVectorPosition ( int  handle,
double  x,
double  y,
double  z,
uint  panRate 
)
overridevirtual

Set the position for a sound

Parameters
handleHandle for sound
xx position in metres
yy position in metres
zz position in metres
panRateRate in milliseconds to transition

Reimplemented from Titanic::CSoundManager.

◆ setPolarPosition()

void Titanic::QSoundManager::setPolarPosition ( int  handle,
double  range,
double  azimuth,
double  elevation,
uint  panRate 
)
overridevirtual

Set the position for a sound

Parameters
handleHandle for sound
rangeRange value in metres
azimuthAzimuth value in degrees
elevationElevation value in degrees
panRateRate in milliseconds to transition

Reimplemented from Titanic::CSoundManager.

◆ isActive() [1/2]

bool Titanic::QSoundManager::isActive ( int  handle)
overridevirtual

Returns true if the given sound is currently active

Implements Titanic::CSoundManager.

◆ isActive() [2/2]

bool Titanic::QSoundManager::isActive ( const CWaveFile waveFile)
overridevirtual

Returns true if the given sound is currently active

Reimplemented from Titanic::CSoundManager.

◆ waveMixPump()

void Titanic::QSoundManager::waveMixPump ( )
overridevirtual

Handles regularly updating the mixer

Implements Titanic::CSoundManager.

◆ getLatency()

uint Titanic::QSoundManager::getLatency ( ) const
overridevirtual

Returns the movie latency

Reimplemented from Titanic::CSoundManager.

◆ setMusicPercent()

void Titanic::QSoundManager::setMusicPercent ( double  percent)
overridevirtual

Sets the music volume percent

Implements Titanic::CSoundManager.

◆ setSpeechPercent()

void Titanic::QSoundManager::setSpeechPercent ( double  percent)
overridevirtual

Sets the speech volume percent

Implements Titanic::CSoundManager.

◆ setMasterPercent()

void Titanic::QSoundManager::setMasterPercent ( double  percent)
overridevirtual

Sets the master volume percent

Implements Titanic::CSoundManager.

◆ setParrotPercent()

void Titanic::QSoundManager::setParrotPercent ( double  percent)
overridevirtual

Sets the Parrot NPC volume percent

Implements Titanic::CSoundManager.

◆ setListenerPosition()

void Titanic::QSoundManager::setListenerPosition ( double  posX,
double  posY,
double  posZ,
double  directionX,
double  directionY,
double  directionZ,
bool  stopSounds 
)
overridevirtual

Sets the position and orientation for the listener (player)

Reimplemented from Titanic::CSoundManager.

◆ playWave()

virtual int Titanic::QSoundManager::playWave ( CWaveFile waveFile,
int  iChannel,
uint  flags,
CProximity prox 
)
virtual

Starts a wave file playing

◆ soundFreed()

void Titanic::QSoundManager::soundFreed ( Audio::SoundHandle handle)

Called when a wave file is freed


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