ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Channel used by the default Mixer implementation. More...

Collaboration diagram for Audio::Channel:

List of all members.

Public Member Functions

 Channel (Mixer *mixer, Mixer::SoundType type, AudioStream *stream, DisposeAfterUse::Flag autofreeStream, bool reverseStereo, int id, bool permanent)
 ~Channel ()
int mix (int16 *data, uint len)
 Mixes the channel's samples into the given buffer.
bool isFinished () const
 Queries whether the channel is still playing or not.
bool isPermanent () const
 Queries whether the channel is a permanent channel.
int getId () const
 Returns the id of the channel.
void pause (bool paused)
 Pauses or unpaused the channel in a recursive fashion.
bool isPaused () const
 Queries whether the channel is currently paused.
void setVolume (const byte volume)
 Sets the channel's own volume.
byte getVolume ()
 Gets the channel's own volume.
void setBalance (const int8 balance)
 Sets the channel's balance setting.
int8 getBalance ()
 Gets the channel's balance setting.
void notifyGlobalVolChange ()
 Notifies the channel that the global sound type volume settings changed.
Timestamp getElapsedTime ()
 Queries how long the channel has been playing.
Mixer::SoundType getType () const
 Queries the channel's sound type.
void setHandle (const SoundHandle handle)
 Sets the channel's sound handle.
SoundHandle getHandle () const
 Queries the channel's sound handle.

Private Member Functions

void updateChannelVolumes ()

Private Attributes

const Mixer::SoundType _type
SoundHandle _handle
bool _permanent
int _pauseLevel
int _id
byte _volume
int8 _balance
st_volume_t _volL
st_volume_t _volR
Mixer_mixer
uint32 _samplesConsumed
uint32 _samplesDecoded
uint32 _mixerTimeStamp
uint32 _pauseStartTime
uint32 _pauseTime
RateConverter_converter
Common::DisposablePtr
< AudioStream
_stream

Detailed Description

Channel used by the default Mixer implementation.

Definition at line 45 of file mixer.cpp.


Constructor & Destructor Documentation

Audio::Channel::Channel ( Mixer mixer,
Mixer::SoundType  type,
AudioStream stream,
DisposeAfterUse::Flag  autofreeStream,
bool  reverseStereo,
int  id,
bool  permanent 
)

Definition at line 499 of file mixer.cpp.

Audio::Channel::~Channel (  ) 

Definition at line 512 of file mixer.cpp.


Member Function Documentation

int8 Audio::Channel::getBalance (  ) 

Gets the channel's balance setting.

Returns:
balance

Definition at line 530 of file mixer.cpp.

Timestamp Audio::Channel::getElapsedTime (  ) 

Queries how long the channel has been playing.

Definition at line 579 of file mixer.cpp.

SoundHandle Audio::Channel::getHandle (  )  const [inline]

Queries the channel's sound handle.

Definition at line 145 of file mixer.cpp.

int Audio::Channel::getId (  )  const [inline]

Returns the id of the channel.

Definition at line 76 of file mixer.cpp.

Mixer::SoundType Audio::Channel::getType (  )  const [inline]

Queries the channel's sound type.

Definition at line 133 of file mixer.cpp.

byte Audio::Channel::getVolume (  ) 

Gets the channel's own volume.

Returns:
volume

Definition at line 521 of file mixer.cpp.

bool Audio::Channel::isFinished (  )  const [inline]

Queries whether the channel is still playing or not.

Definition at line 64 of file mixer.cpp.

bool Audio::Channel::isPaused (  )  const [inline]

Queries whether the channel is currently paused.

Definition at line 89 of file mixer.cpp.

bool Audio::Channel::isPermanent (  )  const [inline]

Queries whether the channel is a permanent channel.

A permanent channel is not affected by a Mixer::stopAll call.

Definition at line 71 of file mixer.cpp.

int Audio::Channel::mix ( int16 data,
uint  len 
)

Mixes the channel's samples into the given buffer.

Parameters:
data buffer where to mix the data
len number of sample *pairs*. So a value of 10 means that the buffer contains twice 10 sample, each 16 bits, for a total of 40 bytes.
Returns:
number of sample pairs processed (which can still be silence!)

Definition at line 607 of file mixer.cpp.

void Audio::Channel::notifyGlobalVolChange (  )  [inline]

Notifies the channel that the global sound type volume settings changed.

Definition at line 123 of file mixer.cpp.

void Audio::Channel::pause ( bool  paused  ) 

Pauses or unpaused the channel in a recursive fashion.

Parameters:
paused true, when the channel should be paused. false when it should be unpaused.

Definition at line 561 of file mixer.cpp.

void Audio::Channel::setBalance ( const int8  balance  ) 

Sets the channel's balance setting.

Parameters:
balance new balance

Definition at line 525 of file mixer.cpp.

void Audio::Channel::setHandle ( const SoundHandle  handle  )  [inline]

Sets the channel's sound handle.

Parameters:
handle new handle

Definition at line 140 of file mixer.cpp.

void Audio::Channel::setVolume ( const byte  volume  ) 

Sets the channel's own volume.

Parameters:
volume new volume

Definition at line 516 of file mixer.cpp.

void Audio::Channel::updateChannelVolumes (  )  [private]

Definition at line 534 of file mixer.cpp.


Member Data Documentation

Definition at line 155 of file mixer.cpp.

Definition at line 168 of file mixer.cpp.

Definition at line 149 of file mixer.cpp.

int Audio::Channel::_id [private]

Definition at line 152 of file mixer.cpp.

Definition at line 160 of file mixer.cpp.

Definition at line 164 of file mixer.cpp.

Definition at line 151 of file mixer.cpp.

Definition at line 165 of file mixer.cpp.

Definition at line 166 of file mixer.cpp.

Definition at line 150 of file mixer.cpp.

Definition at line 162 of file mixer.cpp.

Definition at line 163 of file mixer.cpp.

Definition at line 169 of file mixer.cpp.

Definition at line 148 of file mixer.cpp.

Definition at line 158 of file mixer.cpp.

Definition at line 158 of file mixer.cpp.

Definition at line 154 of file mixer.cpp.


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


Generated on Sat Mar 23 2019 05:06:42 for ResidualVM by doxygen 1.7.1
curved edge   curved edge