#include <channel.h>
Inheritance diagram for saud_channel:
Public Methods | |
saud_channel (int track, int freq) throw () | |
virtual | ~saud_channel () throw () |
bool | is_terminated () const throw () |
is the track terminated ? | |
bool | set_parameters (int duration, int flags, int vol1, int vol2) throw (std::exception) |
debugging do not use. | |
bool | check_parameters (int index, int duration, int flags, int vol1, int vol2) throw (std::exception) |
debugging do not use. | |
bool | append_data (chunck &b, int size) throw (std::exception) |
appends coded sound data to the track. | |
int | available_sound_data () const throw () |
get the number of samples currently available in the channel. | |
void | read_sound_data (short *sound_buffer, int size) throw (std::exception) |
read some sound data from the channel. | |
Protected Methods | |
void | handleStrk (chunck &c) throw (std::exception) |
STRK chunck handling. | |
void | handleSmrk (chunck &c) throw (std::exception) |
SMRK chunck handling. | |
void | handleShdr (chunck &c) throw (std::exception) |
SHDR chunck handling. | |
bool | processBuffer () throw (std::exception) |
SAUD buffer processing. | |
void | recalcVolumeTable () throw (std::exception) |
volume table calculation. | |
Private Attributes | |
int | _track |
The track identifier. | |
int | _nbframes |
number of frames of the track (unused) | |
unsigned char * | _buffer |
SAUD buffer. | |
int | _buffer_size |
the size of the sound buffer | |
int | _frequency |
the frequency target of the track (always 22050) | |
int | _cur_buffer_write_pos |
the current write position in the SAUD buffer | |
int | _cur_buffer_read_pos |
the current read position in the SAUD buffer | |
int | _data_start |
the start of the sound data in the SAUD buffer | |
int | _data_size |
remaining size of sound data in the SAUD buffer | |
bool | _mark_reached |
set to true when the SMRK tag is reached | |
int | _flags |
current flags of the track (unused) | |
int | _volume |
the current track volume | |
int | _balance |
the current track balance | |
int | _index |
the current PSAD index (for coherency checking) | |
short | _voltable [2][256] |
the precalculated volume table (stereo 16 bits) | |
int | _rdata_start |
a copy of _data_start that is not modified by read_sound_data() . Used to save the sound data to a file. | |
int | _rdata_size |
a copy of _data_size that is not modified by read_sound_data() . Used to save the sound data to a file. |
This class implements a channel specifically for Full Throttle.
Definition at line 107 of file channel.h.
|
Definition at line 130 of file channel.cpp. |
|
Definition at line 144 of file channel.cpp. References win32_save_as_wave(). |
|
appends coded sound data to the track. This method is called by the player from time to time when new data is available for the track.
Implements channel. Definition at line 217 of file channel.cpp. References from_big_endian(), and chunck::type. |
|
get the number of samples currently available in the channel. This method is called by the mixer from time to time to get the current number of samples available.
Implements channel. Definition at line 254 of file channel.cpp. |
|
debugging do not use. This method is called by player to perform integrity check on the unknown parameters in the chuncks. There is no real other point than to check a few assertions in using this method. Implements channel. Definition at line 203 of file channel.cpp. |
|
SHDR chunck handling. This method contain the handling of the SHDR sub-chunck.
Definition at line 74 of file channel.cpp. |
|
SMRK chunck handling. This method contain the handling of the SMRK sub-chunck.
Definition at line 59 of file channel.cpp. |
|
STRK chunck handling. This method contain the handling of the STRK sub-chunck.
Definition at line 37 of file channel.cpp. References from_big_endian(). |
|
is the track terminated ? This method is called by the mixer from time to time to check if the track is terminated.
Implements channel. Definition at line 158 of file channel.cpp. |
|
SAUD buffer processing.
this method is called by
Definition at line 83 of file channel.cpp. References chunck::chunck_string(), from_big_endian(), and chunck::type. |
|
read some sound data from the channel. This method is called by the mixer from time to time to get the current number of samples available.
Implements channel. Definition at line 238 of file channel.cpp. |
|
volume table calculation.
This method is called when the Definition at line 167 of file channel.cpp. |
|
debugging do not use. This method is called by player to perform integrity check on the unknown parameters in the chuncks. There is no real other point than to check a few assertions in using this method. Implements channel. Definition at line 189 of file channel.cpp. |
|
the current track balance
|
|
SAUD buffer.
|
|
the size of the sound buffer
|
|
the current read position in the SAUD buffer
|
|
the current write position in the SAUD buffer
|
|
remaining size of sound data in the SAUD buffer
|
|
the start of the sound data in the SAUD buffer
|
|
current flags of the track (unused)
|
|
the frequency target of the track (always 22050)
|
|
the current PSAD index (for coherency checking)
|
|
set to
|
|
number of frames of the track (unused)
|
|
a copy of
|
|
a copy of
|
|
The track identifier.
|
|
the precalculated volume table (stereo 16 bits)
|
|
the current track volume
|