diff options
| author | Dessie Linden <dessie@lindenlab.com> | 2010-06-11 05:52:49 -0700 |
|---|---|---|
| committer | Dessie Linden <dessie@lindenlab.com> | 2010-06-11 05:52:49 -0700 |
| commit | af4a2ec0f9f4e51e186f4b386b4465f6e107b63b (patch) | |
| tree | fabff1abc70adae6aa6b5287f7251a66e0ae09fc /indra/newview/llvoiceclient.cpp | |
| parent | 470f81dd33dc8b89db97c6cd374f1bb171d8fc8e (diff) | |
| parent | 085b2c24f9ded3d0e9a33500a287aaa53e8b7fba (diff) | |
Merge from 2.1 Alpha tag
Diffstat (limited to 'indra/newview/llvoiceclient.cpp')
| -rw-r--r-- | indra/newview/llvoiceclient.cpp | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 42e44634b6..e8635d7f1a 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,13 +111,14 @@ std::string LLVoiceClientStatusObserver::status2string(LLVoiceClientStatusObserv - /////////////////////////////////////////////////////////////////////////////////////////////// LLVoiceClient::LLVoiceClient() : mVoiceModule(NULL), - m_servicePump(NULL) + m_servicePump(NULL), + mVoiceEffectEnabled(LLCachedControl<bool>(gSavedSettings, "VoiceMorphingEnabled")), + mVoiceEffectDefault(LLCachedControl<std::string>(gSavedPerAccountSettings, "VoiceEffectDefault")) { } @@ -567,7 +602,7 @@ std::string LLVoiceClient::getDisplayName(const LLUUID& id) } } -bool LLVoiceClient::isVoiceWorking() +bool LLVoiceClient::isVoiceWorking() const { if (mVoiceModule) { @@ -710,6 +745,10 @@ std::string LLVoiceClient::sipURIFromID(const LLUUID &id) } } +LLVoiceEffectInterface* LLVoiceClient::getVoiceEffectInterface() const +{ + return getVoiceEffectEnabled() ? dynamic_cast<LLVoiceEffectInterface*>(mVoiceModule) : NULL; +} /////////////////// // version checking |
