[Voice Update] LLVoiceClient
Migrate a bunch of classes out of llvoiceclient.* and into new llvoicevivox.* Update most of these to match their counterparts Introduce VoiceFonts support (voice morphing, floater still to come) Support for a bunch of v3 voice settings. Move volume settings management from LLMutelist into LLSpeakerVolumeStorage Support for Avaline mutes (WIP) Adds voice section to LLAgent Moved llfloatervoicedevicesettings to llpanelvoicedevicesettings, v3's voice device panel design is more intuitive.
This commit is contained in:
@@ -52,22 +52,16 @@
|
||||
|
||||
#include <boost/tokenizer.hpp>
|
||||
|
||||
#include "llcrc.h"
|
||||
#include "lldir.h"
|
||||
#include "lldispatcher.h"
|
||||
#include "llsdserialize.h"
|
||||
#include "llxfermanager.h"
|
||||
#include "message.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llviewergenericmessage.h" // for gGenericDispatcher
|
||||
#include "llviewerwindow.h"
|
||||
#include "llworld.h" //for particle system banning
|
||||
#include "llchat.h"
|
||||
#include "llfloaterchat.h"
|
||||
#include "llimpanel.h"
|
||||
#include "llimview.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llnotifications.h"
|
||||
#include "lluistring.h"
|
||||
#include "llviewerobject.h"
|
||||
#include "llviewerobjectlist.h"
|
||||
@@ -116,6 +110,7 @@ const char BY_NAME_SUFFIX[] = " (by name)";
|
||||
const char AGENT_SUFFIX[] = " (resident)";
|
||||
const char OBJECT_SUFFIX[] = " (object)";
|
||||
const char GROUP_SUFFIX[] = " (group)";
|
||||
const char EXTERNAL_SUFFIX[] = " (avaline)";
|
||||
|
||||
|
||||
LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags)
|
||||
@@ -160,6 +155,9 @@ std::string LLMute::getDisplayName() const
|
||||
case GROUP:
|
||||
name_with_suffix += GROUP_SUFFIX;
|
||||
break;
|
||||
case EXTERNAL:
|
||||
name_with_suffix += EXTERNAL_SUFFIX;
|
||||
break;
|
||||
}
|
||||
return name_with_suffix;
|
||||
}
|
||||
@@ -201,6 +199,14 @@ void LLMute::setFromDisplayName(const std::string& display_name)
|
||||
return;
|
||||
}
|
||||
|
||||
pos = mName.rfind(EXTERNAL_SUFFIX);
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
mName.erase(pos);
|
||||
mType = EXTERNAL;
|
||||
return;
|
||||
}
|
||||
|
||||
llwarns << "Unable to set mute from display name " << display_name << llendl;
|
||||
return;
|
||||
}
|
||||
@@ -224,39 +230,12 @@ LLMuteList* LLMuteList::getInstance()
|
||||
// LLMuteList()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLMuteList::LLMuteList() :
|
||||
mIsLoaded(FALSE),
|
||||
mUserVolumesLoaded(FALSE)
|
||||
mIsLoaded(FALSE)
|
||||
{
|
||||
gGenericDispatcher.addHandler("emptymutelist", &sDispatchEmptyMuteList);
|
||||
}
|
||||
|
||||
void LLMuteList::loadUserVolumes()
|
||||
{
|
||||
// call once, after LLDir::setLindenUserDir() has been called
|
||||
if (mUserVolumesLoaded)
|
||||
return;
|
||||
mUserVolumesLoaded = TRUE;
|
||||
|
||||
// load per-resident voice volume information
|
||||
// conceptually, this is part of the mute list information, although it is only stored locally
|
||||
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "volume_settings.xml");
|
||||
|
||||
LLSD settings_llsd;
|
||||
llifstream file;
|
||||
file.open(filename);
|
||||
if (file.is_open())
|
||||
{
|
||||
LLSDSerialize::fromXML(settings_llsd, file);
|
||||
}
|
||||
|
||||
for (LLSD::map_const_iterator iter = settings_llsd.beginMap();
|
||||
iter != settings_llsd.endMap(); ++iter)
|
||||
{
|
||||
mUserVolumeSettings.insert(std::make_pair(LLUUID(iter->first), (F32)iter->second.asReal()));
|
||||
}
|
||||
|
||||
LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLMuteList::checkNewRegion, this));
|
||||
checkNewRegion();
|
||||
LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLMuteList::checkNewRegion, this));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -264,24 +243,7 @@ void LLMuteList::loadUserVolumes()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLMuteList::~LLMuteList()
|
||||
{
|
||||
// If we quit from the login screen we will not have an SL account
|
||||
// name. Don't try to save, otherwise we'll dump a file in
|
||||
// C:\Program Files\SecondLife\ JC
|
||||
std::string user_dir = gDirUtilp->getLindenUserDir(true);
|
||||
if (!user_dir.empty())
|
||||
{
|
||||
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "volume_settings.xml");
|
||||
LLSD settings_llsd;
|
||||
|
||||
for(user_volume_map_t::iterator iter = mUserVolumeSettings.begin(); iter != mUserVolumeSettings.end(); ++iter)
|
||||
{
|
||||
settings_llsd[iter->first.asString()] = iter->second;
|
||||
}
|
||||
|
||||
llofstream file;
|
||||
file.open(filename);
|
||||
LLSDSerialize::toPrettyXML(settings_llsd, file);
|
||||
}
|
||||
}
|
||||
|
||||
bool LLMuteList::isLinden(const LLUUID& id) const
|
||||
@@ -333,7 +295,7 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags)
|
||||
if ((mute.mType == LLMute::AGENT)
|
||||
&& isLinden(mute.mName) && (flags & LLMute::flagTextChat || flags == 0))
|
||||
{
|
||||
LLNotificationsUtil::add("MuteLinden");
|
||||
LLNotifications::instance().add("MuteLinden", LLSD(), LLSD());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -439,6 +401,12 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags)
|
||||
|
||||
void LLMuteList::updateAdd(const LLMute& mute)
|
||||
{
|
||||
// External mutes (e.g. Avaline callers) are local only, don't send them to the server.
|
||||
if (mute.mType == LLMute::EXTERNAL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Update the database
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
msg->newMessageFast(_PREHASH_UpdateMuteListEntry);
|
||||
@@ -526,6 +494,12 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags)
|
||||
|
||||
void LLMuteList::updateRemove(const LLMute& mute)
|
||||
{
|
||||
// External mutes are not sent to the server anyway, no need to remove them.
|
||||
if (mute.mType == LLMute::EXTERNAL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
msg->newMessageFast(_PREHASH_RemoveMuteListEntry);
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
@@ -557,7 +531,7 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& full_na
|
||||
LLSD args;
|
||||
args["NAME"] = full_name;
|
||||
|
||||
LLNotificationPtr notif_ptr = LLNotifications::instance().add(notif_name, args);
|
||||
LLNotificationPtr notif_ptr = LLNotifications::instance().add(notif_name, args, LLSD());
|
||||
if (notif_ptr)
|
||||
{
|
||||
std::string message = notif_ptr->getMessage();
|
||||
@@ -708,9 +682,14 @@ BOOL LLMuteList::saveToFile(const std::string& filename)
|
||||
it != mMutes.end();
|
||||
++it)
|
||||
{
|
||||
it->mID.toString(id_string);
|
||||
const std::string& name = it->mName;
|
||||
fprintf(fp, "%d %s %s|%u\n", (S32)it->mType, id_string.c_str(), name.c_str(), it->mFlags);
|
||||
// Don't save external mutes as they are not sent to the server and probably won't
|
||||
//be valid next time anyway.
|
||||
if (it->mType != LLMute::EXTERNAL)
|
||||
{
|
||||
it->mID.toString(id_string);
|
||||
const std::string& name = it->mName;
|
||||
fprintf(fp, "%d %s %s|%u\n", (S32)it->mType, id_string.c_str(), name.c_str(), it->mFlags);
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
return TRUE;
|
||||
@@ -755,8 +734,6 @@ BOOL LLMuteList::isMuted(const LLUUID& id, const std::string& name, U32 flags) c
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLMuteList::requestFromServer(const LLUUID& agent_id)
|
||||
{
|
||||
loadUserVolumes();
|
||||
|
||||
std::string agent_id_string;
|
||||
std::string filename;
|
||||
agent_id.toString(agent_id_string);
|
||||
@@ -791,26 +768,6 @@ void LLMuteList::cache(const LLUUID& agent_id)
|
||||
}
|
||||
}
|
||||
|
||||
void LLMuteList::setSavedResidentVolume(const LLUUID& id, F32 volume)
|
||||
{
|
||||
// store new value in volume settings file
|
||||
mUserVolumeSettings[id] = volume;
|
||||
}
|
||||
|
||||
F32 LLMuteList::getSavedResidentVolume(const LLUUID& id)
|
||||
{
|
||||
const F32 DEFAULT_VOLUME = 0.5f;
|
||||
|
||||
user_volume_map_t::iterator found_it = mUserVolumeSettings.find(id);
|
||||
if (found_it != mUserVolumeSettings.end())
|
||||
{
|
||||
return found_it->second;
|
||||
}
|
||||
//FIXME: assumes default, should get this from somewhere
|
||||
return DEFAULT_VOLUME;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Static message handlers
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -925,7 +882,7 @@ void LLMuteList::parseSimulatorFeatures()
|
||||
{
|
||||
LLSD godNames = info["god_names"]["last_names"];
|
||||
|
||||
for (LLSD::array_iterator godNames_it = godNames.beginArray(); godNames_it != godNames.endArray(); godNames_it++)
|
||||
for (LLSD::array_iterator godNames_it = godNames.beginArray(); godNames_it != godNames.endArray(); ++godNames_it)
|
||||
mGodLastNames.insert((*godNames_it).asString());
|
||||
}
|
||||
|
||||
@@ -933,7 +890,7 @@ void LLMuteList::parseSimulatorFeatures()
|
||||
{
|
||||
LLSD godNames = info["god_names"]["full_names"];
|
||||
|
||||
for (LLSD::array_iterator godNames_it = godNames.beginArray(); godNames_it != godNames.endArray(); godNames_it++)
|
||||
for (LLSD::array_iterator godNames_it = godNames.beginArray(); godNames_it != godNames.endArray(); ++godNames_it)
|
||||
mGodFullNames.insert((*godNames_it).asString());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user