diff options
Diffstat (limited to 'linden/indra/llaudio/audioengine_openal.h')
-rw-r--r-- | linden/indra/llaudio/audioengine_openal.h | 62 |
1 files changed, 50 insertions, 12 deletions
diff --git a/linden/indra/llaudio/audioengine_openal.h b/linden/indra/llaudio/audioengine_openal.h index 6289f99..5d5c7d8 100644 --- a/linden/indra/llaudio/audioengine_openal.h +++ b/linden/indra/llaudio/audioengine_openal.h | |||
@@ -34,9 +34,13 @@ | |||
34 | #ifndef LL_AUDIOENGINE_OpenAL_H | 34 | #ifndef LL_AUDIOENGINE_OpenAL_H |
35 | #define LL_AUDIOENGINE_OpenAL_H | 35 | #define LL_AUDIOENGINE_OpenAL_H |
36 | 36 | ||
37 | #include <string> | ||
38 | |||
37 | #include "audioengine.h" | 39 | #include "audioengine.h" |
38 | #include "listener_openal.h" | 40 | #include "listener_openal.h" |
39 | #include "windgen.h" | 41 | #include "llmediamanager.h" |
42 | #include "llmediaimplgstreamer.h" | ||
43 | #include "llrand.h" | ||
40 | 44 | ||
41 | class LLAudioEngine_OpenAL : public LLAudioEngine | 45 | class LLAudioEngine_OpenAL : public LLAudioEngine |
42 | { | 46 | { |
@@ -44,23 +48,58 @@ class LLAudioEngine_OpenAL : public LLAudioEngine | |||
44 | LLAudioEngine_OpenAL(); | 48 | LLAudioEngine_OpenAL(); |
45 | virtual ~LLAudioEngine_OpenAL(); | 49 | virtual ~LLAudioEngine_OpenAL(); |
46 | 50 | ||
47 | virtual bool init(const S32 num_channels, void *user_data); | 51 | virtual BOOL init(const S32 num_channels); |
52 | virtual std::string getDriverName(bool verbose); | ||
48 | virtual void allocateListener(); | 53 | virtual void allocateListener(); |
49 | 54 | ||
50 | virtual void shutdown(); | 55 | virtual void shutdown(); |
51 | 56 | ||
57 | virtual void idle(F32 max_decode_time = 0.f); | ||
58 | |||
52 | void setInternalGain(F32 gain); | 59 | void setInternalGain(F32 gain); |
53 | 60 | ||
54 | LLAudioBuffer* createBuffer(); | 61 | LLAudioBuffer* createBuffer(); |
55 | LLAudioChannel* createChannel(); | 62 | LLAudioChannel* createChannel(); |
56 | 63 | ||
57 | /*virtual*/ void initWind(); | 64 | // Internet stream methods |
58 | /*virtual*/ void cleanupWind(); | 65 | virtual void initInternetStream(); |
59 | /*virtual*/ void updateWind(LLVector3 direction, F32 camera_altitude); | 66 | virtual void startInternetStream(const std::string& url_cstr); |
60 | 67 | virtual void stopInternetStream(); | |
61 | private: | 68 | virtual void updateInternetStream(); |
69 | virtual void pauseInternetStream(int pause); | ||
70 | virtual int isInternetStreamPlaying(); | ||
71 | virtual void getInternetStreamInfo(char* artist, char* title); | ||
72 | virtual void setInternetStreamGain(F32 vol); | ||
73 | virtual const std::string& getInternetStreamURL(); | ||
74 | virtual void InitStreamer(); | ||
75 | |||
76 | void checkALError(); | ||
77 | |||
78 | void initWind(); | ||
79 | void cleanupWind(); | ||
80 | void updateWind(LLVector3 direction, F32 camera_altitude); | ||
81 | |||
82 | protected: | ||
83 | static const S32 mNumWindBuffers=20; | ||
84 | static const S32 mSampleRate=44100; | ||
85 | static const S32 mBytesPerSample=4; | ||
86 | static const S32 mWindDataSize=8820; //44100 * 0.200 * 2 channels * 2 bytes per sample | ||
87 | |||
88 | BOOL mFirstWind; | ||
89 | ALuint mWindBuffers[mNumWindBuffers]; | ||
90 | ALuint mWindSource; | ||
91 | |||
92 | F32 mTargetGain; | ||
93 | F32 mTargetFreq; | ||
94 | F32 mTargetPanGainR; | ||
95 | S16 mWindData[mWindDataSize]; | ||
96 | |||
97 | std::string mInternetStreamURL; | ||
62 | void * windDSP(void *newbuffer, int length); | 98 | void * windDSP(void *newbuffer, int length); |
63 | LLWindGen<S16> *mWindGen; | 99 | #if LL_GSTREAMER_ENABLED |
100 | LLMediaManagerData * mMedia_data; | ||
101 | LLMediaImplGStreamer * m_streamer; | ||
102 | #endif | ||
64 | }; | 103 | }; |
65 | 104 | ||
66 | class LLAudioChannelOpenAL : public LLAudioChannel | 105 | class LLAudioChannelOpenAL : public LLAudioChannel |
@@ -78,7 +117,7 @@ class LLAudioChannelOpenAL : public LLAudioChannel | |||
78 | void update3DPosition(); | 117 | void update3DPosition(); |
79 | void updateLoop(){}; | 118 | void updateLoop(){}; |
80 | 119 | ||
81 | ALuint mALSource; | 120 | ALuint ALSource; |
82 | }; | 121 | }; |
83 | 122 | ||
84 | class LLAudioBufferOpenAL : public LLAudioBuffer{ | 123 | class LLAudioBufferOpenAL : public LLAudioBuffer{ |
@@ -92,9 +131,8 @@ class LLAudioBufferOpenAL : public LLAudioBuffer{ | |||
92 | friend class LLAudioChannelOpenAL; | 131 | friend class LLAudioChannelOpenAL; |
93 | protected: | 132 | protected: |
94 | void cleanup(); | 133 | void cleanup(); |
95 | ALuint getBuffer() {return mALBuffer;} | 134 | ALuint getBuffer(){return ALBuffer;} |
96 | 135 | ALuint ALBuffer; | |
97 | ALuint mALBuffer; | ||
98 | }; | 136 | }; |
99 | 137 | ||
100 | #endif | 138 | #endif |