From 24c55c9a689aaf7c8c961a5eb4aab5283b0fb1fa Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Tue, 18 May 2010 14:16:25 +0100 Subject: EXT-7337 WIP Implemented prototype voice font preview floater. --- indra/newview/llfloatervoiceeffect.cpp | 172 +++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 indra/newview/llfloatervoiceeffect.cpp (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp new file mode 100644 index 0000000000..5a579f5aeb --- /dev/null +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -0,0 +1,172 @@ +/** + * @file llfloatervoiceeffect.cpp + * @brief Selection and preview of voice effect. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatervoiceeffect.h" + +#include "llscrolllistctrl.h" +#include "lltrans.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)); +} + +// virtual +LLFloaterVoiceEffect::~LLFloaterVoiceEffect() +{ + if(LLVoiceClient::instanceExists()) + { + LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); + if (effect_interface) + { + effect_interface->removeObserver(this); + } + } +} + +// virtual +BOOL LLFloaterVoiceEffect::postBuild() +{ + setDefaultBtn("record_btn"); + + mVoiceEffectList = getChild("voice_effect_list"); + + LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); + if (effect_interface) + { + effect_interface->addObserver(this); + } + + update(); + + return TRUE; +} + +// virtual +void LLFloaterVoiceEffect::onClose(bool app_quitting) +{ + LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); + if (effect_interface) + { + effect_interface->clearPreviewBuffer(); + } +} + +void LLFloaterVoiceEffect::update() +{ + if (!mVoiceEffectList) + { + return; + } + + LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); + if (!effect_interface) // || !LLVoiceClient::instance().isVoiceWorking()) + { + mVoiceEffectList->setEnabled(false); + return; + } + + mVoiceEffectList->deleteAllItems(); + LLSD element; + element["id"] = LLUUID::null; + element["columns"][1]["column"] = "name"; + element["columns"][1]["value"] = getString("no_voice_effect"); + mVoiceEffectList->addElement(element, ADD_BOTTOM); + + const voice_effect_list_t& effect_list = effect_interface->getVoiceEffectList(); + if (!effect_list.empty()) + { + for (voice_effect_list_t::const_iterator it = effect_list.begin(); it != effect_list.end(); ++it) + { + LLSD element; + element["id"] = it->second; + element["columns"][1]["column"] = "name"; + element["columns"][1]["value"] = it->first; + mVoiceEffectList->addElement(element, ADD_BOTTOM); + } + } + + mVoiceEffectList->setValue(effect_interface->getVoiceEffect()); + mVoiceEffectList->setEnabled(true); + + bool recording = effect_interface->isPreviewRecording(); + getChild("record_btn")->setVisible(!recording); + getChild("record_stop_btn")->setVisible(recording); + + getChild("play_btn")->setEnabled(effect_interface->isPreviewReady()); + bool playing = effect_interface->isPreviewPlaying(); + getChild("play_btn")->setVisible(!playing); + getChild("play_stop_btn")->setVisible(playing); +} + +// virtual +void LLFloaterVoiceEffect::onVoiceEffectChanged(bool new_effects) +{ + update(); +} + +void LLFloaterVoiceEffect::onClickRecord() +{ + LL_DEBUGS("Voice") << "Record clicked" << LL_ENDL; + LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); + if (effect_interface) // && LLVoiceClient::instance().isVoiceWorking()) + { + bool record = !effect_interface->isPreviewRecording(); + effect_interface->recordPreviewBuffer(record); + getChild("record_btn")->setVisible(!record); + getChild("record_stop_btn")->setVisible(record); + } +} + +void LLFloaterVoiceEffect::onClickPlay() +{ + LL_DEBUGS("Voice") << "Play clicked" << LL_ENDL; + if (!mVoiceEffectList) + { + return; + } + + const LLUUID& effect_id = mVoiceEffectList->getCurrentID(); + + LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); + if (effect_interface) // && LLVoiceClient::instance().isVoiceWorking()) + { + bool play = !effect_interface->isPreviewPlaying(); + effect_interface->playPreviewBuffer(play, effect_id); + getChild("play_btn")->setVisible(!play); + getChild("play_stop_btn")->setVisible(play); + } +} -- cgit v1.2.3 From 95ed59a9dec737ffe8d566595e1a74f662fe1e43 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Wed, 19 May 2010 16:28:03 +0100 Subject: EXT-7337 WIP Added template voice fonts to the voice font list for previewing --- indra/newview/llfloatervoiceeffect.cpp | 91 +++++++++++++++++++++++++++++----- 1 file changed, 78 insertions(+), 13 deletions(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 5a579f5aeb..de12e8d12a 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -99,29 +99,94 @@ void LLFloaterVoiceEffect::update() return; } + LL_DEBUGS("Voice")<< "Rebuilding voice effect list."<< LL_ENDL; + + // Preserve selected items and scroll position + S32 scroll_pos = mVoiceEffectList->getScrollPos(); + uuid_vec_t selected_items; + std::vector items = mVoiceEffectList->getAllSelected(); + for(std::vector::const_iterator it = items.begin(); it != items.end(); it++) + { + selected_items.push_back((*it)->getUUID()); + } + mVoiceEffectList->deleteAllItems(); - LLSD element; - element["id"] = LLUUID::null; - element["columns"][1]["column"] = "name"; - element["columns"][1]["value"] = getString("no_voice_effect"); - mVoiceEffectList->addElement(element, ADD_BOTTOM); - - const voice_effect_list_t& effect_list = effect_interface->getVoiceEffectList(); - if (!effect_list.empty()) + { - for (voice_effect_list_t::const_iterator it = effect_list.begin(); it != effect_list.end(); ++it) + // Add the "No Voice Effect" entry + LLSD element; + + element["id"] = LLUUID::null; + element["columns"][0]["column"] = "name"; + element["columns"][0]["value"] = getString("no_voice_effect"); + element["columns"][0]["font"]["name"] = "SANSSERIF"; + element["columns"][0]["font"]["style"] = "BOLD"; + + LLScrollListItem* sl_item = mVoiceEffectList->addElement(element, ADD_BOTTOM); + // *HACK: Copied from llfloatergesture.cpp : ["font"]["style"] does not affect font style :( + if(sl_item) { + ((LLScrollListText*)sl_item->getColumn(0))->setFontStyle(LLFontGL::BOLD); + } + } + + const voice_effect_list_t& template_list = effect_interface->getVoiceEffectTemplateList(); + if (!template_list.empty()) + { + for (voice_effect_list_t::const_iterator it = template_list.begin(); it != template_list.end(); ++it) + { + const LLUUID& effect_id = it->second; + std::string effect_name = it->first; + + LLSD effect_properties = effect_interface->getVoiceEffectProperties(effect_id); + bool is_template_only = effect_properties["template_only"].asBoolean(); + bool is_new = effect_properties["is_new"].asBoolean(); + std::string expiry_date = effect_properties["expiry_date"].asString(); + + std::string font_style = "NORMAL"; + if (!is_template_only) + { + font_style = "BOLD"; + } LLSD element; - element["id"] = it->second; - element["columns"][1]["column"] = "name"; - element["columns"][1]["value"] = it->first; - mVoiceEffectList->addElement(element, ADD_BOTTOM); + element["id"] = effect_id; + + element["columns"][0]["column"] = "name"; + element["columns"][0]["value"] = effect_name; + element["columns"][0]["font"]["name"] = "SANSSERIF"; + element["columns"][0]["font"]["style"] = font_style; + element["columns"][1]["column"] = "new"; + element["columns"][1]["value"] = is_new ? getString("new_voice_effect") : ""; + element["columns"][1]["font"]["name"] = "SANSSERIF"; + element["columns"][1]["font"]["style"] = font_style; + + element["columns"][2]["column"] = "expires"; + element["columns"][2]["value"] = !is_template_only ? expiry_date : ""; + element["columns"][2]["font"]["name"] = "SANSSERIF"; + element["columns"][2]["font"]["style"] = font_style; + + LLScrollListItem* sl_item = mVoiceEffectList->addElement(element, ADD_BOTTOM); + // *HACK: Copied from llfloatergesture.cpp : ["font"]["style"] does not affect font style :( + if(sl_item) + { + LLFontGL::StyleFlags style = is_template_only ? LLFontGL::NORMAL : LLFontGL::BOLD; + ((LLScrollListText*)sl_item->getColumn(0))->setFontStyle(style); + } } } + // Re-select items that were selected before, and restore the scroll position + for(uuid_vec_t::iterator it = selected_items.begin(); it != selected_items.end(); it++) + { + mVoiceEffectList->selectByID(*it); + } + mVoiceEffectList->setScrollPos(scroll_pos); + mVoiceEffectList->setValue(effect_interface->getVoiceEffect()); mVoiceEffectList->setEnabled(true); + // Update button states + // *TODO: Should separate this from rebuilding the effects list, to avoid rebuilding it unnecessarily bool recording = effect_interface->isPreviewRecording(); getChild("record_btn")->setVisible(!recording); getChild("record_stop_btn")->setVisible(recording); -- cgit v1.2.3 From 4f2f2f90378e5191cd00748c2cc6633af3efd230 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Wed, 19 May 2010 21:14:24 +0100 Subject: EXT-7138 WIP Enable activation of voice effects from the Voice Effects floater --- indra/newview/llfloatervoiceeffect.cpp | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') 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("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("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()); + } +} -- cgit v1.2.3 From 5cf632aacbae683676c341a7f1470108cdf65b59 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Sat, 22 May 2010 17:58:45 +0100 Subject: EXT-7138 WIP Voice Morphing - Go into stateCaptureBufferPaused as soon as the Voice Effects preview is opened. Disconnecting from voice on hitting record was taking too long and causing the start of the voice recording to be cut off. --- indra/newview/llfloatervoiceeffect.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 60831936ca..f38a56a06d 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -75,6 +75,9 @@ BOOL LLFloaterVoiceEffect::postBuild() if (effect_interface) { effect_interface->addObserver(this); + + // Disconnect from the current voice channel ready to record a voice sample for previewing + effect_interface->enablePreviewBuffer(true); } update(); @@ -88,7 +91,7 @@ void LLFloaterVoiceEffect::onClose(bool app_quitting) LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); if (effect_interface) { - effect_interface->clearPreviewBuffer(); + effect_interface->enablePreviewBuffer(false); } } -- cgit v1.2.3 From 1ebbe196910110eb51497f272abde277f8f0f69a Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Sun, 23 May 2010 02:22:48 +0100 Subject: EXT-7337 WIP Voice morph previewing Separate Play and Stop callbacks, to allow single click previews in the effect list. --- indra/newview/llfloatervoiceeffect.cpp | 61 +++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 16 deletions(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index f38a56a06d..0fa6135da2 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -43,6 +43,7 @@ LLFloaterVoiceEffect::LLFloaterVoiceEffect(const LLSD& key) { mCommitCallbackRegistrar.add("VoiceEffect.Record", boost::bind(&LLFloaterVoiceEffect::onClickRecord, this)); mCommitCallbackRegistrar.add("VoiceEffect.Play", boost::bind(&LLFloaterVoiceEffect::onClickPlay, this)); + mCommitCallbackRegistrar.add("VoiceEffect.Stop", boost::bind(&LLFloaterVoiceEffect::onClickStop, this)); mCommitCallbackRegistrar.add("VoiceEffect.Add", boost::bind(&LLFloaterVoiceEffect::onClickAdd, this)); mCommitCallbackRegistrar.add("VoiceEffect.Activate", boost::bind(&LLFloaterVoiceEffect::onClickActivate, this)); } @@ -68,6 +69,7 @@ BOOL LLFloaterVoiceEffect::postBuild() mVoiceEffectList = getChild("voice_effect_list"); if (mVoiceEffectList) { + mVoiceEffectList->setCommitCallback(boost::bind(&LLFloaterVoiceEffect::onClickPlay, this)); mVoiceEffectList->setDoubleClickCallback(boost::bind(&LLFloaterVoiceEffect::onClickActivate, this)); } @@ -80,7 +82,8 @@ BOOL LLFloaterVoiceEffect::postBuild() effect_interface->enablePreviewBuffer(true); } - update(); + refreshEffectList(); + updateControls(); return TRUE; } @@ -95,7 +98,7 @@ void LLFloaterVoiceEffect::onClose(bool app_quitting) } } -void LLFloaterVoiceEffect::update() +void LLFloaterVoiceEffect::refreshEffectList() { if (!mVoiceEffectList) { @@ -194,23 +197,42 @@ void LLFloaterVoiceEffect::update() mVoiceEffectList->setValue(effect_interface->getVoiceEffect()); mVoiceEffectList->setEnabled(true); +} + +void LLFloaterVoiceEffect::updateControls() +{ + bool recording = false; + bool playing = false; + + LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); + if (effect_interface) + { + recording = effect_interface->isPreviewRecording(); + playing = effect_interface->isPreviewPlaying(); + } - // Update button states - // *TODO: Should separate this from rebuilding the effects list, to avoid rebuilding it unnecessarily - bool recording = effect_interface->isPreviewRecording(); getChild("record_btn")->setVisible(!recording); getChild("record_stop_btn")->setVisible(recording); - getChild("play_btn")->setEnabled(effect_interface->isPreviewReady()); - bool playing = effect_interface->isPreviewPlaying(); getChild("play_btn")->setVisible(!playing); getChild("play_stop_btn")->setVisible(playing); + + getChild("play_btn")->setEnabled(effect_interface->isPreviewReady()); + + if (!mVoiceEffectList) + { + mVoiceEffectList->setValue(effect_interface->getVoiceEffect()); + } } // virtual void LLFloaterVoiceEffect::onVoiceEffectChanged(bool new_effects) { - update(); + if (new_effects) + { + refreshEffectList(); + } + updateControls(); } void LLFloaterVoiceEffect::onClickRecord() @@ -219,11 +241,9 @@ void LLFloaterVoiceEffect::onClickRecord() LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); if (effect_interface) { - bool record = !effect_interface->isPreviewRecording(); - effect_interface->recordPreviewBuffer(record); - getChild("record_btn")->setVisible(!record); - getChild("record_stop_btn")->setVisible(record); + effect_interface->recordPreviewBuffer(); } + updateControls(); } void LLFloaterVoiceEffect::onClickPlay() @@ -239,11 +259,20 @@ void LLFloaterVoiceEffect::onClickPlay() LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); if (effect_interface) { - bool play = !effect_interface->isPreviewPlaying(); - effect_interface->playPreviewBuffer(play, effect_id); - getChild("play_btn")->setVisible(!play); - getChild("play_stop_btn")->setVisible(play); + effect_interface->playPreviewBuffer(effect_id); + } + updateControls(); +} + +void LLFloaterVoiceEffect::onClickStop() +{ + LL_DEBUGS("Voice") << "Stop clicked" << LL_ENDL; + LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); + if (effect_interface) + { + effect_interface->stopPreviewBuffer(); } + updateControls(); } void LLFloaterVoiceEffect::onClickAdd() -- cgit v1.2.3 From 6e98ca08300fad1fa8a4a5ab3996e1a6f8318564 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Sun, 23 May 2010 04:35:31 +0100 Subject: EXT-7337 WIP Voice morph previewing. Remove the activate button in the preview floater for now, it doesn't work in capture mode. Remove the remains of the play button. --- indra/newview/llfloatervoiceeffect.cpp | 45 ++++++++++++++++------------------ 1 file changed, 21 insertions(+), 24 deletions(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 0fa6135da2..1afea66d91 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -45,7 +45,7 @@ LLFloaterVoiceEffect::LLFloaterVoiceEffect(const LLSD& key) mCommitCallbackRegistrar.add("VoiceEffect.Play", boost::bind(&LLFloaterVoiceEffect::onClickPlay, this)); mCommitCallbackRegistrar.add("VoiceEffect.Stop", boost::bind(&LLFloaterVoiceEffect::onClickStop, this)); mCommitCallbackRegistrar.add("VoiceEffect.Add", boost::bind(&LLFloaterVoiceEffect::onClickAdd, this)); - mCommitCallbackRegistrar.add("VoiceEffect.Activate", boost::bind(&LLFloaterVoiceEffect::onClickActivate, this)); +// mCommitCallbackRegistrar.add("VoiceEffect.Activate", boost::bind(&LLFloaterVoiceEffect::onClickActivate, this)); } // virtual @@ -70,7 +70,7 @@ BOOL LLFloaterVoiceEffect::postBuild() if (mVoiceEffectList) { mVoiceEffectList->setCommitCallback(boost::bind(&LLFloaterVoiceEffect::onClickPlay, this)); - mVoiceEffectList->setDoubleClickCallback(boost::bind(&LLFloaterVoiceEffect::onClickActivate, this)); +// mVoiceEffectList->setDoubleClickCallback(boost::bind(&LLFloaterVoiceEffect::onClickActivate, this)); } LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); @@ -133,7 +133,7 @@ void LLFloaterVoiceEffect::refreshEffectList() element["columns"][0]["column"] = "name"; element["columns"][0]["value"] = getString("no_voice_effect"); element["columns"][0]["font"]["name"] = "SANSSERIF"; - element["columns"][0]["font"]["style"] = "BOLD"; + element["columns"][0]["font"]["style"] = "ITALIC"; LLScrollListItem* sl_item = mVoiceEffectList->addElement(element, ADD_BOTTOM); // *HACK: Copied from llfloatergesture.cpp : ["font"]["style"] does not affect font style :( @@ -152,9 +152,16 @@ void LLFloaterVoiceEffect::refreshEffectList() std::string effect_name = it->first; LLSD effect_properties = effect_interface->getVoiceEffectProperties(effect_id); + + // Tag the active effect. + if (effect_id == LLVoiceClient::instance().getVoiceEffectDefault()) + { + effect_name += " " + getString("active_voice_effect"); + } + + std::string expiry_date = effect_properties["expiry_date"].asString(); bool is_template_only = effect_properties["template_only"].asBoolean(); bool is_new = effect_properties["is_new"].asBoolean(); - std::string expiry_date = effect_properties["expiry_date"].asString(); std::string font_style = "NORMAL"; if (!is_template_only) @@ -168,6 +175,7 @@ void LLFloaterVoiceEffect::refreshEffectList() element["columns"][0]["value"] = effect_name; element["columns"][0]["font"]["name"] = "SANSSERIF"; element["columns"][0]["font"]["style"] = font_style; + element["columns"][1]["column"] = "new"; element["columns"][1]["value"] = is_new ? getString("new_voice_effect") : ""; element["columns"][1]["font"]["name"] = "SANSSERIF"; @@ -194,8 +202,6 @@ void LLFloaterVoiceEffect::refreshEffectList() mVoiceEffectList->selectByID(*it); } mVoiceEffectList->setScrollPos(scroll_pos); - - mVoiceEffectList->setValue(effect_interface->getVoiceEffect()); mVoiceEffectList->setEnabled(true); } @@ -213,16 +219,6 @@ void LLFloaterVoiceEffect::updateControls() getChild("record_btn")->setVisible(!recording); getChild("record_stop_btn")->setVisible(recording); - - getChild("play_btn")->setVisible(!playing); - getChild("play_stop_btn")->setVisible(playing); - - getChild("play_btn")->setEnabled(effect_interface->isPreviewReady()); - - if (!mVoiceEffectList) - { - mVoiceEffectList->setValue(effect_interface->getVoiceEffect()); - } } // virtual @@ -281,11 +277,12 @@ void LLFloaterVoiceEffect::onClickAdd() 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()); - } -} +//void LLFloaterVoiceEffect::onClickActivate() +//{ +// LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); +// if (effect_interface && mVoiceEffectList) +// { +// effect_interface->setVoiceEffect(mVoiceEffectList->getCurrentID()); +// } +//} + -- cgit v1.2.3 From 234b3edc26db7cf87a11fc16d9720bf4a9c20177 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Sun, 23 May 2010 14:11:48 +0100 Subject: EXT-7337 WIP Added explanatory note to the voice morph preview floater --- indra/newview/llfloatervoiceeffect.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 1afea66d91..49dd6fa4d9 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -65,6 +65,8 @@ LLFloaterVoiceEffect::~LLFloaterVoiceEffect() BOOL LLFloaterVoiceEffect::postBuild() { setDefaultBtn("record_btn"); + getChild("record_btn")->setFocus(true); + mVoiceEffectList = getChild("voice_effect_list"); if (mVoiceEffectList) -- cgit v1.2.3 From 08e610adfa8124fa7b990f952ad3053b955b62d3 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Sun, 23 May 2010 19:44:30 +0100 Subject: EXT-7335 WIP Parse Vivox voice font expiry timestamps into ISO 8601 standard dates. --- indra/newview/llfloatervoiceeffect.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 49dd6fa4d9..38c419ab24 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -161,7 +161,7 @@ void LLFloaterVoiceEffect::refreshEffectList() effect_name += " " + getString("active_voice_effect"); } - std::string expiry_date = effect_properties["expiry_date"].asString(); + LLDate expiry_date = effect_properties["expiry_date"].asDate(); bool is_template_only = effect_properties["template_only"].asBoolean(); bool is_new = effect_properties["is_new"].asBoolean(); @@ -184,7 +184,13 @@ void LLFloaterVoiceEffect::refreshEffectList() element["columns"][1]["font"]["style"] = font_style; element["columns"][2]["column"] = "expires"; - element["columns"][2]["value"] = !is_template_only ? expiry_date : ""; + if (!is_template_only) + { + element["columns"][2]["value"] = expiry_date; + } + else { + element["columns"][2]["value"] = ""; + } element["columns"][2]["font"]["name"] = "SANSSERIF"; element["columns"][2]["font"]["style"] = font_style; -- cgit v1.2.3 From 12171ddba3c70b73e53bf103a45779262b38c6ec Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Mon, 24 May 2010 00:20:03 +0100 Subject: EXT-7336 WIP Move the Voice Morphing marketing URL into strings.xml so it can be used in notifications as well. --- indra/newview/llfloatervoiceeffect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 38c419ab24..e30a50fab7 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -282,7 +282,7 @@ void LLFloaterVoiceEffect::onClickStop() void LLFloaterVoiceEffect::onClickAdd() { // Open the voice morphing info web page - LLWeb::loadURL(getString("get_voice_effects_url")); + LLWeb::loadURL(LLTrans::getString("voice_morphing_url")); } //void LLFloaterVoiceEffect::onClickActivate() -- cgit v1.2.3 From 15c3b2c6309fa4b45376f3d62e33bfcd3ccdbfc7 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Mon, 24 May 2010 02:27:07 +0100 Subject: EXT-7335 WIP Added notification of expiring voice effects --- indra/newview/llfloatervoiceeffect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index e30a50fab7..f31ab96985 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -230,9 +230,9 @@ void LLFloaterVoiceEffect::updateControls() } // virtual -void LLFloaterVoiceEffect::onVoiceEffectChanged(bool new_effects) +void LLFloaterVoiceEffect::onVoiceEffectChanged(bool effect_list_updated) { - if (new_effects) + if (effect_list_updated) { refreshEffectList(); } -- cgit v1.2.3 From a48c8a3aca6f2c174e2d49b26a63946a1bf4cea7 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Mon, 24 May 2010 16:30:22 +0100 Subject: EXT-7138 WIP More tidying up after the removal of the play button in the voice effect preview. --- indra/newview/llfloatervoiceeffect.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index f31ab96985..bd469a85da 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -216,13 +216,11 @@ void LLFloaterVoiceEffect::refreshEffectList() void LLFloaterVoiceEffect::updateControls() { bool recording = false; - bool playing = false; LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); if (effect_interface) { recording = effect_interface->isPreviewRecording(); - playing = effect_interface->isPreviewPlaying(); } getChild("record_btn")->setVisible(!recording); -- cgit v1.2.3 From cf34437506cabdc54466cdf5010979a61a99154b Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Mon, 24 May 2010 21:29:09 +0100 Subject: EXT-7337 WIP Rearrange controls in the voice morphing preview. Added link to marketing page. --- indra/newview/llfloatervoiceeffect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index bd469a85da..9529f947c1 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -66,7 +66,7 @@ BOOL LLFloaterVoiceEffect::postBuild() { setDefaultBtn("record_btn"); getChild("record_btn")->setFocus(true); - + childSetTextArg("voice_morphing_link", "[URL]", LLTrans::getString("voice_morphing_url")); mVoiceEffectList = getChild("voice_effect_list"); if (mVoiceEffectList) -- cgit v1.2.3 From 563ae1c7e029ceef2aed0b85623c2f0a95d38b46 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Tue, 25 May 2010 02:47:28 +0100 Subject: EXT-7337 WIP Replace the new column with a (New!) tag after the voice effect name --- indra/newview/llfloatervoiceeffect.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 9529f947c1..46356cf161 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -145,6 +145,7 @@ void LLFloaterVoiceEffect::refreshEffectList() } } + // Add each Voice Effect template, if there are any (template list includes all usable effects) const voice_effect_list_t& template_list = effect_interface->getVoiceEffectTemplateList(); if (!template_list.empty()) { @@ -161,15 +162,21 @@ void LLFloaterVoiceEffect::refreshEffectList() effect_name += " " + getString("active_voice_effect"); } + // Tag available effects that are new this session + if (effect_properties["is_new"].asBoolean()) + { + effect_name += " " + getString("new_voice_effect"); + } + LLDate expiry_date = effect_properties["expiry_date"].asDate(); bool is_template_only = effect_properties["template_only"].asBoolean(); - bool is_new = effect_properties["is_new"].asBoolean(); std::string font_style = "NORMAL"; if (!is_template_only) { font_style = "BOLD"; } + LLSD element; element["id"] = effect_id; @@ -178,21 +185,16 @@ void LLFloaterVoiceEffect::refreshEffectList() element["columns"][0]["font"]["name"] = "SANSSERIF"; element["columns"][0]["font"]["style"] = font_style; - element["columns"][1]["column"] = "new"; - element["columns"][1]["value"] = is_new ? getString("new_voice_effect") : ""; - element["columns"][1]["font"]["name"] = "SANSSERIF"; - element["columns"][1]["font"]["style"] = font_style; - - element["columns"][2]["column"] = "expires"; + element["columns"][1]["column"] = "expires"; if (!is_template_only) { - element["columns"][2]["value"] = expiry_date; + element["columns"][1]["value"] = expiry_date; } else { - element["columns"][2]["value"] = ""; + element["columns"][1]["value"] = ""; } - element["columns"][2]["font"]["name"] = "SANSSERIF"; - element["columns"][2]["font"]["style"] = font_style; + element["columns"][1]["font"]["name"] = "SANSSERIF"; + element["columns"][1]["font"]["style"] = font_style; LLScrollListItem* sl_item = mVoiceEffectList->addElement(element, ADD_BOTTOM); // *HACK: Copied from llfloatergesture.cpp : ["font"]["style"] does not affect font style :( -- cgit v1.2.3 From 3e85291fee01680f465198d895d12fef733b146c Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Tue, 25 May 2010 03:36:36 +0100 Subject: EXT-7337 WIP Further tweaking of Voice Effect preview layout --- indra/newview/llfloatervoiceeffect.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 46356cf161..b47d562995 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -189,19 +189,20 @@ void LLFloaterVoiceEffect::refreshEffectList() if (!is_template_only) { element["columns"][1]["value"] = expiry_date; + element["columns"][1]["type"] = "date"; } else { element["columns"][1]["value"] = ""; } element["columns"][1]["font"]["name"] = "SANSSERIF"; - element["columns"][1]["font"]["style"] = font_style; + element["columns"][1]["font"]["style"] = "NORMAL"; LLScrollListItem* sl_item = mVoiceEffectList->addElement(element, ADD_BOTTOM); // *HACK: Copied from llfloatergesture.cpp : ["font"]["style"] does not affect font style :( if(sl_item) { LLFontGL::StyleFlags style = is_template_only ? LLFontGL::NORMAL : LLFontGL::BOLD; - ((LLScrollListText*)sl_item->getColumn(0))->setFontStyle(style); + dynamic_cast(sl_item->getColumn(0))->setFontStyle(style); } } } -- cgit v1.2.3 From d821d371e30cb7fcf32b6fae12ef4557e729bca3 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Thu, 27 May 2010 11:41:07 +0100 Subject: EXT-7138 WIP Removed now redundant onClickAdd callback from the Voice Effect preview floater. Cleaned up comments. --- indra/newview/llfloatervoiceeffect.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index b47d562995..d27adfcea1 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -1,5 +1,6 @@ /** * @file llfloatervoiceeffect.cpp + * @author Aimee * @brief Selection and preview of voice effect. * * $LicenseInfo:firstyear=2010&license=viewergpl$ @@ -44,7 +45,6 @@ LLFloaterVoiceEffect::LLFloaterVoiceEffect(const LLSD& key) mCommitCallbackRegistrar.add("VoiceEffect.Record", boost::bind(&LLFloaterVoiceEffect::onClickRecord, this)); mCommitCallbackRegistrar.add("VoiceEffect.Play", boost::bind(&LLFloaterVoiceEffect::onClickPlay, this)); mCommitCallbackRegistrar.add("VoiceEffect.Stop", boost::bind(&LLFloaterVoiceEffect::onClickStop, this)); - mCommitCallbackRegistrar.add("VoiceEffect.Add", boost::bind(&LLFloaterVoiceEffect::onClickAdd, this)); // mCommitCallbackRegistrar.add("VoiceEffect.Activate", boost::bind(&LLFloaterVoiceEffect::onClickActivate, this)); } @@ -280,12 +280,6 @@ void LLFloaterVoiceEffect::onClickStop() updateControls(); } -void LLFloaterVoiceEffect::onClickAdd() -{ - // Open the voice morphing info web page - LLWeb::loadURL(LLTrans::getString("voice_morphing_url")); -} - //void LLFloaterVoiceEffect::onClickActivate() //{ // LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); -- cgit v1.2.3 From 485f9abde6b728a923070e392e40c16ea9f05226 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Thu, 27 May 2010 12:53:53 +0100 Subject: EXT-7138 WIP Changed UI text to use "Voice Morph" everywhere instead of "Voice Effect". Revised wording in preview floater (DEV-50573). Added tool-tip for Voice Morphing control in Nearby Voice (DEV-50608). --- indra/newview/llfloatervoiceeffect.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index d27adfcea1..22392dca8b 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -114,7 +114,7 @@ void LLFloaterVoiceEffect::refreshEffectList() return; } - LL_DEBUGS("Voice")<< "Rebuilding voice effect list."<< LL_ENDL; + LL_DEBUGS("Voice")<< "Rebuilding Voice Morph list."<< LL_ENDL; // Preserve selected items and scroll position S32 scroll_pos = mVoiceEffectList->getScrollPos(); @@ -128,7 +128,7 @@ void LLFloaterVoiceEffect::refreshEffectList() mVoiceEffectList->deleteAllItems(); { - // Add the "No Voice Effect" entry + // Add the "No Voice Morph" entry LLSD element; element["id"] = LLUUID::null; @@ -145,7 +145,7 @@ void LLFloaterVoiceEffect::refreshEffectList() } } - // Add each Voice Effect template, if there are any (template list includes all usable effects) + // Add each Voice Morph template, if there are any (template list includes all usable effects) const voice_effect_list_t& template_list = effect_interface->getVoiceEffectTemplateList(); if (!template_list.empty()) { -- cgit v1.2.3 From 9fa2447c59f6f0ff44b2127576af91f9b864f7aa Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Thu, 27 May 2010 13:58:11 +0100 Subject: EXT-7138 WIP Kill the magic column numbers! Remove hardcoded font selections. --- indra/newview/llfloatervoiceeffect.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 22392dca8b..2243f0bf9a 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -132,10 +132,9 @@ void LLFloaterVoiceEffect::refreshEffectList() LLSD element; element["id"] = LLUUID::null; - element["columns"][0]["column"] = "name"; - element["columns"][0]["value"] = getString("no_voice_effect"); - element["columns"][0]["font"]["name"] = "SANSSERIF"; - element["columns"][0]["font"]["style"] = "ITALIC"; + element["columns"][NAME_COLUMN]["column"] = "name"; + element["columns"][NAME_COLUMN]["value"] = getString("no_voice_effect"); + element["columns"][NAME_COLUMN]["font"]["style"] = "BOLD"; LLScrollListItem* sl_item = mVoiceEffectList->addElement(element, ADD_BOTTOM); // *HACK: Copied from llfloatergesture.cpp : ["font"]["style"] does not affect font style :( @@ -180,22 +179,20 @@ void LLFloaterVoiceEffect::refreshEffectList() LLSD element; element["id"] = effect_id; - element["columns"][0]["column"] = "name"; - element["columns"][0]["value"] = effect_name; - element["columns"][0]["font"]["name"] = "SANSSERIF"; - element["columns"][0]["font"]["style"] = font_style; + element["columns"][NAME_COLUMN]["column"] = "name"; + element["columns"][NAME_COLUMN]["value"] = effect_name; + element["columns"][NAME_COLUMN]["font"]["style"] = font_style; element["columns"][1]["column"] = "expires"; if (!is_template_only) { - element["columns"][1]["value"] = expiry_date; - element["columns"][1]["type"] = "date"; + element["columns"][DATE_COLUMN]["value"] = expiry_date; + element["columns"][DATE_COLUMN]["type"] = "date"; } else { - element["columns"][1]["value"] = ""; + element["columns"][DATE_COLUMN]["value"] = ""; } - element["columns"][1]["font"]["name"] = "SANSSERIF"; - element["columns"][1]["font"]["style"] = "NORMAL"; +// element["columns"][DATE_COLUMN]["font"]["style"] = "NORMAL"; LLScrollListItem* sl_item = mVoiceEffectList->addElement(element, ADD_BOTTOM); // *HACK: Copied from llfloatergesture.cpp : ["font"]["style"] does not affect font style :( -- cgit v1.2.3 From 6c3c9c249304d03b86bf703d27b510f6bcc16189 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Thu, 27 May 2010 16:45:29 +0100 Subject: EXT-7138 WIP Indicate unsubscribed Voice Morphs with (Unsubscribed) in the expiry date column. --- indra/newview/llfloatervoiceeffect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloatervoiceeffect.cpp') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 2243f0bf9a..ca1f142760 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -190,7 +190,7 @@ void LLFloaterVoiceEffect::refreshEffectList() element["columns"][DATE_COLUMN]["type"] = "date"; } else { - element["columns"][DATE_COLUMN]["value"] = ""; + element["columns"][DATE_COLUMN]["value"] = getString("unsubscribed_voice_effect"); } // element["columns"][DATE_COLUMN]["font"]["style"] = "NORMAL"; -- cgit v1.2.3