eSoundPlayer Class Reference

#include <eSound.h>

Collaboration diagram for eSoundPlayer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 eSoundPlayer (eWavData &w, bool loop=false)
 ~eSoundPlayer ()
bool Mix (Uint8 *dest, Uint32 len, int viewer, REAL rvol, REAL lvol, REAL speed=1)
void Reset (int randomize=0)
void End ()
void MakeGlobal ()

Private Attributes

int id
eWavDatawav
eAudioPos pos [MAX_VIEWERS]
bool goon [MAX_VIEWERS]
bool loop


Detailed Description

Definition at line 94 of file eSound.h.


Constructor & Destructor Documentation

eSoundPlayer::eSoundPlayer ( eWavData w,
bool  loop = false 
)

Definition at line 737 of file eSound.cpp.

References goon, eWavData::Load(), MAX_VIEWERS, and wav.

00738         :id(-1),wav(&w),loop(l){
00739     if (l)
00740         wav->Load();
00741 
00742     for(int i=MAX_VIEWERS-1;i>=0;i--)
00743         goon[i]=true;
00744 }

Here is the call graph for this function:

eSoundPlayer::~eSoundPlayer (  ) 

Definition at line 746 of file eSound.cpp.

00746 {}


Member Function Documentation

bool eSoundPlayer::Mix ( Uint8 *  dest,
Uint32  len,
int  viewer,
REAL  rvol,
REAL  lvol,
REAL  speed = 1 
)

Definition at line 748 of file eSound.cpp.

References goon, loop, loudness_thresh, eWavData::Mix(), pos, real_sound_sources, and wav.

00753                                   {
00754 
00755     if (goon[viewer]){
00756         if (rvol+lvol>loudness_thresh){
00757             real_sound_sources++;
00758             return goon[viewer]=!wav->Mix(dest,len,pos[viewer],rvol,lvol,speed,loop);
00759         }
00760         else
00761             return true;
00762     }
00763     else
00764         return false;
00765 }

Here is the call graph for this function:

void eSoundPlayer::Reset ( int  randomize = 0  ) 

Definition at line 767 of file eSound.cpp.

References goon, eWavData::Load(), MAX_VIEWERS, pos, eAudioPos::Reset(), and wav.

00767                                      {
00768     wav->Load();
00769 
00770     for(int i=MAX_VIEWERS-1;i>=0;i--){
00771         pos[i].Reset(randomize);
00772         goon[i]=true;
00773     }
00774 }

Here is the call graph for this function:

void eSoundPlayer::End (  ) 

Definition at line 776 of file eSound.cpp.

References goon, and MAX_VIEWERS.

00776                       {
00777     for(int i=MAX_VIEWERS-1;i>=0;i--){
00778         goon[i]=false;
00779     }
00780 }

void eSoundPlayer::MakeGlobal (  ) 

Definition at line 783 of file eSound.cpp.

References tList< T, MALLOC, REFERENCE >::Add(), eWavData::Load(), se_SoundLock(), se_SoundUnlock(), and wav.

00783                              {
00784     wav->Load();
00785 
00786     se_SoundLock();
00787     se_globalPlayers.Add(this,id);
00788     se_SoundUnlock();
00789 }

Here is the call graph for this function:


Member Data Documentation

int eSoundPlayer::id [private]

Definition at line 95 of file eSound.h.

eWavData* eSoundPlayer::wav [private]

Definition at line 96 of file eSound.h.

Referenced by eSoundPlayer(), MakeGlobal(), Mix(), and Reset().

eAudioPos eSoundPlayer::pos[MAX_VIEWERS] [private]

Definition at line 97 of file eSound.h.

Referenced by Mix(), and Reset().

bool eSoundPlayer::goon[MAX_VIEWERS] [private]

Definition at line 98 of file eSound.h.

Referenced by End(), eSoundPlayer(), Mix(), and Reset().

bool eSoundPlayer::loop [private]

Definition at line 99 of file eSound.h.

Referenced by Mix().


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:29:37 2008 for Armagetron Advanced by  doxygen 1.5.4