summaryrefslogtreecommitdiff
path: root/indra/newview/llvieweraudio.h
diff options
context:
space:
mode:
authorJonathan Yap <none@none>2011-10-28 17:48:24 -0400
committerJonathan Yap <none@none>2011-10-28 17:48:24 -0400
commit4cdf3961253b49093bf3e2fceda0099cedef4295 (patch)
tree8854004b22e6a8dcd980d30d84bd94c96f67f2eb /indra/newview/llvieweraudio.h
parent1b173ed82b65c7bb5f5d5294847a721b64f8cf35 (diff)
STORM-591 As a music fan, I want audio to fade in gently so my immersion is increased
Co-written with Robin Cornelius
Diffstat (limited to 'indra/newview/llvieweraudio.h')
-rw-r--r--indra/newview/llvieweraudio.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/indra/newview/llvieweraudio.h b/indra/newview/llvieweraudio.h
index e5916285fb..316d7b32d2 100644
--- a/indra/newview/llvieweraudio.h
+++ b/indra/newview/llvieweraudio.h
@@ -27,6 +27,10 @@
#ifndef LL_VIEWERAUDIO_H
#define LL_VIEWERAUDIO_H
+#include "llframetimer.h"
+#include "llthread.h"
+#include "llsingleton.h"
+
// comment out to turn off wind
#define kAUDIO_ENABLE_WIND
//#define kAUDIO_ENABLE_WATER 1 // comment out to turn off water
@@ -38,4 +42,41 @@ void audio_update_volume(bool force_update = true);
void audio_update_listener();
void audio_update_wind(bool force_update = true);
+class LLViewerAudio : public LLSingleton<LLViewerAudio>
+{
+public:
+
+ enum EFadeState
+ {
+ FADE_IDLE,
+ FADE_IN,
+ FADE_OUT,
+ };
+
+ LLViewerAudio();
+ virtual ~LLViewerAudio();
+
+ void startInternetStreamWithAutoFade(std::string streamURI);
+ void stopInternetStreamWithAutoFade();
+
+ bool LLViewerAudio::onIdleUpdate();
+
+ EFadeState getFadeState() { return mFadeState; }
+ bool isDone() { return mDone; };
+ F32 getFadeVolume();
+
+private:
+
+ bool mDone;
+ F32 mFadeTime;
+ std::string mNextStreamURI;
+ EFadeState mFadeState;
+ LLFrameTimer stream_fade_timer;
+ bool mIdleListnerActive;
+
+ void registerIdleListener();
+ void deregisterIdleListener() { mIdleListnerActive = false; };
+ void startFading();
+};
+
#endif //LL_VIEWER_H