aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llaudio/audioengine.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llaudio/audioengine.h')
-rw-r--r--linden/indra/llaudio/audioengine.h75
1 files changed, 51 insertions, 24 deletions
diff --git a/linden/indra/llaudio/audioengine.h b/linden/indra/llaudio/audioengine.h
index 94134f5..937a8e1 100644
--- a/linden/indra/llaudio/audioengine.h
+++ b/linden/indra/llaudio/audioengine.h
@@ -80,11 +80,23 @@ class LLAudioBuffer;
80class LLAudioEngine 80class LLAudioEngine
81{ 81{
82public: 82public:
83 enum LLAudioType
84 {
85 AUDIO_TYPE_NONE = 0,
86 AUDIO_TYPE_SFX = 1,
87 AUDIO_TYPE_UI = 2,
88 AUDIO_TYPE_AMBIENT = 3,
89 AUDIO_TYPE_COUNT = 4 // last
90 };
91
83 LLAudioEngine(); 92 LLAudioEngine();
84 virtual ~LLAudioEngine(); 93 virtual ~LLAudioEngine();
85 94
86 // initialization/startup/shutdown 95 // initialization/startup/shutdown
87 virtual bool init(const S32 num_channels, void *userdata); 96 //virtual BOOL init();
97
98 virtual BOOL init(const S32 num_channels);
99 virtual std::string getDriverName(bool verbose) = 0;
88 virtual void shutdown(); 100 virtual void shutdown();
89 101
90 // Used by the mechanics of the engine 102 // Used by the mechanics of the engine
@@ -109,6 +121,9 @@ public:
109 F32 getMasterGain(); 121 F32 getMasterGain();
110 void setMasterGain(F32 gain); 122 void setMasterGain(F32 gain);
111 123
124 F32 getSecondaryGain(S32 type);
125 void setSecondaryGain(S32 type, F32 gain);
126
112 F32 getInternetStreamGain(); 127 F32 getInternetStreamGain();
113 128
114 virtual void setDopplerFactor(F32 factor); 129 virtual void setDopplerFactor(F32 factor);
@@ -122,8 +137,10 @@ public:
122 137
123 // Methods actually related to setting up and removing sounds 138 // Methods actually related to setting up and removing sounds
124 // Owner ID is the owner of the object making the request 139 // 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); 140 void triggerSound(const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain,
126 bool preloadSound(const LLUUID &id); 141 const S32 type = LLAudioEngine::AUDIO_TYPE_NONE,
142 const LLVector3d &pos_global = LLVector3d::zero);
143 BOOL preloadSound(const LLUUID &id);
127 144
128 void addAudioSource(LLAudioSource *asp); 145 void addAudioSource(LLAudioSource *asp);
129 void cleanupAudioSource(LLAudioSource *asp); 146 void cleanupAudioSource(LLAudioSource *asp);
@@ -132,16 +149,15 @@ public:
132 LLAudioData *getAudioData(const LLUUID &audio_uuid); 149 LLAudioData *getAudioData(const LLUUID &audio_uuid);
133 150
134 151
135 // Internet stream methods 152 virtual void startInternetStream(const std::string& url) = 0;
136 virtual void startInternetStream(const std::string& url); 153 virtual void stopInternetStream() = 0;
137 virtual void stopInternetStream(); 154 virtual void pauseInternetStream(int pause) = 0;
138 virtual void pauseInternetStream(int pause); 155 virtual int isInternetStreamPlaying() = 0;
139 virtual void updateInternetStream(); 156 virtual void getInternetStreamInfo(char* artist, char* title) { artist[0] = 0; title[0] = 0; }
140 virtual int isInternetStreamPlaying();
141 virtual void getInternetStreamInfo(char* artist, char* title);
142 // use a value from 0.0 to 1.0, inclusive 157 // use a value from 0.0 to 1.0, inclusive
143 virtual void setInternetStreamGain(F32 vol); 158 virtual void setInternetStreamGain(F32 vol) { mInternetStreamGain = vol; }
144 virtual const std::string& getInternetStreamURL(); 159 virtual const std::string& getInternetStreamURL() { return LLStringUtil::null; }
160 virtual void InitStreamer() = 0;
145 161
146 // For debugging usage 162 // For debugging usage
147 virtual LLVector3 getListenerPos(); 163 virtual LLVector3 getListenerPos();
@@ -177,6 +193,11 @@ protected:
177 virtual void allocateListener() = 0; 193 virtual void allocateListener() = 0;
178 194
179 195
196 // Internet stream methods
197 virtual void initInternetStream() {}
198 virtual void updateInternetStream() {}
199
200
180 // listener methods 201 // listener methods
181 virtual void setListenerPos(LLVector3 vec); 202 virtual void setListenerPos(LLVector3 vec);
182 virtual void setListenerVelocity(LLVector3 vec); 203 virtual void setListenerVelocity(LLVector3 vec);
@@ -191,8 +212,7 @@ protected:
191protected: 212protected:
192 LLListener *mListenerp; 213 LLListener *mListenerp;
193 214
194 bool mMuted; 215 BOOL mMuted;
195 void* mUserData;
196 216
197 S32 mLastStatus; 217 S32 mLastStatus;
198 218
@@ -218,10 +238,10 @@ protected:
218 LLAudioBuffer *mBuffers[MAX_BUFFERS]; 238 LLAudioBuffer *mBuffers[MAX_BUFFERS];
219 239
220 F32 mMasterGain; 240 F32 mMasterGain;
241 F32 mSecondaryGain[AUDIO_TYPE_COUNT];
221 242
222 // Hack! Internet streams are treated differently from other sources! 243 // Hack! Internet streams are treated differently from other sources!
223 F32 mInternetStreamGain; 244 F32 mInternetStreamGain;
224 std::string mInternetStreamURL;
225 245
226 F32 mNextWindUpdate; 246 F32 mNextWindUpdate;
227 247
@@ -229,7 +249,6 @@ protected:
229 249
230private: 250private:
231 void setDefaults(); 251 void setDefaults();
232 LLMediaBase *mInternetStreamMedia;
233}; 252};
234 253
235 254
@@ -272,6 +291,9 @@ public:
272 291
273 void setPlayedOnce(const bool played_once) { mPlayedOnce = played_once; } 292 void setPlayedOnce(const bool played_once) { mPlayedOnce = played_once; }
274 293
294 void setType(S32 type) { mType = type; }
295 S32 getType() { return mType; }
296
275 void setPositionGlobal(const LLVector3d &position_global) { mPositionGlobal = position_global; } 297 void setPositionGlobal(const LLVector3d &position_global) { mPositionGlobal = position_global; }
276 LLVector3d getPositionGlobal() const { return mPositionGlobal; } 298 LLVector3d getPositionGlobal() const { return mPositionGlobal; }
277 LLVector3 getVelocity() const { return mVelocity; } 299 LLVector3 getVelocity() const { return mVelocity; }
@@ -304,12 +326,13 @@ protected:
304 LLUUID mOwnerID; // owner of the object playing the sound 326 LLUUID mOwnerID; // owner of the object playing the sound
305 F32 mPriority; 327 F32 mPriority;
306 F32 mGain; 328 F32 mGain;
307 bool mAmbient; 329 BOOL mAmbient;
308 bool mLoop; 330 BOOL mLoop;
309 bool mSyncMaster; 331 BOOL mSyncMaster;
310 bool mSyncSlave; 332 BOOL mSyncSlave;
311 bool mQueueSounds; 333 BOOL mQueueSounds;
312 bool mPlayedOnce; 334 BOOL mPlayedOnce;
335 S32 mType;
313 LLVector3d mPositionGlobal; 336 LLVector3d mPositionGlobal;
314 LLVector3 mVelocity; 337 LLVector3 mVelocity;
315 338
@@ -378,6 +401,9 @@ public:
378 virtual void setSource(LLAudioSource *sourcep); 401 virtual void setSource(LLAudioSource *sourcep);
379 LLAudioSource *getSource() const { return mCurrentSourcep; } 402 LLAudioSource *getSource() const { return mCurrentSourcep; }
380 403
404 void setSecondaryGain(F32 gain) { mSecondaryGain = gain; }
405 F32 getSecondaryGain() { return mSecondaryGain; }
406
381 friend class LLAudioEngine; 407 friend class LLAudioEngine;
382 friend class LLAudioSource; 408 friend class LLAudioSource;
383protected: 409protected:
@@ -394,8 +420,9 @@ protected:
394protected: 420protected:
395 LLAudioSource *mCurrentSourcep; 421 LLAudioSource *mCurrentSourcep;
396 LLAudioBuffer *mCurrentBufferp; 422 LLAudioBuffer *mCurrentBufferp;
397 bool mLoopedThisFrame; 423 BOOL mLoopedThisFrame;
398 bool mWaiting; // Waiting for sync. 424 BOOL mWaiting; // Waiting for sync.
425 F32 mSecondaryGain;
399}; 426};
400 427
401 428