diff options
Diffstat (limited to 'linden/indra/llaudio/audioengine_fmod.h')
-rw-r--r-- | linden/indra/llaudio/audioengine_fmod.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/linden/indra/llaudio/audioengine_fmod.h b/linden/indra/llaudio/audioengine_fmod.h index 41177b6..132afb1 100644 --- a/linden/indra/llaudio/audioengine_fmod.h +++ b/linden/indra/llaudio/audioengine_fmod.h | |||
@@ -35,6 +35,7 @@ | |||
35 | 35 | ||
36 | #include "audioengine.h" | 36 | #include "audioengine.h" |
37 | #include "listener_fmod.h" | 37 | #include "listener_fmod.h" |
38 | #include "windgen.h" | ||
38 | 39 | ||
39 | #include "fmod.h" | 40 | #include "fmod.h" |
40 | 41 | ||
@@ -47,13 +48,11 @@ public: | |||
47 | virtual ~LLAudioEngine_FMOD(); | 48 | virtual ~LLAudioEngine_FMOD(); |
48 | 49 | ||
49 | // initialization/startup/shutdown | 50 | // initialization/startup/shutdown |
50 | virtual BOOL init(const S32 num_channels, void *user_data); | 51 | virtual bool init(const S32 num_channels, void *user_data); |
51 | virtual void allocateListener(); | 52 | virtual void allocateListener(); |
52 | 53 | ||
53 | virtual void shutdown(); | 54 | virtual void shutdown(); |
54 | 55 | ||
55 | virtual void idle(F32 max_decode_time = 0.f); | ||
56 | |||
57 | // Internet stream methods | 56 | // Internet stream methods |
58 | virtual void initInternetStream(); | 57 | virtual void initInternetStream(); |
59 | virtual void startInternetStream(const std::string& url); | 58 | virtual void startInternetStream(const std::string& url); |
@@ -61,15 +60,19 @@ public: | |||
61 | virtual void stopInternetStream(); | 60 | virtual void stopInternetStream(); |
62 | virtual void pauseInternetStream(int pause); | 61 | virtual void pauseInternetStream(int pause); |
63 | virtual int isInternetStreamPlaying(); | 62 | virtual int isInternetStreamPlaying(); |
64 | virtual void getInternetStreamInfo(char* artist, char* title); | ||
65 | virtual void setInternetStreamGain(F32 vol); | 63 | virtual void setInternetStreamGain(F32 vol); |
66 | virtual const std::string& getInternetStreamURL(); | ||
67 | 64 | ||
68 | /*virtual*/ void initWind(); | 65 | /*virtual*/ void initWind(); |
69 | /*virtual*/ void cleanupWind(); | 66 | /*virtual*/ void cleanupWind(); |
70 | 67 | ||
71 | /*virtual*/void updateWind(LLVector3 direction, F32 camera_height_above_water); | 68 | /*virtual*/void updateWind(LLVector3 direction, F32 camera_height_above_water); |
72 | 69 | ||
70 | #if LL_DARWIN | ||
71 | typedef S32 MIXBUFFERFORMAT; | ||
72 | #else | ||
73 | typedef S16 MIXBUFFERFORMAT; | ||
74 | #endif | ||
75 | |||
73 | protected: | 76 | protected: |
74 | /*virtual*/ LLAudioBuffer *createBuffer(); // Get a free buffer, or flush an existing one if you have to. | 77 | /*virtual*/ LLAudioBuffer *createBuffer(); // Get a free buffer, or flush an existing one if you have to. |
75 | /*virtual*/ LLAudioChannel *createChannel(); // Create a new audio channel. | 78 | /*virtual*/ LLAudioChannel *createChannel(); // Create a new audio channel. |
@@ -79,7 +82,6 @@ protected: | |||
79 | static signed char F_CALLBACKAPI callbackMetaData(char* name, char* value, void* userdata); | 82 | static signed char F_CALLBACKAPI callbackMetaData(char* name, char* value, void* userdata); |
80 | 83 | ||
81 | LLAudioStreamFMOD *mCurrentInternetStreamp; | 84 | LLAudioStreamFMOD *mCurrentInternetStreamp; |
82 | std::string mInternetStreamURL; | ||
83 | int mInternetStreamChannel; | 85 | int mInternetStreamChannel; |
84 | 86 | ||
85 | std::list<LLAudioStreamFMOD *> mDeadStreams; | 87 | std::list<LLAudioStreamFMOD *> mDeadStreams; |
@@ -88,11 +90,12 @@ protected: | |||
88 | //F32 mMaxDistance[MAX_BUFFERS]; | 90 | //F32 mMaxDistance[MAX_BUFFERS]; |
89 | 91 | ||
90 | S32 mFadeIn; | 92 | S32 mFadeIn; |
91 | BOOL mInited; | 93 | bool mInited; |
92 | 94 | ||
93 | // On Windows, userdata is the HWND of the application window. | 95 | // On Windows, userdata is the HWND of the application window. |
94 | void* mUserData; | 96 | void* mUserData; |
95 | 97 | ||
98 | LLWindGen<MIXBUFFERFORMAT> *mWindGen; | ||
96 | }; | 99 | }; |
97 | 100 | ||
98 | 101 | ||
@@ -106,9 +109,9 @@ protected: | |||
106 | /*virtual*/ void play(); | 109 | /*virtual*/ void play(); |
107 | /*virtual*/ void playSynced(LLAudioChannel *channelp); | 110 | /*virtual*/ void playSynced(LLAudioChannel *channelp); |
108 | /*virtual*/ void cleanup(); | 111 | /*virtual*/ void cleanup(); |
109 | /*virtual*/ BOOL isPlaying(); | 112 | /*virtual*/ bool isPlaying(); |
110 | 113 | ||
111 | /*virtual*/ BOOL updateBuffer(); | 114 | /*virtual*/ bool updateBuffer(); |
112 | /*virtual*/ void update3DPosition(); | 115 | /*virtual*/ void update3DPosition(); |
113 | /*virtual*/ void updateLoop(); | 116 | /*virtual*/ void updateLoop(); |
114 | 117 | ||
@@ -124,11 +127,11 @@ public: | |||
124 | LLAudioBufferFMOD(); | 127 | LLAudioBufferFMOD(); |
125 | virtual ~LLAudioBufferFMOD(); | 128 | virtual ~LLAudioBufferFMOD(); |
126 | 129 | ||
127 | /*virtual*/ BOOL loadWAV(const std::string& filename); | 130 | /*virtual*/ bool loadWAV(const std::string& filename); |
128 | /*virtual*/ U32 getLength(); | 131 | /*virtual*/ U32 getLength(); |
129 | friend class LLAudioChannelFMOD; | 132 | friend class LLAudioChannelFMOD; |
130 | 133 | ||
131 | void set3DMode(BOOL use3d); | 134 | void set3DMode(bool use3d); |
132 | protected: | 135 | protected: |
133 | FSOUND_SAMPLE *getSample() { return mSamplep; } | 136 | FSOUND_SAMPLE *getSample() { return mSamplep; } |
134 | protected: | 137 | protected: |
@@ -140,15 +143,15 @@ class LLAudioStreamFMOD | |||
140 | public: | 143 | public: |
141 | LLAudioStreamFMOD(const std::string& url); | 144 | LLAudioStreamFMOD(const std::string& url); |
142 | int startStream(); | 145 | int startStream(); |
143 | BOOL stopStream(); // Returns true if the stream was successfully stopped. | 146 | bool stopStream(); // Returns true if the stream was successfully stopped. |
144 | BOOL ready(); | 147 | bool ready(); |
145 | 148 | ||
146 | const std::string& getURL() { return mInternetStreamURL; } | 149 | const std::string& getURL() { return mInternetStreamURL; } |
147 | 150 | ||
148 | int getOpenState(); | 151 | int getOpenState(); |
149 | protected: | 152 | protected: |
150 | FSOUND_STREAM* mInternetStream; | 153 | FSOUND_STREAM* mInternetStream; |
151 | BOOL mReady; | 154 | bool mReady; |
152 | 155 | ||
153 | std::string mInternetStreamURL; | 156 | std::string mInternetStreamURL; |
154 | }; | 157 | }; |