AudioProcess Class Reference

#include <AudioProcess.h>

Inheritance diagram for AudioProcess:

Process List of all members.

Public Member Functions

 ENABLE_RUNTIME_CLASSTYPE ()
 AudioProcess (void)
virtual ~AudioProcess (void)
 INTRINSIC (I_playSFX)
 INTRINSIC (I_playAmbientSFX)
 INTRINSIC (I_isSFXPlaying)
 INTRINSIC (I_setVolumeSFX)
 INTRINSIC (I_stopSFX)
virtual bool run (const uint32 framenum)
void playSFX (int sfxnum, int priority, ObjId objid, int loops, bool no_duplicates=false, uint32 pitch_shift=0x10000, uint16 volume=0x80)
void stopSFX (int sfxnum, ObjId objid)
bool isSFXPlaying (int sfxnum)
void setVolumeSFX (int sfxnum, uint8 volume)
bool playSpeech (std::string &barked, int shapenum, ObjId objid, uint32 pitch_shift=0x10000, uint16 volume=256)
void stopSpeech (std::string &barked, int shapenum, ObjId objid)
bool isSpeechPlaying (std::string &barked, int shapenum)
uint32 getSpeechLength (std::string &barked, int shapenum) const
int playSample (Pentagram::AudioSample *sample, int priority, int loops, uint32 pitch_shift=0x10000, int lvol=256, int rvol=256)
void pauseAllSamples ()
void unpauseAllSamples ()
void stopAllExceptSpeech ()
bool loadData (IDataSource *ids, uint32 version)

Static Public Member Functions

static AudioProcessget_instance ()
static void ConCmd_listSFX (const Console::ArgvType &argv)
static void ConCmd_stopSFX (const Console::ArgvType &argv)
static void ConCmd_playSFX (const Console::ArgvType &argv)

Private Member Functions

virtual void saveData (ODataSource *ods)
bool continueSpeech (SampleInfo &si)
bool calculateSoundVolume (ObjId objid, int &lvol, int &rvol) const

Private Attributes

std::list< SampleInfosample_info
uint32 paused

Static Private Attributes

static AudioProcessthe_audio_process = 0

Classes

struct  SampleInfo

Detailed Description

Definition at line 31 of file AudioProcess.h.


Constructor & Destructor Documentation

AudioProcess::AudioProcess ( void   ) 

Definition at line 45 of file AudioProcess.cpp.

References the_audio_process, and Process::type.

AudioProcess::~AudioProcess ( void   )  [virtual]

Definition at line 51 of file AudioProcess.cpp.

References the_audio_process.


Member Function Documentation

bool AudioProcess::calculateSoundVolume ( ObjId  objid,
int &  lvol,
int &  rvol 
) const [private]

Definition at line 56 of file AudioProcess.cpp.

References CameraProcess::GetCameraLocation(), getItem(), Item::getLocationAbsolute(), x, and y.

Referenced by playSFX(), run(), and setVolumeSFX().

void AudioProcess::ConCmd_listSFX ( const Console::ArgvType argv  )  [static]

Definition at line 572 of file AudioProcess.cpp.

References get_instance(), perr, pout, and sample_info.

Referenced by GUIApp::GUIApp(), and GUIApp::~GUIApp().

void AudioProcess::ConCmd_playSFX ( const Console::ArgvType argv  )  [static]

Definition at line 615 of file AudioProcess.cpp.

References get_instance(), perr, playSFX(), and pout.

Referenced by GUIApp::GUIApp(), and GUIApp::~GUIApp().

void AudioProcess::ConCmd_stopSFX ( const Console::ArgvType argv  )  [static]

Definition at line 592 of file AudioProcess.cpp.

References get_instance(), perr, pout, and stopSFX().

Referenced by GUIApp::GUIApp(), and GUIApp::~GUIApp().

bool AudioProcess::continueSpeech ( SampleInfo si  )  [private]

play the next speech sample for the text in this SampleInfo note: si is reused if successful returns true if there was speech left to play, or false if finished

Definition at line 131 of file AudioProcess.cpp.

References AudioProcess::SampleInfo::barked, NS_TIMIDITY::channel, AudioProcess::SampleInfo::channel, AudioProcess::SampleInfo::curspeech_end, AudioProcess::SampleInfo::curspeech_start, GameData::get_instance(), SpeechFlex::getIndexForPhrase(), SoundFlex::getSample(), GameData::getSpeechFlex(), playSample(), AudioProcess::SampleInfo::priority, and AudioProcess::SampleInfo::sfxnum.

Referenced by run().

AudioProcess::ENABLE_RUNTIME_CLASSTYPE (  ) 

Reimplemented from Process.

static AudioProcess* AudioProcess::get_instance (  )  [inline, static]

Get the current instance of the Audio Processes.

Definition at line 65 of file AudioProcess.h.

References the_audio_process.

Referenced by MainActor::accumulateDex(), MainActor::accumulateInt(), MainActor::accumulateStr(), ModalGump::Close(), ConCmd_listSFX(), MainActor::ConCmd_maxstats(), ConCmd_playSFX(), ConCmd_stopSFX(), ActorAnimProcess::doHitSpecial(), ActorAnimProcess::doSpecial(), Item::explode(), ModalGump::InitGump(), BarkGump::InitGump(), BarkGump::OnMouseDown(), Actor::receiveHit(), SKFPlayer::run(), GrantPeaceProcess::run(), ClearFeignDeathProcess::run(), BarkGump::Run(), ActorAnimProcess::run(), World::switchMap(), and GravityProcess::terminate().

uint32 AudioProcess::getSpeechLength ( std::string &  barked,
int  shapenum 
) const

get length (in milliseconds) of speech

Definition at line 382 of file AudioProcess.cpp.

References GameData::get_instance(), GameData::getSpeechFlex(), and SpeechFlex::getSpeechLength().

Referenced by BarkGump::InitGump().

AudioProcess::INTRINSIC ( I_stopSFX   ) 

AudioProcess::INTRINSIC ( I_setVolumeSFX   ) 

AudioProcess::INTRINSIC ( I_isSFXPlaying   ) 

AudioProcess::INTRINSIC ( I_playAmbientSFX   ) 

AudioProcess::INTRINSIC ( I_playSFX   ) 

bool AudioProcess::isSFXPlaying ( int  sfxnum  ) 

Definition at line 302 of file AudioProcess.cpp.

References sample_info.

bool AudioProcess::isSpeechPlaying ( std::string &  barked,
int  shapenum 
)

Definition at line 409 of file AudioProcess.cpp.

References sample_info.

Referenced by BarkGump::Run().

bool AudioProcess::loadData ( IDataSource ids,
uint32  version 
)

load Process data

Reimplemented from Process.

Definition at line 184 of file AudioProcess.cpp.

References Process::loadData(), playSFX(), and playSpeech().

void AudioProcess::pauseAllSamples (  ) 

pause all currently playing samples

Definition at line 423 of file AudioProcess.cpp.

References Pentagram::AudioMixer::isPlaying(), paused, sample_info, and Pentagram::AudioMixer::setPaused().

Referenced by ModalGump::InitGump().

int AudioProcess::playSample ( Pentagram::AudioSample sample,
int  priority,
int  loops,
uint32  pitch_shift = 0x10000,
int  lvol = 256,
int  rvol = 256 
)

play a sample (without storing a SampleInfo) returns channel sample is played on, or -1

Definition at line 217 of file AudioProcess.cpp.

References NS_TIMIDITY::channel, Pentagram::AudioMixer::playSample(), and sample_info.

Referenced by continueSpeech(), playSFX(), playSpeech(), and SKFPlayer::run().

void AudioProcess::playSFX ( int  sfxnum,
int  priority,
ObjId  objid,
int  loops,
bool  no_duplicates = false,
uint32  pitch_shift = 0x10000,
uint16  volume = 0x80 
)

Definition at line 238 of file AudioProcess.cpp.

References calculateSoundVolume(), NS_TIMIDITY::channel, GameData::get_instance(), SoundFlex::getSample(), GameData::getSoundFlex(), Pentagram::AudioMixer::isPlaying(), playSample(), pout, and sample_info.

Referenced by MainActor::accumulateDex(), MainActor::accumulateInt(), MainActor::accumulateStr(), MainActor::ConCmd_maxstats(), ConCmd_playSFX(), ActorAnimProcess::doSpecial(), Item::explode(), loadData(), Actor::receiveHit(), SKFPlayer::run(), GrantPeaceProcess::run(), ClearFeignDeathProcess::run(), ActorAnimProcess::run(), and GravityProcess::terminate().

bool AudioProcess::playSpeech ( std::string &  barked,
int  shapenum,
ObjId  objid,
uint32  pitch_shift = 0x10000,
uint16  volume = 256 
)

Definition at line 336 of file AudioProcess.cpp.

References NS_TIMIDITY::channel, GameData::get_instance(), SpeechFlex::getIndexForPhrase(), SoundFlex::getSample(), GameData::getSpeechFlex(), Pentagram::AudioMixer::isPlaying(), playSample(), pout, and sample_info.

Referenced by BarkGump::InitGump(), and loadData().

bool AudioProcess::run ( const uint32  framenum  )  [virtual]

Implements Process.

Definition at line 101 of file AudioProcess.cpp.

References calculateSoundVolume(), continueSpeech(), Pentagram::AudioMixer::isPlaying(), sample_info, and Pentagram::AudioMixer::setVolume().

void AudioProcess::saveData ( ODataSource ods  )  [private, virtual]

save the Process data

Reimplemented from Process.

Definition at line 161 of file AudioProcess.cpp.

References sample_info, Process::saveData(), ODataSource::write(), ODataSource::write1(), ODataSource::write2(), and ODataSource::write4().

void AudioProcess::setVolumeSFX ( int  sfxnum,
uint8  volume 
)

Definition at line 315 of file AudioProcess.cpp.

References calculateSoundVolume(), sample_info, and Pentagram::AudioMixer::setVolume().

void AudioProcess::stopAllExceptSpeech (  ) 

stop all samples except speech

Definition at line 465 of file AudioProcess.cpp.

References Pentagram::AudioMixer::isPlaying(), sample_info, and Pentagram::AudioMixer::stopSample().

Referenced by World::switchMap().

void AudioProcess::stopSFX ( int  sfxnum,
ObjId  objid 
)

Definition at line 284 of file AudioProcess.cpp.

References Pentagram::AudioMixer::isPlaying(), sample_info, and Pentagram::AudioMixer::stopSample().

Referenced by ConCmd_stopSFX(), and SKFPlayer::run().

void AudioProcess::stopSpeech ( std::string &  barked,
int  shapenum,
ObjId  objid 
)

Definition at line 391 of file AudioProcess.cpp.

References Pentagram::AudioMixer::isPlaying(), sample_info, and Pentagram::AudioMixer::stopSample().

Referenced by BarkGump::OnMouseDown().

void AudioProcess::unpauseAllSamples (  ) 

unpause all currently playing samples

Definition at line 444 of file AudioProcess.cpp.

References Pentagram::AudioMixer::isPlaying(), paused, sample_info, and Pentagram::AudioMixer::setPaused().

Referenced by ModalGump::Close().


Member Data Documentation

uint32 AudioProcess::paused [private]

Definition at line 115 of file AudioProcess.h.

Referenced by pauseAllSamples(), and unpauseAllSamples().

std::list<SampleInfo> AudioProcess::sample_info [private]

Definition at line 55 of file AudioProcess.h.

Referenced by ConCmd_listSFX(), isSFXPlaying(), isSpeechPlaying(), pauseAllSamples(), playSample(), playSFX(), playSpeech(), run(), saveData(), setVolumeSFX(), stopAllExceptSpeech(), stopSFX(), stopSpeech(), and unpauseAllSamples().

AudioProcess * AudioProcess::the_audio_process = 0 [static, private]

Definition at line 124 of file AudioProcess.h.

Referenced by AudioProcess(), get_instance(), and ~AudioProcess().


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