Tiny update to voice code to avoid falling behind the Lindens

Adds support for secondlife:///app/voice SLapps
This commit is contained in:
Lirusaito
2013-07-16 05:41:14 -04:00
parent d497e0d10e
commit 4b210c1bbf
5 changed files with 144 additions and 118 deletions

View File

@@ -30,6 +30,7 @@
#include "llviewerwindow.h"
#include "llvoicevivox.h"
#include "llviewernetwork.h"
#include "llcommandhandler.h"
#include "llhttpnode.h"
#include "llnotificationsutil.h"
#include "llsdserialize.h"
@@ -42,6 +43,38 @@ 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";