diff options
author | Jacek Antonelli | 2008-12-06 14:03:10 -0600 |
---|---|---|
committer | Jacek Antonelli | 2008-12-06 14:03:10 -0600 |
commit | b29b13ad98c5c79fd63bae10b4b099a03fa9dc35 (patch) | |
tree | ffc14fd638344c84287d1c4a72d2de5f765bf3c8 /linden/indra/llaudio/audioengine.h | |
parent | openal on windows branch (diff) | |
download | meta-impy-b29b13ad98c5c79fd63bae10b4b099a03fa9dc35.zip meta-impy-b29b13ad98c5c79fd63bae10b4b099a03fa9dc35.tar.gz meta-impy-b29b13ad98c5c79fd63bae10b4b099a03fa9dc35.tar.bz2 meta-impy-b29b13ad98c5c79fd63bae10b4b099a03fa9dc35.tar.xz |
Updated audio engine to LL's openal branch r1532.
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llaudio/audioengine.h | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/linden/indra/llaudio/audioengine.h b/linden/indra/llaudio/audioengine.h index 937a8e1..aff7759 100644 --- a/linden/indra/llaudio/audioengine.h +++ b/linden/indra/llaudio/audioengine.h | |||
@@ -69,6 +69,7 @@ class LLVFS; | |||
69 | class LLAudioSource; | 69 | class LLAudioSource; |
70 | class LLAudioData; | 70 | class LLAudioData; |
71 | class LLAudioChannel; | 71 | class LLAudioChannel; |
72 | class LLAudioChannelOpenAL; | ||
72 | class LLAudioBuffer; | 73 | class LLAudioBuffer; |
73 | 74 | ||
74 | 75 | ||
@@ -79,8 +80,10 @@ class LLAudioBuffer; | |||
79 | 80 | ||
80 | class LLAudioEngine | 81 | class LLAudioEngine |
81 | { | 82 | { |
83 | friend class LLAudioChannelOpenAL; // bleh. channel needs some listener methods. | ||
84 | |||
82 | public: | 85 | public: |
83 | enum LLAudioType | 86 | typedef enum LLAudioType |
84 | { | 87 | { |
85 | AUDIO_TYPE_NONE = 0, | 88 | AUDIO_TYPE_NONE = 0, |
86 | AUDIO_TYPE_SFX = 1, | 89 | AUDIO_TYPE_SFX = 1, |
@@ -93,9 +96,7 @@ public: | |||
93 | virtual ~LLAudioEngine(); | 96 | virtual ~LLAudioEngine(); |
94 | 97 | ||
95 | // initialization/startup/shutdown | 98 | // initialization/startup/shutdown |
96 | //virtual BOOL init(); | 99 | virtual bool init(const S32 num_channels, void *userdata); |
97 | |||
98 | virtual BOOL init(const S32 num_channels); | ||
99 | virtual std::string getDriverName(bool verbose) = 0; | 100 | virtual std::string getDriverName(bool verbose) = 0; |
100 | virtual void shutdown(); | 101 | virtual void shutdown(); |
101 | 102 | ||
@@ -140,7 +141,7 @@ public: | |||
140 | void triggerSound(const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain, | 141 | void triggerSound(const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain, |
141 | const S32 type = LLAudioEngine::AUDIO_TYPE_NONE, | 142 | const S32 type = LLAudioEngine::AUDIO_TYPE_NONE, |
142 | const LLVector3d &pos_global = LLVector3d::zero); | 143 | const LLVector3d &pos_global = LLVector3d::zero); |
143 | BOOL preloadSound(const LLUUID &id); | 144 | bool preloadSound(const LLUUID &id); |
144 | 145 | ||
145 | void addAudioSource(LLAudioSource *asp); | 146 | void addAudioSource(LLAudioSource *asp); |
146 | void cleanupAudioSource(LLAudioSource *asp); | 147 | void cleanupAudioSource(LLAudioSource *asp); |
@@ -149,15 +150,16 @@ public: | |||
149 | LLAudioData *getAudioData(const LLUUID &audio_uuid); | 150 | LLAudioData *getAudioData(const LLUUID &audio_uuid); |
150 | 151 | ||
151 | 152 | ||
152 | virtual void startInternetStream(const std::string& url) = 0; | 153 | // Internet stream methods |
153 | virtual void stopInternetStream() = 0; | 154 | virtual void startInternetStream(const std::string& url); |
154 | virtual void pauseInternetStream(int pause) = 0; | 155 | virtual void stopInternetStream(); |
155 | virtual int isInternetStreamPlaying() = 0; | 156 | virtual void pauseInternetStream(int pause); |
156 | virtual void getInternetStreamInfo(char* artist, char* title) { artist[0] = 0; title[0] = 0; } | 157 | virtual void updateInternetStream(); |
158 | virtual int isInternetStreamPlaying(); | ||
159 | virtual void getInternetStreamInfo(char* artist, char* title); | ||
157 | // use a value from 0.0 to 1.0, inclusive | 160 | // use a value from 0.0 to 1.0, inclusive |
158 | virtual void setInternetStreamGain(F32 vol) { mInternetStreamGain = vol; } | 161 | virtual void setInternetStreamGain(F32 vol); |
159 | virtual const std::string& getInternetStreamURL() { return LLStringUtil::null; } | 162 | virtual const std::string& getInternetStreamURL(); |
160 | virtual void InitStreamer() = 0; | ||
161 | 163 | ||
162 | // For debugging usage | 164 | // For debugging usage |
163 | virtual LLVector3 getListenerPos(); | 165 | virtual LLVector3 getListenerPos(); |
@@ -193,11 +195,6 @@ protected: | |||
193 | virtual void allocateListener() = 0; | 195 | virtual void allocateListener() = 0; |
194 | 196 | ||
195 | 197 | ||
196 | // Internet stream methods | ||
197 | virtual void initInternetStream() {} | ||
198 | virtual void updateInternetStream() {} | ||
199 | |||
200 | |||
201 | // listener methods | 198 | // listener methods |
202 | virtual void setListenerPos(LLVector3 vec); | 199 | virtual void setListenerPos(LLVector3 vec); |
203 | virtual void setListenerVelocity(LLVector3 vec); | 200 | virtual void setListenerVelocity(LLVector3 vec); |
@@ -212,7 +209,8 @@ protected: | |||
212 | protected: | 209 | protected: |
213 | LLListener *mListenerp; | 210 | LLListener *mListenerp; |
214 | 211 | ||
215 | BOOL mMuted; | 212 | bool mMuted; |
213 | void* mUserData; | ||
216 | 214 | ||
217 | S32 mLastStatus; | 215 | S32 mLastStatus; |
218 | 216 | ||
@@ -242,6 +240,7 @@ protected: | |||
242 | 240 | ||
243 | // Hack! Internet streams are treated differently from other sources! | 241 | // Hack! Internet streams are treated differently from other sources! |
244 | F32 mInternetStreamGain; | 242 | F32 mInternetStreamGain; |
243 | std::string mInternetStreamURL; | ||
245 | 244 | ||
246 | F32 mNextWindUpdate; | 245 | F32 mNextWindUpdate; |
247 | 246 | ||
@@ -249,6 +248,7 @@ protected: | |||
249 | 248 | ||
250 | private: | 249 | private: |
251 | void setDefaults(); | 250 | void setDefaults(); |
251 | LLMediaBase *mInternetStreamMedia; | ||
252 | }; | 252 | }; |
253 | 253 | ||
254 | 254 | ||
@@ -264,7 +264,7 @@ class LLAudioSource | |||
264 | public: | 264 | public: |
265 | // owner_id is the id of the agent responsible for making this sound | 265 | // owner_id is the id of the agent responsible for making this sound |
266 | // play, for example, the owner of the object currently playing it | 266 | // play, for example, the owner of the object currently playing it |
267 | LLAudioSource(const LLUUID &id, const LLUUID& owner_id, const F32 gain); | 267 | LLAudioSource(const LLUUID &id, const LLUUID& owner_id, const F32 gain, const S32 type = LLAudioEngine::AUDIO_TYPE_NONE); |
268 | virtual ~LLAudioSource(); | 268 | virtual ~LLAudioSource(); |
269 | 269 | ||
270 | virtual void update(); // Update this audio source | 270 | virtual void update(); // Update this audio source |
@@ -326,12 +326,12 @@ protected: | |||
326 | LLUUID mOwnerID; // owner of the object playing the sound | 326 | LLUUID mOwnerID; // owner of the object playing the sound |
327 | F32 mPriority; | 327 | F32 mPriority; |
328 | F32 mGain; | 328 | F32 mGain; |
329 | BOOL mAmbient; | 329 | bool mAmbient; |
330 | BOOL mLoop; | 330 | bool mLoop; |
331 | BOOL mSyncMaster; | 331 | bool mSyncMaster; |
332 | BOOL mSyncSlave; | 332 | bool mSyncSlave; |
333 | BOOL mQueueSounds; | 333 | bool mQueueSounds; |
334 | BOOL mPlayedOnce; | 334 | bool mPlayedOnce; |
335 | S32 mType; | 335 | S32 mType; |
336 | LLVector3d mPositionGlobal; | 336 | LLVector3d mPositionGlobal; |
337 | LLVector3 mVelocity; | 337 | LLVector3 mVelocity; |
@@ -420,8 +420,8 @@ protected: | |||
420 | protected: | 420 | protected: |
421 | LLAudioSource *mCurrentSourcep; | 421 | LLAudioSource *mCurrentSourcep; |
422 | LLAudioBuffer *mCurrentBufferp; | 422 | LLAudioBuffer *mCurrentBufferp; |
423 | BOOL mLoopedThisFrame; | 423 | bool mLoopedThisFrame; |
424 | BOOL mWaiting; // Waiting for sync. | 424 | bool mWaiting; // Waiting for sync. |
425 | F32 mSecondaryGain; | 425 | F32 mSecondaryGain; |
426 | }; | 426 | }; |
427 | 427 | ||