Pentagram::AudioChannel Class Reference

#include <AudioChannel.h>

List of all members.

Public Member Functions

 AudioChannel (uint32 sample_rate, bool stereo)
 ~AudioChannel (void)
void stop ()
void playSample (AudioSample *sample, int loop, int priority, bool paused, uint32 pitch_shift, int lvol, int rvol)
void resampleAndMix (sint16 *stream, uint32 bytes)
bool isPlaying ()
void setPitchShift (int pitch_shift_)
uint32 getPitchShift () const
void setLoop (int loop_)
sint32 getLoop () const
void setVolume (int lvol_, int rvol_)
void getVolume (int &lvol_, int &rvol_) const
void setPriority (int priority_)
int getPriority () const
void setPaused (bool paused_)
bool isPaused () const

Private Member Functions

void DecompressNextFrame ()
void resampleFrameM8toS (sint16 *&samples, uint32 &bytes)
void resampleFrameM8toM (sint16 *&samples, uint32 &bytes)

Private Attributes

uint8playdata
uint32 playdata_size
uint32 decompressor_size
uint32 frame_size
uint32 sample_rate
bool stereo
sint32 loop
AudioSamplesample
uint32 frame_evenodd
uint32 frame0_size
uint32 frame1_size
uint32 position
int lvol
int rvol
uint32 pitch_shift
int priority
bool paused
CubicInterpolator interp_l
CubicInterpolator interp_r
int fp_pos
int fp_speed

Classes

class  CubicInterpolator


Detailed Description

Definition at line 26 of file AudioChannel.h.


Constructor & Destructor Documentation

Pentagram::AudioChannel::AudioChannel ( uint32  sample_rate,
bool  stereo 
)

Definition at line 37 of file AudioChannel.cpp.

Pentagram::AudioChannel::~AudioChannel ( void   ) 

Definition at line 46 of file AudioChannel.cpp.


Member Function Documentation

void Pentagram::AudioChannel::DecompressNextFrame (  )  [private]

Definition at line 173 of file AudioChannel.cpp.

References Pentagram::AudioSample::decompressFrame(), decompressor_size, frame1_size, frame_evenodd, frame_size, loop, playdata, Pentagram::AudioSample::rewind(), and sample.

Referenced by playSample(), and resampleAndMix().

sint32 Pentagram::AudioChannel::getLoop (  )  const [inline]

Definition at line 67 of file AudioChannel.h.

References loop.

uint32 Pentagram::AudioChannel::getPitchShift (  )  const [inline]

Definition at line 64 of file AudioChannel.h.

References pitch_shift.

int Pentagram::AudioChannel::getPriority (  )  const [inline]

Definition at line 73 of file AudioChannel.h.

References priority.

void Pentagram::AudioChannel::getVolume ( int &  lvol_,
int &  rvol_ 
) const [inline]

Definition at line 70 of file AudioChannel.h.

References lvol, and rvol.

Referenced by Pentagram::AudioMixer::getVolume().

bool Pentagram::AudioChannel::isPaused (  )  const [inline]

Definition at line 76 of file AudioChannel.h.

References paused.

Referenced by Pentagram::AudioMixer::isPaused().

bool Pentagram::AudioChannel::isPlaying (  )  [inline]

Definition at line 61 of file AudioChannel.h.

References sample.

Referenced by Pentagram::AudioMixer::isPlaying().

void Pentagram::AudioChannel::playSample ( AudioSample sample,
int  loop,
int  priority,
bool  paused,
uint32  pitch_shift,
int  lvol,
int  rvol 
)

Definition at line 50 of file AudioChannel.cpp.

References Pentagram::AudioSample::decompressFrame(), DecompressNextFrame(), decompressor_size, fp_pos, fp_speed, frame0_size, frame_evenodd, frame_size, Pentagram::AudioSample::getBits(), Pentagram::AudioSample::getDecompressorDataSize(), Pentagram::AudioSample::getFrameSize(), Pentagram::AudioSample::getRate(), Pentagram::AudioChannel::CubicInterpolator::init(), Pentagram::AudioSample::initDecompressor(), interp_l, Pentagram::AudioSample::isStereo(), loop, lvol, paused, pitch_shift, playdata, playdata_size, position, priority, rvol, sample, and sample_rate.

void Pentagram::AudioChannel::resampleAndMix ( sint16 stream,
uint32  bytes 
)

Definition at line 101 of file AudioChannel.cpp.

References DecompressNextFrame(), fp_speed, frame0_size, frame1_size, frame_evenodd, Pentagram::AudioSample::getBits(), Pentagram::AudioSample::getRate(), Pentagram::AudioSample::isStereo(), paused, pitch_shift, position, resampleFrameM8toM(), resampleFrameM8toS(), sample, sample_rate, and stereo.

void Pentagram::AudioChannel::resampleFrameM8toM ( sint16 *&  samples,
uint32 bytes 
) [private]

Definition at line 248 of file AudioChannel.cpp.

References decompressor_size, Pentagram::AudioChannel::CubicInterpolator::feedData(), fp_pos, fp_speed, frame0_size, frame1_size, frame_evenodd, frame_size, interp_l, Pentagram::AudioChannel::CubicInterpolator::interpolate(), lvol, playdata, position, and rvol.

Referenced by resampleAndMix().

void Pentagram::AudioChannel::resampleFrameM8toS ( sint16 *&  samples,
uint32 bytes 
) [private]

Definition at line 188 of file AudioChannel.cpp.

References decompressor_size, Pentagram::AudioChannel::CubicInterpolator::feedData(), fp_pos, fp_speed, frame0_size, frame1_size, frame_evenodd, frame_size, interp_l, Pentagram::AudioChannel::CubicInterpolator::interpolate(), lvol, playdata, position, and rvol.

Referenced by resampleAndMix().

void Pentagram::AudioChannel::setLoop ( int  loop_  )  [inline]

Definition at line 66 of file AudioChannel.h.

References loop.

void Pentagram::AudioChannel::setPaused ( bool  paused_  )  [inline]

Definition at line 75 of file AudioChannel.h.

References paused.

Referenced by Pentagram::AudioMixer::setPaused().

void Pentagram::AudioChannel::setPitchShift ( int  pitch_shift_  )  [inline]

Definition at line 63 of file AudioChannel.h.

References pitch_shift.

void Pentagram::AudioChannel::setPriority ( int  priority_  )  [inline]

Definition at line 72 of file AudioChannel.h.

References priority.

void Pentagram::AudioChannel::setVolume ( int  lvol_,
int  rvol_ 
) [inline]

Definition at line 69 of file AudioChannel.h.

References lvol, and rvol.

Referenced by Pentagram::AudioMixer::setVolume().

void Pentagram::AudioChannel::stop (  )  [inline]

Definition at line 56 of file AudioChannel.h.

References sample.

Referenced by Pentagram::AudioMixer::stopSample().


Member Data Documentation

uint32 Pentagram::AudioChannel::decompressor_size [private]

Definition at line 33 of file AudioChannel.h.

Referenced by DecompressNextFrame(), playSample(), resampleFrameM8toM(), and resampleFrameM8toS().

int Pentagram::AudioChannel::fp_pos [private]

Definition at line 170 of file AudioChannel.h.

Referenced by playSample(), resampleFrameM8toM(), and resampleFrameM8toS().

int Pentagram::AudioChannel::fp_speed [private]

Definition at line 171 of file AudioChannel.h.

Referenced by playSample(), resampleAndMix(), resampleFrameM8toM(), and resampleFrameM8toS().

uint32 Pentagram::AudioChannel::frame0_size [private]

Definition at line 44 of file AudioChannel.h.

Referenced by playSample(), resampleAndMix(), resampleFrameM8toM(), and resampleFrameM8toS().

uint32 Pentagram::AudioChannel::frame1_size [private]

Definition at line 45 of file AudioChannel.h.

Referenced by DecompressNextFrame(), resampleAndMix(), resampleFrameM8toM(), and resampleFrameM8toS().

uint32 Pentagram::AudioChannel::frame_evenodd [private]

Definition at line 43 of file AudioChannel.h.

Referenced by DecompressNextFrame(), playSample(), resampleAndMix(), resampleFrameM8toM(), and resampleFrameM8toS().

uint32 Pentagram::AudioChannel::frame_size [private]

Definition at line 34 of file AudioChannel.h.

Referenced by DecompressNextFrame(), playSample(), resampleFrameM8toM(), and resampleFrameM8toS().

CubicInterpolator Pentagram::AudioChannel::interp_l [private]

Definition at line 168 of file AudioChannel.h.

Referenced by playSample(), resampleFrameM8toM(), and resampleFrameM8toS().

CubicInterpolator Pentagram::AudioChannel::interp_r [private]

Definition at line 169 of file AudioChannel.h.

sint32 Pentagram::AudioChannel::loop [private]

Definition at line 39 of file AudioChannel.h.

Referenced by DecompressNextFrame(), getLoop(), playSample(), and setLoop().

int Pentagram::AudioChannel::lvol [private]

Definition at line 47 of file AudioChannel.h.

Referenced by getVolume(), playSample(), resampleFrameM8toM(), resampleFrameM8toS(), and setVolume().

bool Pentagram::AudioChannel::paused [private]

Definition at line 50 of file AudioChannel.h.

Referenced by isPaused(), playSample(), resampleAndMix(), and setPaused().

uint32 Pentagram::AudioChannel::pitch_shift [private]

Definition at line 48 of file AudioChannel.h.

Referenced by getPitchShift(), playSample(), resampleAndMix(), and setPitchShift().

uint8* Pentagram::AudioChannel::playdata [private]

Definition at line 31 of file AudioChannel.h.

Referenced by DecompressNextFrame(), playSample(), resampleFrameM8toM(), and resampleFrameM8toS().

uint32 Pentagram::AudioChannel::playdata_size [private]

Definition at line 32 of file AudioChannel.h.

Referenced by playSample().

uint32 Pentagram::AudioChannel::position [private]

Definition at line 46 of file AudioChannel.h.

Referenced by playSample(), resampleAndMix(), resampleFrameM8toM(), and resampleFrameM8toS().

int Pentagram::AudioChannel::priority [private]

Definition at line 49 of file AudioChannel.h.

Referenced by getPriority(), playSample(), and setPriority().

int Pentagram::AudioChannel::rvol [private]

Definition at line 47 of file AudioChannel.h.

Referenced by getVolume(), playSample(), resampleFrameM8toM(), resampleFrameM8toS(), and setVolume().

AudioSample* Pentagram::AudioChannel::sample [private]

Definition at line 40 of file AudioChannel.h.

Referenced by DecompressNextFrame(), isPlaying(), playSample(), resampleAndMix(), and stop().

uint32 Pentagram::AudioChannel::sample_rate [private]

Definition at line 36 of file AudioChannel.h.

Referenced by playSample(), and resampleAndMix().

bool Pentagram::AudioChannel::stereo [private]

Definition at line 37 of file AudioChannel.h.

Referenced by resampleAndMix().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:30:28 2007 for pentagram by  doxygen 1.4.7