diff options
author | Jacek Antonelli | 2008-08-15 23:45:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:57 -0500 |
commit | 7e3007b63521c4b0c5bbad1c3964a557fc526ce2 (patch) | |
tree | ab231ed574db618873d6ebb25293cf7c0cb6d26e /linden/indra/newview/llmutelist.cpp | |
parent | Second Life viewer sources 1.20.10 (diff) | |
download | meta-impy-7e3007b63521c4b0c5bbad1c3964a557fc526ce2.zip meta-impy-7e3007b63521c4b0c5bbad1c3964a557fc526ce2.tar.gz meta-impy-7e3007b63521c4b0c5bbad1c3964a557fc526ce2.tar.bz2 meta-impy-7e3007b63521c4b0c5bbad1c3964a557fc526ce2.tar.xz |
Second Life viewer sources 1.20.11
Diffstat (limited to 'linden/indra/newview/llmutelist.cpp')
-rw-r--r-- | linden/indra/newview/llmutelist.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/linden/indra/newview/llmutelist.cpp b/linden/indra/newview/llmutelist.cpp index 75c7cce..408b70e 100644 --- a/linden/indra/newview/llmutelist.cpp +++ b/linden/indra/newview/llmutelist.cpp | |||
@@ -72,9 +72,6 @@ | |||
72 | #include "llviewerobjectlist.h" | 72 | #include "llviewerobjectlist.h" |
73 | 73 | ||
74 | 74 | ||
75 | std::map<LLUUID, F32> LLMuteList::sUserVolumeSettings; | ||
76 | |||
77 | |||
78 | // "emptymutelist" | 75 | // "emptymutelist" |
79 | class LLDispatchEmptyMuteList : public LLDispatchHandler | 76 | class LLDispatchEmptyMuteList : public LLDispatchHandler |
80 | { | 77 | { |
@@ -182,10 +179,19 @@ LLMuteList* LLMuteList::getInstance() | |||
182 | // LLMuteList() | 179 | // LLMuteList() |
183 | //----------------------------------------------------------------------------- | 180 | //----------------------------------------------------------------------------- |
184 | LLMuteList::LLMuteList() : | 181 | LLMuteList::LLMuteList() : |
185 | mIsLoaded(FALSE) | 182 | mIsLoaded(FALSE), |
183 | mUserVolumesLoaded(FALSE) | ||
186 | { | 184 | { |
187 | gGenericDispatcher.addHandler("emptymutelist", &sDispatchEmptyMuteList); | 185 | gGenericDispatcher.addHandler("emptymutelist", &sDispatchEmptyMuteList); |
186 | } | ||
188 | 187 | ||
188 | void LLMuteList::loadUserVolumes() | ||
189 | { | ||
190 | // call once, after LLDir::setLindenUserDir() has been called | ||
191 | if (mUserVolumesLoaded) | ||
192 | return; | ||
193 | mUserVolumesLoaded = TRUE; | ||
194 | |||
189 | // load per-resident voice volume information | 195 | // load per-resident voice volume information |
190 | // conceptually, this is part of the mute list information, although it is only stored locally | 196 | // conceptually, this is part of the mute list information, although it is only stored locally |
191 | std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "volume_settings.xml"); | 197 | std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "volume_settings.xml"); |
@@ -201,7 +207,7 @@ LLMuteList::LLMuteList() : | |||
201 | for (LLSD::map_const_iterator iter = settings_llsd.beginMap(); | 207 | for (LLSD::map_const_iterator iter = settings_llsd.beginMap(); |
202 | iter != settings_llsd.endMap(); ++iter) | 208 | iter != settings_llsd.endMap(); ++iter) |
203 | { | 209 | { |
204 | sUserVolumeSettings.insert(std::make_pair(LLUUID(iter->first), (F32)iter->second.asReal())); | 210 | mUserVolumeSettings.insert(std::make_pair(LLUUID(iter->first), (F32)iter->second.asReal())); |
205 | } | 211 | } |
206 | } | 212 | } |
207 | 213 | ||
@@ -213,7 +219,7 @@ LLMuteList::~LLMuteList() | |||
213 | std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "volume_settings.xml"); | 219 | std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "volume_settings.xml"); |
214 | LLSD settings_llsd; | 220 | LLSD settings_llsd; |
215 | 221 | ||
216 | for(user_volume_map_t::iterator iter = sUserVolumeSettings.begin(); iter != sUserVolumeSettings.end(); ++iter) | 222 | for(user_volume_map_t::iterator iter = mUserVolumeSettings.begin(); iter != mUserVolumeSettings.end(); ++iter) |
217 | { | 223 | { |
218 | settings_llsd[iter->first.asString()] = iter->second; | 224 | settings_llsd[iter->first.asString()] = iter->second; |
219 | } | 225 | } |
@@ -669,6 +675,8 @@ BOOL LLMuteList::isMuted(const LLUUID& id, const LLString& name, U32 flags) cons | |||
669 | //----------------------------------------------------------------------------- | 675 | //----------------------------------------------------------------------------- |
670 | void LLMuteList::requestFromServer(const LLUUID& agent_id) | 676 | void LLMuteList::requestFromServer(const LLUUID& agent_id) |
671 | { | 677 | { |
678 | loadUserVolumes(); | ||
679 | |||
672 | char agent_id_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/ | 680 | char agent_id_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/ |
673 | char filename[LL_MAX_PATH]; /*Flawfinder: ignore*/ | 681 | char filename[LL_MAX_PATH]; /*Flawfinder: ignore*/ |
674 | agent_id.toString(agent_id_string); | 682 | agent_id.toString(agent_id_string); |
@@ -706,15 +714,15 @@ void LLMuteList::cache(const LLUUID& agent_id) | |||
706 | void LLMuteList::setSavedResidentVolume(const LLUUID& id, F32 volume) | 714 | void LLMuteList::setSavedResidentVolume(const LLUUID& id, F32 volume) |
707 | { | 715 | { |
708 | // store new value in volume settings file | 716 | // store new value in volume settings file |
709 | sUserVolumeSettings[id] = volume; | 717 | mUserVolumeSettings[id] = volume; |
710 | } | 718 | } |
711 | 719 | ||
712 | F32 LLMuteList::getSavedResidentVolume(const LLUUID& id) | 720 | F32 LLMuteList::getSavedResidentVolume(const LLUUID& id) |
713 | { | 721 | { |
714 | const F32 DEFAULT_VOLUME = 0.5f; | 722 | const F32 DEFAULT_VOLUME = 0.5f; |
715 | 723 | ||
716 | user_volume_map_t::iterator found_it = sUserVolumeSettings.find(id); | 724 | user_volume_map_t::iterator found_it = mUserVolumeSettings.find(id); |
717 | if (found_it != sUserVolumeSettings.end()) | 725 | if (found_it != mUserVolumeSettings.end()) |
718 | { | 726 | { |
719 | return found_it->second; | 727 | return found_it->second; |
720 | } | 728 | } |