diff options
Diffstat (limited to 'indra/llaudio/llaudioengine.h')
-rwxr-xr-x[-rw-r--r--] | indra/llaudio/llaudioengine.h | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h index 30d2490635..f1e1b4e308 100644..100755 --- a/indra/llaudio/llaudioengine.h +++ b/indra/llaudio/llaudioengine.h @@ -37,11 +37,11 @@ #include "lluuid.h" #include "llframetimer.h" #include "llassettype.h" +#include "llextendedstatus.h" #include "lllistener.h" const F32 LL_WIND_UPDATE_INTERVAL = 0.1f; -const F32 LL_ROLLOFF_MULTIPLIER_UNDER_WATER = 5.f; // How much sounds are weaker under water const F32 LL_WIND_UNDERWATER_CENTER_FREQ = 20.f; const F32 ATTACHED_OBJECT_TIMEOUT = 5.0f; @@ -65,6 +65,7 @@ class LLAudioChannel; class LLAudioChannelOpenAL; class LLAudioBuffer; class LLStreamingAudioInterface; +struct SoundData; // @@ -87,7 +88,7 @@ public: enum LLAudioPlayState { - // isInternetStreamPlaying() returns an *int*, with + // isInternetStreamPlaying() returns an *S32*, with // 0 = stopped, 1 = playing, 2 = paused. AUDIO_STOPPED = 0, AUDIO_PLAYING = 1, @@ -143,6 +144,8 @@ public: void triggerSound(const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain, const S32 type = LLAudioEngine::AUDIO_TYPE_NONE, const LLVector3d &pos_global = LLVector3d::zero); + void triggerSound(SoundData& soundData); + bool preloadSound(const LLUUID &id); void addAudioSource(LLAudioSource *asp); @@ -157,7 +160,7 @@ public: // Internet stream methods - these will call down into the *mStreamingAudioImpl if it exists void startInternetStream(const std::string& url); void stopInternetStream(); - void pauseInternetStream(int pause); + void pauseInternetStream(S32 pause); void updateInternetStream(); // expected to be called often LLAudioPlayState isInternetStreamPlaying(); // use a value from 0.0 to 1.0, inclusive @@ -334,6 +337,7 @@ protected: bool mSyncSlave; bool mQueueSounds; bool mPlayedOnce; + bool mCorrupted; S32 mType; LLVector3d mPositionGlobal; LLVector3 mVelocity; @@ -370,10 +374,12 @@ public: bool hasLocalData() const { return mHasLocalData; } bool hasDecodedData() const { return mHasDecodedData; } + bool hasCompletedDecode() const { return mHasCompletedDecode; } bool hasValidData() const { return mHasValidData; } void setHasLocalData(const bool hld) { mHasLocalData = hld; } void setHasDecodedData(const bool hdd) { mHasDecodedData = hdd; } + void setHasCompletedDecode(const bool hcd) { mHasCompletedDecode = hcd; } void setHasValidData(const bool hvd) { mHasValidData = hvd; } friend class LLAudioEngine; // Severe laziness, bad. @@ -381,9 +387,10 @@ public: protected: LLUUID mID; LLAudioBuffer *mBufferp; // If this data is being used by the audio system, a pointer to the buffer will be set here. - bool mHasLocalData; - bool mHasDecodedData; - bool mHasValidData; + bool mHasLocalData; // Set true if the sound asset file is available locally + bool mHasDecodedData; // Set true if the sound file has been decoded + bool mHasCompletedDecode; // Set true when the sound is decoded + bool mHasValidData; // Set false if decoding failed, meaning the sound asset is bad }; @@ -451,6 +458,27 @@ protected: LLFrameTimer mLastUseTimer; }; +struct SoundData +{ + LLUUID audio_uuid; + LLUUID owner_id; + F32 gain; + S32 type; + LLVector3d pos_global; + + SoundData(const LLUUID &audio_uuid, + const LLUUID& owner_id, + const F32 gain, + const S32 type = LLAudioEngine::AUDIO_TYPE_NONE, + const LLVector3d &pos_global = LLVector3d::zero) + { + this->audio_uuid = audio_uuid; + this->owner_id = owner_id; + this->gain = gain; + this->type = type; + this->pos_global = pos_global; + } +}; extern LLAudioEngine* gAudiop; |