diff options
author | Aimee Linden <aimee@lindenlab.com> | 2010-05-19 21:14:24 +0100 |
---|---|---|
committer | Aimee Linden <aimee@lindenlab.com> | 2010-05-19 21:14:24 +0100 |
commit | 4f2f2f90378e5191cd00748c2cc6633af3efd230 (patch) | |
tree | 6cea968c930e5dd3a1a9e385c0faa897b6263b22 /indra/newview | |
parent | 4c6d743665ae39a6402ee7b86f43043cb4c5806d (diff) |
EXT-7138 WIP Enable activation of voice effects from the Voice Effects floater
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloatervoiceeffect.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llfloatervoiceeffect.h | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_voice_effect.xml | 12 |
3 files changed, 36 insertions, 7 deletions
diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index de12e8d12a..60831936ca 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -36,12 +36,15 @@ #include "llscrolllistctrl.h" #include "lltrans.h" +#include "llweb.h" LLFloaterVoiceEffect::LLFloaterVoiceEffect(const LLSD& key) : LLFloater(key) { mCommitCallbackRegistrar.add("VoiceEffect.Record", boost::bind(&LLFloaterVoiceEffect::onClickRecord, this)); mCommitCallbackRegistrar.add("VoiceEffect.Play", boost::bind(&LLFloaterVoiceEffect::onClickPlay, this)); + mCommitCallbackRegistrar.add("VoiceEffect.Add", boost::bind(&LLFloaterVoiceEffect::onClickAdd, this)); + mCommitCallbackRegistrar.add("VoiceEffect.Activate", boost::bind(&LLFloaterVoiceEffect::onClickActivate, this)); } // virtual @@ -63,6 +66,10 @@ BOOL LLFloaterVoiceEffect::postBuild() setDefaultBtn("record_btn"); mVoiceEffectList = getChild<LLScrollListCtrl>("voice_effect_list"); + if (mVoiceEffectList) + { + mVoiceEffectList->setDoubleClickCallback(boost::bind(&LLFloaterVoiceEffect::onClickActivate, this)); + } LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); if (effect_interface) @@ -93,7 +100,7 @@ void LLFloaterVoiceEffect::update() } LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); - if (!effect_interface) // || !LLVoiceClient::instance().isVoiceWorking()) + if (!effect_interface) { mVoiceEffectList->setEnabled(false); return; @@ -207,7 +214,7 @@ void LLFloaterVoiceEffect::onClickRecord() { LL_DEBUGS("Voice") << "Record clicked" << LL_ENDL; LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); - if (effect_interface) // && LLVoiceClient::instance().isVoiceWorking()) + if (effect_interface) { bool record = !effect_interface->isPreviewRecording(); effect_interface->recordPreviewBuffer(record); @@ -227,7 +234,7 @@ void LLFloaterVoiceEffect::onClickPlay() const LLUUID& effect_id = mVoiceEffectList->getCurrentID(); LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); - if (effect_interface) // && LLVoiceClient::instance().isVoiceWorking()) + if (effect_interface) { bool play = !effect_interface->isPreviewPlaying(); effect_interface->playPreviewBuffer(play, effect_id); @@ -235,3 +242,18 @@ void LLFloaterVoiceEffect::onClickPlay() getChild<LLButton>("play_stop_btn")->setVisible(play); } } + +void LLFloaterVoiceEffect::onClickAdd() +{ + // Open the voice morphing info web page + LLWeb::loadURL(getString("get_voice_effects_url")); +} + +void LLFloaterVoiceEffect::onClickActivate() +{ + LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); + if (effect_interface && mVoiceEffectList) + { + effect_interface->setVoiceEffect(mVoiceEffectList->getCurrentID()); + } +} diff --git a/indra/newview/llfloatervoiceeffect.h b/indra/newview/llfloatervoiceeffect.h index cd639dba5a..5ad64f0e26 100644 --- a/indra/newview/llfloatervoiceeffect.h +++ b/indra/newview/llfloatervoiceeffect.h @@ -60,7 +60,8 @@ private: void onClickRecord(); void onClickPlay(); -// void onClickActivate(); + void onClickAdd(); + void onClickActivate(); LLUUID mSelectedID; LLScrollListCtrl* mVoiceEffectList; diff --git a/indra/newview/skins/default/xui/en/floater_voice_effect.xml b/indra/newview/skins/default/xui/en/floater_voice_effect.xml index 8452fb55b7..1f28a6375f 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml @@ -16,6 +16,9 @@ <string name="no_voice_effect"> No Voice Effect </string> + <string name="get_voice_effects_url"> + https://secondlife.com/my/account/voice.php + </string> <string name="new_voice_effect"> New! </string> @@ -76,10 +79,13 @@ image_disabled="AddItem_Disabled" layout="topleft" left="10" - name="new_gesture_btn" - tool_tip="Make new gesture" + name="add_voice_effect_btn" + tool_tip="Get more voice effects" top="5" - width="18" /> + width="18"> + <button.commit_callback + function="VoiceEffect.Add" /> + </button> <button follows="bottom|left" font="SansSerifBigBold" |