#include <eSound.h>
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 |
eWavData * | wav |
eAudioPos | pos [MAX_VIEWERS] |
bool | goon [MAX_VIEWERS] |
bool | loop |
Definition at line 94 of file eSound.h.
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 }
eSoundPlayer::~eSoundPlayer | ( | ) |
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 }
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 }
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 }
int eSoundPlayer::id [private] |
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] |
bool eSoundPlayer::goon[MAX_VIEWERS] [private] |
bool eSoundPlayer::loop [private] |