diff options
author | Merov Linden <merov@lindenlab.com> | 2011-08-04 15:45:48 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2011-08-04 15:45:48 -0700 |
commit | 7cc7d143837f2b75f750c139e33fdf5afa8a8866 (patch) | |
tree | 7e37843f06cdd1f163258b5686ac29943aa8558d /indra/newview/llviewermedia.cpp | |
parent | 1b46240ed84e2847dbf7da0d67c67940b646448c (diff) | |
parent | 0b81c19cbe809f041e628da334c305ea33fae2e9 (diff) |
Sync with viewer-development
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r-- | indra/newview/llviewermedia.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 1be58eae45..384f7cd61d 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -344,6 +344,8 @@ static LLViewerMedia::impl_id_map sViewerMediaTextureIDMap; static LLTimer sMediaCreateTimer; static const F32 LLVIEWERMEDIA_CREATE_DELAY = 1.0f; static F32 sGlobalVolume = 1.0f; +static bool sForceUpdate = false; +static LLUUID sOnlyAudibleTextureID = LLUUID::null; static F64 sLowestLoadableImplInterest = 0.0f; static bool sAnyMediaShowing = false; static boost::signals2::connection sTeleportFinishConnection; @@ -606,7 +608,7 @@ bool LLViewerMedia::textureHasMedia(const LLUUID& texture_id) // static void LLViewerMedia::setVolume(F32 volume) { - if(volume != sGlobalVolume) + if(volume != sGlobalVolume || sForceUpdate) { sGlobalVolume = volume; impl_list::iterator iter = sViewerMediaImplList.begin(); @@ -617,6 +619,8 @@ void LLViewerMedia::setVolume(F32 volume) LLViewerMediaImpl* pimpl = *iter; pimpl->updateVolume(); } + + sForceUpdate = false; } } @@ -1626,6 +1630,15 @@ void LLViewerMedia::onTeleportFinished() gSavedSettings.setBOOL("MediaTentativeAutoPlay", true); } + +////////////////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerMedia::setOnlyAudibleMediaTextureID(const LLUUID& texture_id) +{ + sOnlyAudibleTextureID = texture_id; + sForceUpdate = true; +} + ////////////////////////////////////////////////////////////////////////////////////////// // LLViewerMediaImpl ////////////////////////////////////////////////////////////////////////////////////////// @@ -2188,7 +2201,14 @@ void LLViewerMediaImpl::updateVolume() } } - mMediaSource->setVolume(volume); + if (sOnlyAudibleTextureID == LLUUID::null || sOnlyAudibleTextureID == mTextureId) + { + mMediaSource->setVolume(volume); + } + else + { + mMediaSource->setVolume(0.0f); + } } } |