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