summaryrefslogtreecommitdiff
path: root/indra/newview/llvoiceclient.cpp
diff options
context:
space:
mode:
authorAimee Linden <aimee@lindenlab.com>2010-05-19 22:24:32 +0100
committerAimee Linden <aimee@lindenlab.com>2010-05-19 22:24:32 +0100
commitd80bc7f9766c9e7d9e8360bff27df6b35d9f927b (patch)
treeabaa75f7f3f4bcbe034f50f560e304e6aaf0d515 /indra/newview/llvoiceclient.cpp
parent61cb3d31137f30f3766dbe3c22d700fbdf517d80 (diff)
parent1a88cb1c392f4f1274db88a8d2cdd35ad6028838 (diff)
Automated merge with ssh://hg.lindenlab.com/dessie/viewer-public
Diffstat (limited to 'indra/newview/llvoiceclient.cpp')
-rw-r--r--indra/newview/llvoiceclient.cpp47
1 files changed, 43 insertions, 4 deletions
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 91353281a8..d44b47707e 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -35,6 +35,7 @@
#include "llviewerwindow.h"
#include "llvoicevivox.h"
#include "llviewernetwork.h"
+#include "llcommandhandler.h"
#include "llhttpnode.h"
#include "llnotificationsutil.h"
#include "llsdserialize.h"
@@ -46,6 +47,39 @@ const F32 LLVoiceClient::VOLUME_MIN = 0.f;
const F32 LLVoiceClient::VOLUME_DEFAULT = 0.5f;
const F32 LLVoiceClient::VOLUME_MAX = 1.0f;
+
+// Support for secondlife:///app/voice SLapps
+class LLVoiceHandler : public LLCommandHandler
+{
+public:
+ // requests will be throttled from a non-trusted browser
+ LLVoiceHandler() : LLCommandHandler("voice", UNTRUSTED_THROTTLE) {}
+
+ bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web)
+ {
+ if (params[0].asString() == "effects")
+ {
+ LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface();
+ // If the voice client doesn't support voice effects, we can't handle effects SLapps
+ if (!effect_interface)
+ {
+ return false;
+ }
+
+ // Support secondlife:///app/voice/effects/refresh to update the voice effect list with new effects
+ if (params[1].asString() == "refresh")
+ {
+ effect_interface->refreshVoiceEffectLists(false);
+ return true;
+ }
+ }
+ return false;
+ }
+};
+LLVoiceHandler gVoiceHandler;
+
+
+
std::string LLVoiceClientStatusObserver::status2string(LLVoiceClientStatusObserver::EStatusType inStatus)
{
std::string result = "UNKNOWN";
@@ -77,12 +111,13 @@ std::string LLVoiceClientStatusObserver::status2string(LLVoiceClientStatusObserv
-
///////////////////////////////////////////////////////////////////////////////////////////////
-LLVoiceClient::LLVoiceClient()
+LLVoiceClient::LLVoiceClient() :
+ mVoiceModule(NULL),
+ mVoiceEffectEnabled(LLCachedControl<bool>(gSavedSettings, "VoiceEffectEnabled")),
+ mVoiceEffectDefault(LLCachedControl<std::string>(gSavedPerAccountSettings, "VoiceEffectDefault"))
{
- mVoiceModule = NULL;
}
//---------------------------------------------------
@@ -565,7 +600,7 @@ std::string LLVoiceClient::getDisplayName(const LLUUID& id)
}
}
-bool LLVoiceClient::isVoiceWorking()
+bool LLVoiceClient::isVoiceWorking() const
{
if (mVoiceModule)
{
@@ -708,6 +743,10 @@ std::string LLVoiceClient::sipURIFromID(const LLUUID &id)
}
}
+LLVoiceEffectInterface* LLVoiceClient::getVoiceEffectInterface() const
+{
+ return getVoiceEffectEnabled() ? dynamic_cast<LLVoiceEffectInterface*>(mVoiceModule) : NULL;
+}
///////////////////
// version checking