LLAudioEngine Class Reference

#include <audioengine.h>

Inheritance diagram for LLAudioEngine:

Inheritance graph
[legend]
Collaboration diagram for LLAudioEngine:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 LLAudioEngine ()
virtual ~LLAudioEngine ()
virtual BOOL init (const S32 num_channels, void *userdata)
virtual void shutdown ()
virtual void setListener (LLVector3 pos, LLVector3 vel, LLVector3 up, LLVector3 at)
virtual void updateWind (LLVector3 direction, F32 camera_height_above_water)=0
virtual void idle (F32 max_decode_time=0.f)
virtual void updateChannels ()
virtual BOOL isWindEnabled ()
virtual void enableWind (BOOL state_b)
virtual void setMuted (BOOL muted)
virtual BOOL getMuted () const
F32 getMasterGain ()
void setMasterGain (F32 gain)
F32 getInternetStreamGain ()
virtual void setDopplerFactor (F32 factor)
virtual F32 getDopplerFactor ()
virtual void setDistanceFactor (F32 factor)
virtual F32 getDistanceFactor ()
virtual void setRolloffFactor (F32 factor)
virtual F32 getRolloffFactor ()
virtual void setMaxWindGain (F32 gain)
void triggerSound (const LLUUID &sound_id, const LLUUID &owner_id, const F32 gain, const LLVector3d &pos_global=LLVector3d::zero)
BOOL preloadSound (const LLUUID &id)
void addAudioSource (LLAudioSource *asp)
void cleanupAudioSource (LLAudioSource *asp)
LLAudioSourcefindAudioSource (const LLUUID &source_id)
LLAudioDatagetAudioData (const LLUUID &audio_uuid)
virtual void startInternetStream (const char *url)=0
virtual void stopInternetStream ()=0
virtual void pauseInternetStream (int pause)=0
virtual int isInternetStreamPlaying ()=0
virtual void getInternetStreamInfo (char *artist, char *title)
virtual void setInternetStreamGain (F32 vol)
virtual const char * getInternetStreamURL ()
virtual LLVector3 getListenerPos ()
LLAudioBuffergetFreeBuffer ()
LLAudioChannelgetFreeChannel (const F32 priority)
void cleanupBuffer (LLAudioBuffer *bufferp)
BOOL hasDecodedFile (const LLUUID &uuid)
BOOL hasLocalFile (const LLUUID &uuid)
BOOL updateBufferForData (LLAudioData *adp, const LLUUID &audio_uuid=LLUUID::null)
void startNextTransfer ()

Static Public Member Functions

static void assetCallback (LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, void *user_data, S32 result_code, LLExtStat ext_status)

Public Attributes

F32 mMaxWindGain

Protected Types

typedef std::map< LLUUID,
LLAudioSource * > 
source_map
typedef std::map< LLUUID,
LLAudioData * > 
data_map

Protected Member Functions

virtual LLAudioBuffercreateBuffer ()=0
virtual LLAudioChannelcreateChannel ()=0
virtual void initWind ()=0
virtual void cleanupWind ()=0
virtual void setInternalGain (F32 gain)=0
void commitDeferredChanges ()
virtual void allocateListener ()=0
virtual void initInternetStream ()
virtual void updateInternetStream ()
virtual void setListenerPos (LLVector3 vec)
virtual void setListenerVelocity (LLVector3 vec)
virtual void orientListener (LLVector3 up, LLVector3 at)
virtual void translateListener (LLVector3 vec)
F64 mapWindVecToGain (LLVector3 wind_vec)
F64 mapWindVecToPitch (LLVector3 wind_vec)
F64 mapWindVecToPan (LLVector3 wind_vec)

Protected Attributes

LLListenermListenerp
BOOL mMuted
void * mUserData
S32 mLastStatus
S32 mNumChannels
BOOL mEnableWind
LLUUID mCurrentTransfer
LLFrameTimer mCurrentTransferTimer
source_map mAllSources
data_map mAllData
LLAudioChannelmChannels [MAX_CHANNELS]
LLAudioBuffermBuffers [MAX_BUFFERS]
F32 mMasterGain
F32 mInternetStreamGain
F32 mNextWindUpdate
LLFrameTimer mWindUpdateTimer

Private Member Functions

void setDefaults ()

Friends

class LLPipeline


Detailed Description

Definition at line 82 of file audioengine.h.


Member Typedef Documentation

typedef std::map<LLUUID, LLAudioSource *> LLAudioEngine::source_map [protected]

Definition at line 216 of file audioengine.h.

typedef std::map<LLUUID, LLAudioData *> LLAudioEngine::data_map [protected]

Definition at line 217 of file audioengine.h.


Constructor & Destructor Documentation

LLAudioEngine::LLAudioEngine (  ) 

Definition at line 61 of file audioengine.cpp.

References setDefaults().

Here is the call graph for this function:

LLAudioEngine::~LLAudioEngine (  )  [virtual]

Definition at line 67 of file audioengine.cpp.


Member Function Documentation

BOOL LLAudioEngine::init ( const S32  num_channels,
void *  userdata 
) [virtual]

Reimplemented in LLAudioEngine_FMOD.

Definition at line 102 of file audioengine.cpp.

References allocateListener(), gAudioDecodeMgrp, mNumChannels, mUserData, setDefaults(), and TRUE.

Referenced by idle_startup(), and LLAudioEngine_FMOD::init().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLAudioEngine::shutdown (  )  [virtual]

Reimplemented in LLAudioEngine_FMOD.

Definition at line 118 of file audioengine.cpp.

References gAudioDecodeMgrp, i, mAllData, mAllSources, MAX_BUFFERS, MAX_CHANNELS, mBuffers, mChannels, NULL, and S32.

Referenced by LLAppViewer::cleanup(), and LLAudioEngine_FMOD::shutdown().

Here is the caller graph for this function:

void LLAudioEngine::setListener ( LLVector3  pos,
LLVector3  vel,
LLVector3  up,
LLVector3  at 
) [virtual]

Definition at line 786 of file audioengine.cpp.

References mListenerp, and LLListener::set().

Referenced by audio_update_listener(), and init_audio().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void LLAudioEngine::updateWind ( LLVector3  direction,
F32  camera_height_above_water 
) [pure virtual]

Implemented in LLAudioEngine_FMOD.

Referenced by audio_update_wind().

Here is the caller graph for this function:

void LLAudioEngine::idle ( F32  max_decode_time = 0.f  )  [virtual]

void LLAudioEngine::updateChannels (  )  [virtual]

Definition at line 163 of file audioengine.cpp.

References i, MAX_CHANNELS, mChannels, S32, LLAudioChannel::update3DPosition(), LLAudioChannel::updateBuffer(), and LLAudioChannel::updateLoop().

Referenced by idle().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLAudioEngine::isWindEnabled (  )  [virtual]

Definition at line 622 of file audioengine.cpp.

References mEnableWind.

Referenced by toggle_wind_audio(), and LLDebugText::update().

Here is the caller graph for this function:

void LLAudioEngine::enableWind ( BOOL  state_b  )  [virtual]

Definition at line 476 of file audioengine.cpp.

References cleanupWind(), initWind(), and mEnableWind.

Referenced by audio_update_volume(), setMuted(), and toggle_wind_audio().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLAudioEngine::setMuted ( BOOL  muted  )  [virtual]

Definition at line 628 of file audioengine.cpp.

References enableWind(), and mMuted.

Referenced by audio_update_volume(), and idle_startup().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual BOOL LLAudioEngine::getMuted (  )  const [inline, virtual]

Definition at line 111 of file audioengine.h.

References mMuted.

Referenced by idle(), and startNextTransfer().

Here is the caller graph for this function:

F32 LLAudioEngine::getMasterGain (  ) 

Definition at line 641 of file audioengine.cpp.

References mMasterGain.

Referenced by idle().

Here is the caller graph for this function:

void LLAudioEngine::setMasterGain ( F32  gain  ) 

Definition at line 635 of file audioengine.cpp.

References mMasterGain, and setInternalGain().

Referenced by audio_update_volume().

Here is the call graph for this function:

Here is the caller graph for this function:

F32 LLAudioEngine::getInternetStreamGain (  ) 

Definition at line 646 of file audioengine.cpp.

References mInternetStreamGain.

void LLAudioEngine::setDopplerFactor ( F32  factor  )  [virtual]

Definition at line 792 of file audioengine.cpp.

References mListenerp, and LLListener::setDopplerFactor().

Referenced by audio_update_volume().

Here is the call graph for this function:

Here is the caller graph for this function:

F32 LLAudioEngine::getDopplerFactor (  )  [virtual]

Definition at line 801 of file audioengine.cpp.

References LLListener::getDopplerFactor(), and mListenerp.

Here is the call graph for this function:

void LLAudioEngine::setDistanceFactor ( F32  factor  )  [virtual]

Definition at line 814 of file audioengine.cpp.

References mListenerp, and LLListener::setDistanceFactor().

Referenced by audio_update_volume().

Here is the call graph for this function:

Here is the caller graph for this function:

F32 LLAudioEngine::getDistanceFactor (  )  [virtual]

Definition at line 823 of file audioengine.cpp.

References LLListener::getDistanceFactor(), and mListenerp.

Here is the call graph for this function:

void LLAudioEngine::setRolloffFactor ( F32  factor  )  [virtual]

Definition at line 836 of file audioengine.cpp.

References mListenerp, and LLListener::setRolloffFactor().

Referenced by audio_update_volume(), and audio_update_wind().

Here is the call graph for this function:

Here is the caller graph for this function:

F32 LLAudioEngine::getRolloffFactor (  )  [virtual]

Definition at line 845 of file audioengine.cpp.

References LLListener::getRolloffFactor(), and mListenerp.

Here is the call graph for this function:

void LLAudioEngine::setMaxWindGain ( F32  gain  )  [virtual]

Definition at line 651 of file audioengine.cpp.

References mMaxWindGain.

void LLAudioEngine::triggerSound ( const LLUUID sound_id,
const LLUUID owner_id,
const F32  gain,
const LLVector3d pos_global = LLVector3d::zero 
)

BOOL LLAudioEngine::preloadSound ( const LLUUID id  ) 

Definition at line 604 of file audioengine.cpp.

References LLAudioDecodeMgr::addDecodeRequest(), FALSE, gAudioDecodeMgrp, getAudioData(), and TRUE.

Referenced by init_audio(), and LLPreviewSound::LLPreviewSound().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLAudioEngine::addAudioSource ( LLAudioSource asp  ) 

Definition at line 897 of file audioengine.cpp.

References LLAudioSource::getID(), and mAllSources.

Referenced by LLViewerObject::getAudioSource(), and triggerSound().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLAudioEngine::cleanupAudioSource ( LLAudioSource asp  ) 

Definition at line 903 of file audioengine.cpp.

References LLAudioSource::getID(), llendl, llwarns, and mAllSources.

Referenced by LLViewerObject::markDead(), and LLViewerObject::setAttachedSound().

Here is the call graph for this function:

Here is the caller graph for this function:

LLAudioSource * LLAudioEngine::findAudioSource ( const LLUUID source_id  ) 

Definition at line 864 of file audioengine.cpp.

References mAllSources, and NULL.

LLAudioData * LLAudioEngine::getAudioData ( const LLUUID audio_uuid  ) 

Definition at line 880 of file audioengine.cpp.

References mAllData.

Referenced by assetCallback(), LLAudioSource::play(), preloadSound(), process_preload_sound(), and LLAudioDecodeMgr::Impl::processQueue().

Here is the caller graph for this function:

virtual void LLAudioEngine::startInternetStream ( const char *  url  )  [pure virtual]

Implemented in LLAudioEngine_FMOD.

Referenced by handleAudioStreamMusicChanged(), LLViewerParcelMgr::processParcelProperties(), and LLOverlayBar::toggleMusicPlay().

Here is the caller graph for this function:

virtual void LLAudioEngine::stopInternetStream (  )  [pure virtual]

Implemented in LLAudioEngine_FMOD.

Referenced by handleAudioStreamMusicChanged(), LLViewerParcelMgr::processParcelProperties(), and LLOverlayBar::toggleMusicPlay().

Here is the caller graph for this function:

virtual void LLAudioEngine::pauseInternetStream ( int  pause  )  [pure virtual]

Implemented in LLAudioEngine_FMOD.

virtual int LLAudioEngine::isInternetStreamPlaying (  )  [pure virtual]

Implemented in LLAudioEngine_FMOD.

Referenced by handleAudioStreamMusicChanged().

Here is the caller graph for this function:

virtual void LLAudioEngine::getInternetStreamInfo ( char *  artist,
char *  title 
) [inline, virtual]

Reimplemented in LLAudioEngine_FMOD.

Definition at line 143 of file audioengine.h.

virtual void LLAudioEngine::setInternetStreamGain ( F32  vol  )  [inline, virtual]

Reimplemented in LLAudioEngine_FMOD.

Definition at line 145 of file audioengine.h.

References mInternetStreamGain.

Referenced by audio_update_volume(), and LLAudioEngine_FMOD::setInternetStreamGain().

Here is the caller graph for this function:

virtual const char* LLAudioEngine::getInternetStreamURL (  )  [inline, virtual]

Reimplemented in LLAudioEngine_FMOD.

Definition at line 146 of file audioengine.h.

Referenced by LLViewerParcelMgr::processParcelProperties().

Here is the caller graph for this function:

LLVector3 LLAudioEngine::getListenerPos (  )  [virtual]

Definition at line 755 of file audioengine.cpp.

References LLListener::getPosition(), mListenerp, and LLVector3::zero.

Referenced by LLAudioSource::updatePriority().

Here is the call graph for this function:

Here is the caller graph for this function:

LLAudioBuffer * LLAudioEngine::getFreeBuffer (  ) 

Definition at line 491 of file audioengine.cpp.

References createBuffer(), LLFrameTimer::getElapsedTimeF32(), i, llendl, llinfos, LLAudioBuffer::mAudioDatap, MAX_BUFFERS, LLAudioData::mBufferp, mBuffers, LLAudioBuffer::mLastUseTimer, NULL, and S32.

Referenced by LLAudioData::load().

Here is the call graph for this function:

Here is the caller graph for this function:

LLAudioChannel * LLAudioEngine::getFreeChannel ( const F32  priority  ) 

Definition at line 535 of file audioengine.cpp.

References LLAudioChannel::cleanup(), createChannel(), LLAudioSource::getPriority(), LLAudioChannel::getSource(), i, mChannels, mNumChannels, NULL, S32, and LLAudioSource::setChannel().

Referenced by idle(), and LLAudioSource::setupChannel().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLAudioEngine::cleanupBuffer ( LLAudioBuffer bufferp  ) 

Definition at line 590 of file audioengine.cpp.

References i, MAX_BUFFERS, mBuffers, NULL, and S32.

Referenced by LLAudioData::load().

Here is the caller graph for this function:

BOOL LLAudioEngine::hasDecodedFile ( const LLUUID uuid  ) 

Definition at line 917 of file audioengine.cpp.

References FALSE, LLDir::fileExists(), gDirUtilp, LLDir::getExpandedFilename(), LL_PATH_CACHE, LLUUID::toString(), TRUE, and UUID_STR_LENGTH.

Referenced by LLAudioDecodeMgr::addDecodeRequest(), LLAudioData::LLAudioData(), and LLAudioDecodeMgr::Impl::processQueue().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLAudioEngine::hasLocalFile ( const LLUUID uuid  ) 

Definition at line 937 of file audioengine.cpp.

References LLAssetType::AT_SOUND, LLVFS::getExists(), and gVFS.

Here is the call graph for this function:

BOOL LLAudioEngine::updateBufferForData ( LLAudioData adp,
const LLUUID audio_uuid = LLUUID::null 
)

Definition at line 442 of file audioengine.cpp.

References LLAudioDecodeMgr::addDecodeRequest(), FALSE, gAudioDecodeMgrp, LLAudioData::getBuffer(), LLAudioData::hasDecodedData(), LLAudioData::hasLocalData(), LLAudioData::load(), LLUUID::notNull(), and TRUE.

Referenced by idle(), and LLAudioSource::play().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLAudioEngine::startNextTransfer (  ) 

void LLAudioEngine::assetCallback ( LLVFS vfs,
const LLUUID uuid,
LLAssetType::EType  type,
void *  user_data,
S32  result_code,
LLExtStat  ext_status 
) [static]

virtual LLAudioBuffer* LLAudioEngine::createBuffer (  )  [protected, pure virtual]

Implemented in LLAudioEngine_FMOD.

Referenced by getFreeBuffer().

Here is the caller graph for this function:

virtual LLAudioChannel* LLAudioEngine::createChannel (  )  [protected, pure virtual]

Implemented in LLAudioEngine_FMOD.

Referenced by getFreeChannel().

Here is the caller graph for this function:

virtual void LLAudioEngine::initWind (  )  [protected, pure virtual]

Implemented in LLAudioEngine_FMOD.

Referenced by enableWind().

Here is the caller graph for this function:

virtual void LLAudioEngine::cleanupWind (  )  [protected, pure virtual]

Implemented in LLAudioEngine_FMOD.

Referenced by enableWind().

Here is the caller graph for this function:

virtual void LLAudioEngine::setInternalGain ( F32  gain  )  [protected, pure virtual]

Implemented in LLAudioEngine_FMOD.

Referenced by idle(), and setMasterGain().

Here is the caller graph for this function:

void LLAudioEngine::commitDeferredChanges (  )  [protected]

Definition at line 858 of file audioengine.cpp.

References LLListener::commitDeferredChanges(), and mListenerp.

Referenced by idle().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void LLAudioEngine::allocateListener (  )  [protected, pure virtual]

Implemented in LLAudioEngine_FMOD.

Referenced by init().

Here is the caller graph for this function:

virtual void LLAudioEngine::initInternetStream (  )  [inline, protected, virtual]

Reimplemented in LLAudioEngine_FMOD.

Definition at line 184 of file audioengine.h.

virtual void LLAudioEngine::updateInternetStream (  )  [inline, protected, virtual]

Reimplemented in LLAudioEngine_FMOD.

Definition at line 185 of file audioengine.h.

void LLAudioEngine::setListenerPos ( LLVector3  vec  )  [protected, virtual]

Definition at line 749 of file audioengine.cpp.

References mListenerp, and LLListener::setPosition().

Here is the call graph for this function:

void LLAudioEngine::setListenerVelocity ( LLVector3  vec  )  [protected, virtual]

Definition at line 768 of file audioengine.cpp.

References mListenerp, and LLListener::setVelocity().

Here is the call graph for this function:

void LLAudioEngine::orientListener ( LLVector3  up,
LLVector3  at 
) [protected, virtual]

Definition at line 780 of file audioengine.cpp.

References mListenerp, and LLListener::orient().

Here is the call graph for this function:

void LLAudioEngine::translateListener ( LLVector3  vec  )  [protected, virtual]

Definition at line 774 of file audioengine.cpp.

References mListenerp, and LLListener::translate().

Here is the call graph for this function:

F64 LLAudioEngine::mapWindVecToGain ( LLVector3  wind_vec  )  [protected]

Definition at line 657 of file audioengine.cpp.

References gain(), and LLVector3::magVec().

Referenced by LLAudioEngine_FMOD::updateWind().

Here is the call graph for this function:

Here is the caller graph for this function:

F64 LLAudioEngine::mapWindVecToPitch ( LLVector3  wind_vec  )  [protected]

Definition at line 676 of file audioengine.cpp.

References F_PI, LLVector3::normVec(), and LLVector3::setVec().

Referenced by LLAudioEngine_FMOD::updateWind().

Here is the call graph for this function:

Here is the caller graph for this function:

F64 LLAudioEngine::mapWindVecToPan ( LLVector3  wind_vec  )  [protected]

Definition at line 700 of file audioengine.cpp.

References F_PI, LLVector3::normVec(), and LLVector3::setVec().

Referenced by LLAudioEngine_FMOD::updateWind().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLAudioEngine::setDefaults (  )  [private]

Definition at line 72 of file audioengine.cpp.

References FALSE, i, MAX_BUFFERS, MAX_CHANNELS, mBuffers, mChannels, mEnableWind, mInternetStreamGain, mLastStatus, mListenerp, mMasterGain, mMaxWindGain, mMuted, mNextWindUpdate, mNumChannels, mUserData, NULL, and S32.

Referenced by init(), and LLAudioEngine().

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class LLPipeline [friend]

Definition at line 166 of file audioengine.h.


Member Data Documentation

Definition at line 202 of file audioengine.h.

Referenced by getMuted(), setDefaults(), setMuted(), and triggerSound().

void* LLAudioEngine::mUserData [protected]

Reimplemented in LLAudioEngine_FMOD.

Definition at line 203 of file audioengine.h.

Referenced by init(), and setDefaults().

Definition at line 205 of file audioengine.h.

Referenced by setDefaults().

Definition at line 207 of file audioengine.h.

Referenced by getFreeChannel(), init(), and setDefaults().

Definition at line 210 of file audioengine.h.

Referenced by assetCallback(), and startNextTransfer().

Definition at line 211 of file audioengine.h.

Referenced by startNextTransfer().

Definition at line 220 of file audioengine.h.

Referenced by getAudioData(), and shutdown().

LLAudioChannel* LLAudioEngine::mChannels[MAX_CHANNELS] [protected]

LLAudioBuffer* LLAudioEngine::mBuffers[MAX_BUFFERS] [protected]

Definition at line 226 of file audioengine.h.

Referenced by cleanupBuffer(), getFreeBuffer(), idle(), setDefaults(), and shutdown().

Definition at line 228 of file audioengine.h.

Referenced by getMasterGain(), setDefaults(), and setMasterGain().

Definition at line 233 of file audioengine.h.

Referenced by LLAudioEngine_FMOD::initWind(), and setDefaults().

Definition at line 235 of file audioengine.h.

Referenced by LLAudioEngine_FMOD::updateWind().


The documentation for this class was generated from the following files:

Generated on Fri May 16 08:39:19 2008 for SecondLife by  doxygen 1.5.5