aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llaudio/audioengine.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-12-01 17:39:58 -0600
committerJacek Antonelli2008-12-01 17:40:06 -0600
commit7abecb48babe6a6f09bf6692ba55076546cfced9 (patch)
tree8d18a88513fb97adf32c10aae78f4be1984942db /linden/indra/llaudio/audioengine.h
parentSecond Life viewer sources 1.21.6 (diff)
downloadmeta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.zip
meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.gz
meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.bz2
meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.xz
Second Life viewer sources 1.22.0-RC
Diffstat (limited to 'linden/indra/llaudio/audioengine.h')
-rw-r--r--linden/indra/llaudio/audioengine.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/linden/indra/llaudio/audioengine.h b/linden/indra/llaudio/audioengine.h
index e38413f..b8153a3 100644
--- a/linden/indra/llaudio/audioengine.h
+++ b/linden/indra/llaudio/audioengine.h
@@ -78,6 +78,15 @@ class LLAudioBuffer;
78class LLAudioEngine 78class LLAudioEngine
79{ 79{
80public: 80public:
81 enum LLAudioType
82 {
83 AUDIO_TYPE_NONE = 0,
84 AUDIO_TYPE_SFX = 1,
85 AUDIO_TYPE_UI = 2,
86 AUDIO_TYPE_AMBIENT = 3,
87 AUDIO_TYPE_COUNT = 4 // last
88 };
89
81 LLAudioEngine(); 90 LLAudioEngine();
82 virtual ~LLAudioEngine(); 91 virtual ~LLAudioEngine();
83 92
@@ -109,6 +118,9 @@ public:
109 F32 getMasterGain(); 118 F32 getMasterGain();
110 void setMasterGain(F32 gain); 119 void setMasterGain(F32 gain);
111 120
121 F32 getSecondaryGain(S32 type);
122 void setSecondaryGain(S32 type, F32 gain);
123
112 F32 getInternetStreamGain(); 124 F32 getInternetStreamGain();
113 125
114 virtual void setDopplerFactor(F32 factor); 126 virtual void setDopplerFactor(F32 factor);
@@ -122,7 +134,9 @@ public:
122 134
123 // Methods actually related to setting up and removing sounds 135 // Methods actually related to setting up and removing sounds
124 // Owner ID is the owner of the object making the request 136 // Owner ID is the owner of the object making the request
125 void triggerSound(const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain, const LLVector3d &pos_global = LLVector3d::zero); 137 void triggerSound(const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain,
138 const S32 type = LLAudioEngine::AUDIO_TYPE_NONE,
139 const LLVector3d &pos_global = LLVector3d::zero);
126 BOOL preloadSound(const LLUUID &id); 140 BOOL preloadSound(const LLUUID &id);
127 141
128 void addAudioSource(LLAudioSource *asp); 142 void addAudioSource(LLAudioSource *asp);
@@ -222,6 +236,7 @@ protected:
222 LLAudioBuffer *mBuffers[MAX_BUFFERS]; 236 LLAudioBuffer *mBuffers[MAX_BUFFERS];
223 237
224 F32 mMasterGain; 238 F32 mMasterGain;
239 F32 mSecondaryGain[AUDIO_TYPE_COUNT];
225 240
226 // Hack! Internet streams are treated differently from other sources! 241 // Hack! Internet streams are treated differently from other sources!
227 F32 mInternetStreamGain; 242 F32 mInternetStreamGain;
@@ -247,7 +262,7 @@ class LLAudioSource
247public: 262public:
248 // owner_id is the id of the agent responsible for making this sound 263 // owner_id is the id of the agent responsible for making this sound
249 // play, for example, the owner of the object currently playing it 264 // play, for example, the owner of the object currently playing it
250 LLAudioSource(const LLUUID &id, const LLUUID& owner_id, const F32 gain); 265 LLAudioSource(const LLUUID &id, const LLUUID& owner_id, const F32 gain, const S32 type = LLAudioEngine::AUDIO_TYPE_NONE);
251 virtual ~LLAudioSource(); 266 virtual ~LLAudioSource();
252 267
253 virtual void update(); // Update this audio source 268 virtual void update(); // Update this audio source
@@ -274,6 +289,9 @@ public:
274 289
275 void setPlayedOnce(const BOOL played_once) { mPlayedOnce = played_once; } 290 void setPlayedOnce(const BOOL played_once) { mPlayedOnce = played_once; }
276 291
292 void setType(S32 type) { mType = type; }
293 S32 getType() { return mType; }
294
277 void setPositionGlobal(const LLVector3d &position_global) { mPositionGlobal = position_global; } 295 void setPositionGlobal(const LLVector3d &position_global) { mPositionGlobal = position_global; }
278 LLVector3d getPositionGlobal() const { return mPositionGlobal; } 296 LLVector3d getPositionGlobal() const { return mPositionGlobal; }
279 LLVector3 getVelocity() const { return mVelocity; } 297 LLVector3 getVelocity() const { return mVelocity; }
@@ -312,6 +330,7 @@ protected:
312 BOOL mSyncSlave; 330 BOOL mSyncSlave;
313 BOOL mQueueSounds; 331 BOOL mQueueSounds;
314 BOOL mPlayedOnce; 332 BOOL mPlayedOnce;
333 S32 mType;
315 LLVector3d mPositionGlobal; 334 LLVector3d mPositionGlobal;
316 LLVector3 mVelocity; 335 LLVector3 mVelocity;
317 336
@@ -380,6 +399,9 @@ public:
380 virtual void setSource(LLAudioSource *sourcep); 399 virtual void setSource(LLAudioSource *sourcep);
381 LLAudioSource *getSource() const { return mCurrentSourcep; } 400 LLAudioSource *getSource() const { return mCurrentSourcep; }
382 401
402 void setSecondaryGain(F32 gain) { mSecondaryGain = gain; }
403 F32 getSecondaryGain() { return mSecondaryGain; }
404
383 friend class LLAudioEngine; 405 friend class LLAudioEngine;
384 friend class LLAudioSource; 406 friend class LLAudioSource;
385protected: 407protected:
@@ -398,6 +420,7 @@ protected:
398 LLAudioBuffer *mCurrentBufferp; 420 LLAudioBuffer *mCurrentBufferp;
399 BOOL mLoopedThisFrame; 421 BOOL mLoopedThisFrame;
400 BOOL mWaiting; // Waiting for sync. 422 BOOL mWaiting; // Waiting for sync.
423 F32 mSecondaryGain;
401}; 424};
402 425
403 426