From 200889bd4b2bef9812051ea644d229d1b40faf30 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Thu, 13 May 2010 14:59:27 +0100 Subject: EXT-7336 WIP Open the Voice Morphing marketing page from the voice font UI Temporarily points at https://secondlife.com/my/account/voice.php until a proper URL is allocated. --- indra/newview/llpanelvoiceeffect.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llpanelvoiceeffect.cpp') diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp index 4de1fffef9..4d694c1be0 100644 --- a/indra/newview/llpanelvoiceeffect.cpp +++ b/indra/newview/llpanelvoiceeffect.cpp @@ -92,6 +92,7 @@ void LLPanelVoiceEffect::onCommitVoiceEffect() if (value.asInteger() == GET_VOICE_EFFECTS) { LL_DEBUGS("Voice") << "GET VOICE FONTS!" << LL_ENDL; + LLWeb::loadURL(getString("get_voice_effects_url")); } else if (value.asInteger() == PREVIEW_VOICE_EFFECTS) { -- cgit v1.3 From 009db32afecd7e95e6dd37cb8b9899829783a5d4 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Fri, 14 May 2010 13:11:18 +0100 Subject: EXT-7138 WIP added a refreshVoiceEffectLists() method to LLVoiceEffectInterface --- indra/newview/llpanelvoiceeffect.cpp | 2 +- indra/newview/llpanelvoiceeffect.h | 2 +- indra/newview/llvoiceclient.h | 3 +- indra/newview/llvoicevivox.cpp | 74 +++++++++++++++++++----------------- indra/newview/llvoicevivox.h | 6 ++- 5 files changed, 49 insertions(+), 38 deletions(-) (limited to 'indra/newview/llpanelvoiceeffect.cpp') diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp index 4d694c1be0..c51ec91b66 100644 --- a/indra/newview/llpanelvoiceeffect.cpp +++ b/indra/newview/llpanelvoiceeffect.cpp @@ -107,7 +107,7 @@ void LLPanelVoiceEffect::onCommitVoiceEffect() } // virtual -void LLPanelVoiceEffect::onVoiceEffectChanged() +void LLPanelVoiceEffect::onVoiceEffectChanged(bool new_effects) { update(); } diff --git a/indra/newview/llpanelvoiceeffect.h b/indra/newview/llpanelvoiceeffect.h index f1a746e288..3ecdcb0d8a 100644 --- a/indra/newview/llpanelvoiceeffect.h +++ b/indra/newview/llpanelvoiceeffect.h @@ -56,7 +56,7 @@ private: void update(); /// Called by voice effect provider when voice effect list is changed. - virtual void onVoiceEffectChanged(); + virtual void onVoiceEffectChanged(bool new_effects); // Fixed entries in the voice effect list typedef enum e_voice_effect_combo_items diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 44da7bcf93..d4f1423f00 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -266,7 +266,7 @@ class LLVoiceEffectObserver { public: virtual ~LLVoiceEffectObserver() { } - virtual void onVoiceEffectChanged() = 0; + virtual void onVoiceEffectChanged(bool new_effects) = 0; }; typedef std::multimap voice_effect_list_t; @@ -290,6 +290,7 @@ public: virtual bool setVoiceEffect(const LLUUID& id) = 0; virtual const LLUUID getVoiceEffect() = 0; + virtual void refreshVoiceEffectLists(bool clear_lists) = 0; virtual const voice_effect_list_t &getVoiceEffectList() const = 0; virtual const voice_effect_list_t &getVoiceEffectTemplateList() const = 0; //@} diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index a2ea21056d..aa2fa45b6d 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -337,10 +337,10 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() : mVoiceEnabled(false), mWriteInProgress(false), - mLipSyncEnabled(false) - - + mLipSyncEnabled(false), + mVoiceFontsReceived(false), + mVoiceFontsNew(false) { mSpeakerVolume = scale_speaker_volume(0); @@ -1220,13 +1220,12 @@ void LLVivoxVoiceClient::stateMachine() { // request the set of available voice fonts setState(stateVoiceFontsWait); - accountGetSessionFontsSendMessage(); + refreshVoiceEffectLists(true); } else { setState(stateVoiceFontsReceived); } - accountGetTemplateFontsSendMessage(); // *TODO: Maybe better to do this only when opening preview rather than on login // request the current set of block rules (we'll need them when updating the friends list) accountListBlockRulesSendMessage(); @@ -6317,7 +6316,8 @@ LLVivoxVoiceClient::voiceFontEntry::voiceFontEntry(LLUUID& id) : mFontIndex(0), mHasExpired(false), mFontType(VOICE_FONT_TYPE_NONE), - mFontStatus(VOICE_FONT_STATUS_NONE) + mFontStatus(VOICE_FONT_STATUS_NONE), + mIsNew(false) { } @@ -6325,6 +6325,19 @@ LLVivoxVoiceClient::voiceFontEntry::~voiceFontEntry() { } +void LLVivoxVoiceClient::refreshVoiceEffectLists(bool clear_lists) +{ + if (clear_lists) + { + mVoiceFontsReceived = false; + deleteVoiceFonts(); + deleteVoiceFontTemplates(); + } + + accountGetSessionFontsSendMessage(); + accountGetTemplateFontsSendMessage(); +} + void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, const std::string &name, const std::string &description, @@ -6337,7 +6350,7 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, // Vivox SessionFontIDs are not guaranteed to remain the same between // sessions or grids so use a UUID for the name. - // If received name is not a UUID, fudge one by hashing the name and type + // If received name is not a UUID, fudge one by hashing the name and type. LLUUID font_id; if (LLUUID::validate(name)) { @@ -6353,38 +6366,36 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, voice_font_map_t& font_map = template_font ? mVoiceFontTemplateMap : mVoiceFontMap; voice_effect_list_t& font_list = template_font ? mVoiceFontTemplateList : mVoiceFontList; - // Hopefully won't happen, but behave gracefully if there is a duplicate - // by Replacing the previous one unless this one has expired. - // *TODO: Should maybe check for the later expiry date if neither has - // expired, and favour user fonts over root fonts? But as we shouldn't - // have duplicates anyway, it's probably not worth the effort. + // Check whether we've seen this font before and create an entry for it if not. voice_font_map_t::iterator iter = font_map.find(font_id); - bool duplicate = (iter != font_map.end()); - if (duplicate) + bool new_font = (iter == font_map.end()); + if (new_font) { - LL_DEBUGS("Voice") << "Voice font " << font_index << " duplicates " << iter->second->mFontIndex << "!" << LL_ENDL; - - if (!has_expired) - { - font = iter->second; - } + font = new voiceFontEntry(font_id); } else { - font = new voiceFontEntry(font_id); + font = iter->second; } if (font) { font->mFontIndex = font_index; // Use the description for the human readable name if available, as the - // "name" will probably be a UUID. + // "name" may be a UUID. font->mName = description.empty() ? name : description; font->mExpirationDate = expiration_date; font->mHasExpired = has_expired; font->mFontType = font_type; font->mFontStatus = font_status; + // Only flag it as a new font if we have already seen the font list. + if (!template_font && mVoiceFontsReceived && new_font) + { + font->mIsNew = true; + mVoiceFontsNew = true; + } + LL_DEBUGS("Voice") << (template_font?"Template: ":"") << font_id << " (" << font_index << ") : " << name << (has_expired?" (Expired)":"") << LL_ENDL; @@ -6398,7 +6409,7 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, LL_DEBUGS("Voice") << "Unknown voice font status: " << font_status << LL_ENDL; } - if (!duplicate) + if (new_font) { font_map.insert(voice_font_map_t::value_type(font->mID, font)); font_list.insert(voice_effect_list_t::value_type(font->mName, font->mID)); @@ -6507,7 +6518,10 @@ void LLVivoxVoiceClient::accountGetSessionFontsResponse(int statusCode, const st { setState(stateVoiceFontsReceived); } - notifyVoiceFontObservers(); + mVoiceFontsReceived = true; + + notifyVoiceFontObservers(mVoiceFontsNew); + mVoiceFontsNew = false; } void LLVivoxVoiceClient::accountGetTemplateFontsResponse(int statusCode, const std::string &statusString) @@ -6525,14 +6539,14 @@ void LLVivoxVoiceClient::removeObserver(LLVoiceEffectObserver* observer) mVoiceFontObservers.erase(observer); } -void LLVivoxVoiceClient::notifyVoiceFontObservers() +void LLVivoxVoiceClient::notifyVoiceFontObservers(bool new_fonts) { for (voice_font_observer_set_t::iterator it = mVoiceFontObservers.begin(); it != mVoiceFontObservers.end(); ) { LLVoiceEffectObserver* observer = *it; - observer->onVoiceEffectChanged(); + observer->onVoiceEffectChanged(new_fonts); // In case onVoiceEffectChanged() deleted an entry. it = mVoiceFontObservers.upper_bound(observer); } @@ -6755,10 +6769,6 @@ void LLVivoxProtocolParser::StartTag(const char *tag, const char **attr) { LLVivoxVoiceClient::getInstance()->deleteAllAutoAcceptRules(); } - else if (!stricmp("SessionFonts", tag)) - { - LLVivoxVoiceClient::getInstance()->deleteVoiceFonts(); - } else if (!stricmp("SessionFont", tag)) { id = 0; @@ -6769,10 +6779,6 @@ void LLVivoxProtocolParser::StartTag(const char *tag, const char **attr) fontType = 0; fontStatus = 0; } - else if (!stricmp("TemplateFonts", tag)) - { - LLVivoxVoiceClient::getInstance()->deleteVoiceFontTemplates(); - } else if (!stricmp("TemplateFont", tag)) { id = 0; diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 4d18a897c7..fcf8eaf3e9 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -241,6 +241,7 @@ public: virtual bool setVoiceEffect(const LLUUID& id); virtual const LLUUID getVoiceEffect(); + virtual void refreshVoiceEffectLists(bool clear_lists); virtual const voice_effect_list_t &getVoiceEffectList() const { return mVoiceFontList; }; virtual const voice_effect_list_t &getVoiceEffectTemplateList() const { return mVoiceFontTemplateList; }; //@} @@ -848,7 +849,7 @@ private: void accountGetTemplateFontsSendMessage(); void sessionSetVoiceFontSendMessage(sessionState *session); - void notifyVoiceFontObservers(); + void notifyVoiceFontObservers(bool new_fonts = false); typedef enum e_voice_font_type { @@ -878,8 +879,11 @@ private: bool mHasExpired; S32 mFontType; S32 mFontStatus; + bool mIsNew; }; + bool mVoiceFontsReceived; + bool mVoiceFontsNew; voice_effect_list_t mVoiceFontList; voice_effect_list_t mVoiceFontTemplateList; -- cgit v1.3 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/CMakeLists.txt | 2 + indra/newview/llfloatervoiceeffect.cpp | 172 +++++++++++++++++++++ indra/newview/llfloatervoiceeffect.h | 69 +++++++++ indra/newview/llpanelvoiceeffect.cpp | 10 +- indra/newview/llviewerfloaterreg.cpp | 4 +- .../skins/default/xui/en/floater_voice_effect.xml | 123 +++++++++++++++ 6 files changed, 375 insertions(+), 5 deletions(-) create mode 100644 indra/newview/llfloatervoiceeffect.cpp create mode 100644 indra/newview/llfloatervoiceeffect.h create mode 100644 indra/newview/skins/default/xui/en/floater_voice_effect.xml (limited to 'indra/newview/llpanelvoiceeffect.cpp') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f2a2a129f8..d400510b91 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -214,6 +214,7 @@ set(viewer_SOURCE_FILES llfloaterurldisplay.cpp llfloaterurlentry.cpp llfloatervoicedevicesettings.cpp + llfloatervoiceeffect.cpp llfloaterwater.cpp llfloaterwhitelistentry.cpp llfloaterwindlight.cpp @@ -731,6 +732,7 @@ set(viewer_HEADER_FILES llfloaterurldisplay.h llfloaterurlentry.h llfloatervoicedevicesettings.h + llfloatervoiceeffect.h llfloaterwater.h llfloaterwhitelistentry.h llfloaterwindlight.h 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); + } +} diff --git a/indra/newview/llfloatervoiceeffect.h b/indra/newview/llfloatervoiceeffect.h new file mode 100644 index 0000000000..cd639dba5a --- /dev/null +++ b/indra/newview/llfloatervoiceeffect.h @@ -0,0 +1,69 @@ +/** + * @file llfloatervoiceeffect.h + * @brief Selection and preview of voice effects. + * + * $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$ + */ + +#ifndef LL_LLFLOATERVOICEEFFECT_H +#define LL_LLFLOATERVOICEEFFECT_H + +#include "llfloater.h" +#include "llvoiceclient.h" + +class LLButton; +class LLScrollListCtrl; + +class LLFloaterVoiceEffect + : public LLFloater + , public LLVoiceEffectObserver +{ +public: + LOG_CLASS(LLFloaterVoiceEffect); + + LLFloaterVoiceEffect(const LLSD& key); + virtual ~LLFloaterVoiceEffect(); + + virtual BOOL postBuild(); + virtual void onClose(bool app_quitting); + +private: + void update(); + + /// Called by voice effect provider when voice effect list is changed. + virtual void onVoiceEffectChanged(bool new_effects); + + void onClickRecord(); + void onClickPlay(); +// void onClickActivate(); + + LLUUID mSelectedID; + LLScrollListCtrl* mVoiceEffectList; +}; + +#endif diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp index c51ec91b66..6210fc7cc7 100644 --- a/indra/newview/llpanelvoiceeffect.cpp +++ b/indra/newview/llpanelvoiceeffect.cpp @@ -36,8 +36,8 @@ #include "llpanelvoiceeffect.h" #include "llcombobox.h" +#include "llfloaterreg.h" #include "llpanel.h" -#include "llvoicechannel.h" #include "llvoiceclient.h" static LLRegisterPanelClassWrapper t_panel_voice_effect("panel_voice_effect"); @@ -64,7 +64,6 @@ LLPanelVoiceEffect::~LLPanelVoiceEffect() BOOL LLPanelVoiceEffect::postBuild() { mVoiceEffectCombo = getChild("voice_effect"); - update(); LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); if (effect_interface) @@ -72,6 +71,8 @@ BOOL LLPanelVoiceEffect::postBuild() effect_interface->addObserver(this); } + update(); + return TRUE; } @@ -91,12 +92,13 @@ void LLPanelVoiceEffect::onCommitVoiceEffect() LLSD value = mVoiceEffectCombo->getValue(); if (value.asInteger() == GET_VOICE_EFFECTS) { - LL_DEBUGS("Voice") << "GET VOICE FONTS!" << LL_ENDL; + // Open the voice morphing info web page LLWeb::loadURL(getString("get_voice_effects_url")); } else if (value.asInteger() == PREVIEW_VOICE_EFFECTS) { - LL_DEBUGS("Voice") << "PREVIEW VOICE FONTS!" << LL_ENDL; + // Open the voice effects management floater + LLFloaterReg::showInstance("voice_effect"); } else { diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 506cebfe73..c4a5d6e3fd 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -102,6 +102,7 @@ #include "llfloateruipreview.h" #include "llfloaterurldisplay.h" #include "llfloatervoicedevicesettings.h" +#include "llfloatervoiceeffect.h" #include "llfloaterwater.h" #include "llfloaterwhitelistentry.h" #include "llfloaterwindlight.h" @@ -253,7 +254,8 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("upload_sound", "floater_sound_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build, "upload"); LLFloaterReg::add("voice_controls", "floater_voice_controls.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - + LLFloaterReg::add("voice_effect", "floater_voice_effect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("whitelist_entry", "floater_whitelist_entry.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterWindowSizeUtil::registerFloater(); LLFloaterReg::add("world_map", "floater_world_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/skins/default/xui/en/floater_voice_effect.xml b/indra/newview/skins/default/xui/en/floater_voice_effect.xml new file mode 100644 index 0000000000..5627eb3aff --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml @@ -0,0 +1,123 @@ + + + + No Voice Effect + + + + + + + + + + + + + + + -- cgit v1.3 From b0b07b9438a8c90e4f8f68743310354b28583d5e Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Thu, 20 May 2010 22:55:47 +0100 Subject: EXT-7138 WIP Voice Morphing - Reselect "No voice effect" correctly in the voice effect combo if "Preview" or "Add effects" is chosen while no effects are enabled. --- indra/newview/llpanelvoiceeffect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelvoiceeffect.cpp') diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp index 6210fc7cc7..daafb451e0 100644 --- a/indra/newview/llpanelvoiceeffect.cpp +++ b/indra/newview/llpanelvoiceeffect.cpp @@ -126,7 +126,7 @@ void LLPanelVoiceEffect::update() } mVoiceEffectCombo->removeall(); - mVoiceEffectCombo->add(getString("no_voice_effect"), NO_VOICE_EFFECT); + mVoiceEffectCombo->add(getString("no_voice_effect"), LLUUID::null); mVoiceEffectCombo->addSeparator(); const voice_effect_list_t& effect_list = effect_interface->getVoiceEffectList(); -- cgit v1.3 From 05157c9985d955bb62c9ef897cee6298500c762d Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Sat, 22 May 2010 15:24:08 +0100 Subject: EXT-7138 WIP Voice Morphing Updated "Preview Voice Morphing" and "Get Voice Morphing" items in the Voice Effect combo --- indra/newview/llpanelvoiceeffect.cpp | 14 +++++++------- indra/newview/llpanelvoiceeffect.h | 4 ++-- .../newview/skins/default/xui/en/floater_voice_effect.xml | 2 +- indra/newview/skins/default/xui/en/panel_voice_effect.xml | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'indra/newview/llpanelvoiceeffect.cpp') diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp index daafb451e0..915d547056 100644 --- a/indra/newview/llpanelvoiceeffect.cpp +++ b/indra/newview/llpanelvoiceeffect.cpp @@ -90,16 +90,16 @@ void LLPanelVoiceEffect::onCommitVoiceEffect() } LLSD value = mVoiceEffectCombo->getValue(); - if (value.asInteger() == GET_VOICE_EFFECTS) - { - // Open the voice morphing info web page - LLWeb::loadURL(getString("get_voice_effects_url")); - } - else if (value.asInteger() == PREVIEW_VOICE_EFFECTS) + if (value.asInteger() == PREVIEW_VOICE_EFFECTS) { // Open the voice effects management floater LLFloaterReg::showInstance("voice_effect"); } + else if (value.asInteger() == GET_VOICE_EFFECTS) + { + // Open the voice morphing info web page + LLWeb::loadURL(getString("get_voice_effects_url")); + } else { effect_interface->setVoiceEffect(value.asUUID()); @@ -140,8 +140,8 @@ void LLPanelVoiceEffect::update() mVoiceEffectCombo->addSeparator(); } - mVoiceEffectCombo->add(getString("get_voice_effects"), GET_VOICE_EFFECTS); mVoiceEffectCombo->add(getString("preview_voice_effects"), PREVIEW_VOICE_EFFECTS); + mVoiceEffectCombo->add(getString("get_voice_effects"), GET_VOICE_EFFECTS); mVoiceEffectCombo->setValue(effect_interface->getVoiceEffect()); mVoiceEffectCombo->setEnabled(true); diff --git a/indra/newview/llpanelvoiceeffect.h b/indra/newview/llpanelvoiceeffect.h index 3ecdcb0d8a..008123a4e4 100644 --- a/indra/newview/llpanelvoiceeffect.h +++ b/indra/newview/llpanelvoiceeffect.h @@ -62,8 +62,8 @@ private: typedef enum e_voice_effect_combo_items { NO_VOICE_EFFECT = 0, - GET_VOICE_EFFECTS = 1, - PREVIEW_VOICE_EFFECTS = 2 + PREVIEW_VOICE_EFFECTS = 1, + GET_VOICE_EFFECTS = 2 } EVoiceEffectComboItems; LLComboBox* mVoiceEffectCombo; 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 82f816fec1..d869f6c610 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml @@ -5,7 +5,7 @@ height="465" name="voice_effects" help_topic="voice_effects" - title="VOICE EFFECTS" + title="PREVIEW VOICE MORPHING" background_visible="true" follows="all" label="Places" diff --git a/indra/newview/skins/default/xui/en/panel_voice_effect.xml b/indra/newview/skins/default/xui/en/panel_voice_effect.xml index dbcb7b64f7..9e5652d1e2 100644 --- a/indra/newview/skins/default/xui/en/panel_voice_effect.xml +++ b/indra/newview/skins/default/xui/en/panel_voice_effect.xml @@ -11,11 +11,11 @@ http://secondlife.com/landing/v0icem0rphingt3st - - Add voice effects ▶ - - Preview ▶ + Preview Voice Morphing ▶ + + + Get Voice Morphing ▶ 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 +- indra/newview/llpanelvoiceeffect.cpp | 3 ++- indra/newview/skins/default/xui/en/floater_voice_effect.xml | 3 --- indra/newview/skins/default/xui/en/panel_voice_effect.xml | 3 --- indra/newview/skins/default/xui/en/strings.xml | 10 ++++++---- 5 files changed, 9 insertions(+), 12 deletions(-) (limited to 'indra/newview/llpanelvoiceeffect.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() diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp index 915d547056..140feb7a54 100644 --- a/indra/newview/llpanelvoiceeffect.cpp +++ b/indra/newview/llpanelvoiceeffect.cpp @@ -38,6 +38,7 @@ #include "llcombobox.h" #include "llfloaterreg.h" #include "llpanel.h" +#include "lltrans.h" #include "llvoiceclient.h" static LLRegisterPanelClassWrapper t_panel_voice_effect("panel_voice_effect"); @@ -98,7 +99,7 @@ void LLPanelVoiceEffect::onCommitVoiceEffect() else if (value.asInteger() == GET_VOICE_EFFECTS) { // Open the voice morphing info web page - LLWeb::loadURL(getString("get_voice_effects_url")); + LLWeb::loadURL(LLTrans::getString("voice_morphing_url")); } else { 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 acd70bce8e..7335488e73 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml @@ -16,9 +16,6 @@ (No Voice Effect) - - http://secondlife.com/landing/v0icem0rphingt3st - (Active) diff --git a/indra/newview/skins/default/xui/en/panel_voice_effect.xml b/indra/newview/skins/default/xui/en/panel_voice_effect.xml index 9e5652d1e2..9b6548ef9c 100644 --- a/indra/newview/skins/default/xui/en/panel_voice_effect.xml +++ b/indra/newview/skins/default/xui/en/panel_voice_effect.xml @@ -8,9 +8,6 @@ No Voice Effect - - http://secondlife.com/landing/v0icem0rphingt3st - Preview Voice Morphing ▶ diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index f8bb36b88a..a54dd02927 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3086,10 +3086,12 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. [SOURCES] have said something new " - - The session initialization is timed out - - + + The session initialization is timed out + + + http://secondlife.com/landing/v0icem0rphingt3st + [NAME] paid you L$[AMOUNT] You paid [NAME] L$[AMOUNT] [REASON]. -- cgit v1.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/app_settings/settings.xml | 11 ++ indra/newview/llfloaternotificationsconsole.cpp | 2 +- indra/newview/llfloatervoiceeffect.cpp | 4 +- indra/newview/llfloatervoiceeffect.h | 2 +- indra/newview/llpanelvoiceeffect.cpp | 2 +- indra/newview/llpanelvoiceeffect.h | 2 +- indra/newview/llvoiceclient.h | 2 +- indra/newview/llvoicevivox.cpp | 187 +++++++++++++++++++-- indra/newview/llvoicevivox.h | 13 +- .../newview/skins/default/xui/en/notifications.xml | 33 ++++ 10 files changed, 232 insertions(+), 26 deletions(-) (limited to 'indra/newview/llpanelvoiceeffect.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index dd5774929e..cb9177587f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10606,6 +10606,17 @@ Value 1 + VoiceEffectExpiryWarningTime + + Comment + How much notice to give of voice effect subscriptions expiry, in seconds. + Persist + 1 + Type + F32 + Value + 259200.0 + AutoDisengageMic Comment diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp index b744bff084..105d7f9201 100644 --- a/indra/newview/llfloaternotificationsconsole.cpp +++ b/indra/newview/llfloaternotificationsconsole.cpp @@ -184,7 +184,7 @@ BOOL LLFloaterNotificationConsole::postBuild() addChannel("Ignore"); addChannel("Visible", true); // all the ones below attach to the Visible channel - addChannel("History"); + addChannel("Persistent"); addChannel("Alerts"); addChannel("AlertModal"); addChannel("Group Notifications"); 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(); } diff --git a/indra/newview/llfloatervoiceeffect.h b/indra/newview/llfloatervoiceeffect.h index ed38cd6925..46b241bd17 100644 --- a/indra/newview/llfloatervoiceeffect.h +++ b/indra/newview/llfloatervoiceeffect.h @@ -57,7 +57,7 @@ private: void updateControls(); /// Called by voice effect provider when voice effect list is changed. - virtual void onVoiceEffectChanged(bool new_effects); + virtual void onVoiceEffectChanged(bool effect_list_updated); void onClickRecord(); void onClickPlay(); diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp index 140feb7a54..4f73f38edc 100644 --- a/indra/newview/llpanelvoiceeffect.cpp +++ b/indra/newview/llpanelvoiceeffect.cpp @@ -110,7 +110,7 @@ void LLPanelVoiceEffect::onCommitVoiceEffect() } // virtual -void LLPanelVoiceEffect::onVoiceEffectChanged(bool new_effects) +void LLPanelVoiceEffect::onVoiceEffectChanged(bool effect_list_updated) { update(); } diff --git a/indra/newview/llpanelvoiceeffect.h b/indra/newview/llpanelvoiceeffect.h index 008123a4e4..bd7bdd04f2 100644 --- a/indra/newview/llpanelvoiceeffect.h +++ b/indra/newview/llpanelvoiceeffect.h @@ -56,7 +56,7 @@ private: void update(); /// Called by voice effect provider when voice effect list is changed. - virtual void onVoiceEffectChanged(bool new_effects); + virtual void onVoiceEffectChanged(bool effect_list_updated); // Fixed entries in the voice effect list typedef enum e_voice_effect_combo_items diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 7f8f979da0..744ec84023 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -266,7 +266,7 @@ class LLVoiceEffectObserver { public: virtual ~LLVoiceEffectObserver() { } - virtual void onVoiceEffectChanged(bool new_effects) = 0; + virtual void onVoiceEffectChanged(bool effect_list_updated) = 0; }; typedef std::multimap voice_effect_list_t; diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 304321b361..d786b4d928 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -60,6 +60,7 @@ #include "llviewerparcelmgr.h" //#include "llfirstuse.h" #include "llspeakers.h" +#include "lltrans.h" #include "llviewerwindow.h" #include "llviewercamera.h" @@ -96,6 +97,9 @@ const int MAX_LOGIN_RETRIES = 12; // blocked is VERY rare and it's better to sacrifice response time in this situation for the sake of stability. const int MAX_NORMAL_JOINING_SPATIAL_NUM = 50; +// How often to check for expired voice fonts +const F32 VOICE_FONT_EXPIRY_INTERVAL = 1.f; + // Maximum length of capture buffer recordings const F32 CAPTURE_BUFFER_MAX_TIME = 15.f; @@ -781,7 +785,7 @@ void LLVivoxVoiceClient::stateMachine() closeSocket(); deleteAllSessions(); deleteAllBuddies(); - deleteVoiceFonts(); + deleteAllVoiceFonts(); deleteVoiceFontTemplates(); mConnectorHandle.clear(); @@ -1372,6 +1376,10 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateVoiceFontsReceived case stateVoiceFontsReceived: // Voice font list received + // Set up the timer to check for expiring voice fonts + mVoiceFontExpiryTimer.start(); + mVoiceFontExpiryTimer.setTimerExpirySec(VOICE_FONT_EXPIRY_INTERVAL); + #if USE_SESSION_GROUPS // create the main session group setState(stateCreatingSessionGroup); @@ -1600,6 +1608,13 @@ void LLVivoxVoiceClient::stateMachine() enforceTether(); } + // Do notifications for expiring Voice Fonts. + if (mVoiceFontExpiryTimer.hasExpired()) + { + expireVoiceFonts(); + mVoiceFontExpiryTimer.setTimerExpirySec(VOICE_FONT_EXPIRY_INTERVAL); + } + // Send an update only if the ptt or mute state has changed (which shouldn't be able to happen that often // -- the user can only click so fast) or every 10hz, whichever is sooner. // Sending for every volume update causes an excessive flood of messages whenever a volume slider is dragged. @@ -1669,7 +1684,7 @@ void LLVivoxVoiceClient::stateMachine() mAccountHandle.clear(); deleteAllSessions(); deleteAllBuddies(); - deleteVoiceFonts(); + deleteAllVoiceFonts(); deleteVoiceFontTemplates(); if(mVoiceEnabled && !mRelogRequested) @@ -6461,7 +6476,6 @@ LLSD LLVivoxVoiceClient::getVoiceEffectProperties(const LLUUID& id) voiceFontEntry *font = iter->second; sd["name"] = font->mName; - sd["expired"] = font->mHasExpired; sd["expiry_date"] = font->mExpirationDate; sd["is_new"] = font->mIsNew; @@ -6471,7 +6485,6 @@ LLSD LLVivoxVoiceClient::getVoiceEffectProperties(const LLUUID& id) LLVivoxVoiceClient::voiceFontEntry::voiceFontEntry(LLUUID& id) : mID(id), mFontIndex(0), - mHasExpired(false), mFontType(VOICE_FONT_TYPE_NONE), mFontStatus(VOICE_FONT_STATUS_NONE), mIsNew(false) @@ -6487,7 +6500,7 @@ void LLVivoxVoiceClient::refreshVoiceEffectLists(bool clear_lists) if (clear_lists) { mVoiceFontsReceived = false; - deleteVoiceFonts(); + deleteAllVoiceFonts(); deleteVoiceFontTemplates(); } @@ -6533,12 +6546,23 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, voice_font_map_t& font_map = template_font ? mVoiceFontTemplateMap : mVoiceFontMap; voice_effect_list_t& font_list = template_font ? mVoiceFontTemplateList : mVoiceFontList; - // Check whether we've seen this font before and create an entry for it if not. + // Check whether we've seen this font before. voice_font_map_t::iterator iter = font_map.find(font_id); bool new_font = (iter == font_map.end()); + + // If it is a new (unexpired) font create a new entry, otherwise update the existing one. if (new_font) { - font = new voiceFontEntry(font_id); + if (!has_expired) + { + font = new voiceFontEntry(font_id); + } + else + { + LL_DEBUGS("Voice") << (template_font?"Template: ":"") << font_id + << " (" << font_index << ") : " << name << " has expired." << LL_ENDL; + } + } else { @@ -6547,15 +6571,47 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, if (font) { + // Remove fonts that have expired since we last saw them. + if (has_expired) + { + LL_DEBUGS("Voice") << (template_font?"Template: ":"") << font_id + << " (" << font_index << ") : " << name << " has expired, removing." + << LL_ENDL; + + deleteVoiceFont(font_id); + return; + } + font->mFontIndex = font_index; // Use the description for the human readable name if available, as the // "name" may be a UUID. font->mName = description.empty() ? name : description; font->mExpirationDate = expiration_date; - font->mHasExpired = has_expired; font->mFontType = font_type; font->mFontStatus = font_status; + F64 expiry_time = 0.f; + + // Set the expiry timer to trigger a notification when the voice font can no longer be used. + font->mExpiryTimer.start(); + expiry_time = expiration_date.secondsSinceEpoch() - LLTimer::getTotalSeconds(); + font->mExpiryTimer.setTimerExpirySec(expiry_time); + + // Set the warning timer to some interval before actual expiry. + F64 warning_time = (F64)gSavedSettings.getF32("VoiceEffectExpiryWarningTime"); + if (warning_time > 0.f) + { + font->mExpiryWarningTimer.start(); + expiry_time = (expiration_date.secondsSinceEpoch() - warning_time) + - LLTimer::getTotalSeconds(); + font->mExpiryWarningTimer.setTimerExpirySec(expiry_time); + } + else + { + // Disable the warning timer. + font->mExpiryWarningTimer.stop(); + } + // Only flag it as a new font if we have already seen the font list. if (!template_font && mVoiceFontsReceived && new_font) { @@ -6563,9 +6619,16 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, mVoiceFontsNew = true; } + if (new_font) + { + font_map.insert(voice_font_map_t::value_type(font->mID, font)); + font_list.insert(voice_effect_list_t::value_type(font->mName, font->mID)); + } + + // Debugging stuff + LL_DEBUGS("Voice") << (template_font?"Template: ":"") << font_id - << " (" << font_index << ") : " << name << (has_expired?" (Expired)":"") - << LL_ENDL; + << " (" << font_index << ") : " << name << LL_ENDL; if (font_type < VOICE_FONT_TYPE_NONE || font_type >= VOICE_FONT_TYPE_UNKNOWN) { @@ -6575,16 +6638,108 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, { LL_DEBUGS("Voice") << "Unknown voice font status: " << font_status << LL_ENDL; } + } +} - if (new_font) +void LLVivoxVoiceClient::expireVoiceFonts() +{ + // *TODO: If we are selling voice fonts in packs, there are probably + // going to be a number of fonts with the same expiration time, so would + // be more efficient to just keep a list of expiration times rather + // than checking each font individually. + + bool have_expired = false; + bool will_expire = false; + bool expired_in_use = false; + + LLUUID current_effect = LLVoiceClient::instance().getVoiceEffectDefault(); + + voice_font_map_t::iterator iter; + for (iter = mVoiceFontMap.begin(); iter != mVoiceFontMap.end(); ++iter) + { + voiceFontEntry* voice_font = iter->second; + LLTimer& expiry_timer = voice_font->mExpiryTimer; + LLTimer& warning_timer = voice_font->mExpiryWarningTimer; + + // Check for expired voice fonts + if (expiry_timer.getStarted() && expiry_timer.hasExpired()) { - font_map.insert(voice_font_map_t::value_type(font->mID, font)); - font_list.insert(voice_effect_list_t::value_type(font->mName, font->mID)); + // Check whether it is the active voice font + if (voice_font->mID == current_effect) + { + // Reset to no voice effect. + setVoiceEffect(LLUUID::null); + expired_in_use = true; + } + deleteVoiceFont(voice_font->mID); + have_expired = true; + } + + // Check for voice fonts that will expire in less that the warning time + if (warning_timer.getStarted() && warning_timer.hasExpired()) + { + will_expire = true; + warning_timer.stop(); + } + } + + LLSD args; + args["URL"] = LLTrans::getString("voice_morphing_url"); + + // Give a notification if any voice fonts have expired. + if (have_expired) + { + if (expired_in_use) + { + LLNotificationsUtil::add("VoiceEffectsExpiredInUse", args); + } + else + { + LLNotificationsUtil::add("VoiceEffectsExpired", args); + } + + // Refresh voice font lists in the UI. + notifyVoiceFontObservers(true); + } + + // Give a warning notification if any voice fonts are due to expire. + if (will_expire) + { + S32 seconds = gSavedSettings.getF32("VoiceEffectExpiryWarningTime"); + args["INTERVAL"] = llformat("%d", (seconds / SEC_PER_DAY)); + + LLNotificationsUtil::add("VoiceEffectsWillExpire", args); + } +} + +void LLVivoxVoiceClient::deleteVoiceFont(const LLUUID& id) +{ + // Remove the entry from the voice font list. + voice_effect_list_t::iterator list_iter = mVoiceFontList.begin(); + while (list_iter != mVoiceFontList.end()) + { + if (list_iter->second == id) + { + mVoiceFontList.erase(list_iter++); + } + else + { + ++list_iter; } } + + // Find the entry in the voice font map and erase its data. + voice_font_map_t::iterator map_iter = mVoiceFontMap.find(id); + if (map_iter != mVoiceFontMap.end()) + { + delete map_iter->second; + } + + // Remove the entry from the voice font map. + mVoiceFontMap.erase(map_iter); } -void LLVivoxVoiceClient::deleteVoiceFonts() +void LLVivoxVoiceClient::deleteAllVoiceFonts() { mVoiceFontList.clear(); @@ -6723,14 +6878,14 @@ void LLVivoxVoiceClient::removeObserver(LLVoiceEffectObserver* observer) mVoiceFontObservers.erase(observer); } -void LLVivoxVoiceClient::notifyVoiceFontObservers(bool new_fonts) +void LLVivoxVoiceClient::notifyVoiceFontObservers(bool lists_changed) { for (voice_font_observer_set_t::iterator it = mVoiceFontObservers.begin(); it != mVoiceFontObservers.end(); ) { LLVoiceEffectObserver* observer = *it; - observer->onVoiceEffectChanged(new_fonts); + observer->onVoiceEffectChanged(lists_changed); // In case onVoiceEffectChanged() deleted an entry. it = mVoiceFontObservers.upper_bound(observer); } diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 130fdac146..d71fe132c5 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -857,7 +857,9 @@ private: // Voice Fonts - void deleteVoiceFonts(); + void expireVoiceFonts(); + void deleteVoiceFont(const LLUUID& id); + void deleteAllVoiceFonts(); void deleteVoiceFontTemplates(); S32 getVoiceFontIndex(const LLUUID& id) const; @@ -867,7 +869,7 @@ private: void accountGetTemplateFontsSendMessage(); void sessionSetVoiceFontSendMessage(sessionState *session); - void notifyVoiceFontObservers(bool new_fonts = false); + void notifyVoiceFontObservers(bool lists_changed = false); typedef enum e_voice_font_type { @@ -894,10 +896,12 @@ private: S32 mFontIndex; std::string mName; LLDate mExpirationDate; - bool mHasExpired; S32 mFontType; S32 mFontStatus; bool mIsNew; + + LLTimer mExpiryTimer; + LLTimer mExpiryWarningTimer; }; bool mVoiceFontsReceived; @@ -912,6 +916,9 @@ private: typedef std::set voice_font_observer_set_t; voice_font_observer_set_t mVoiceFontObservers; + LLTimer mVoiceFontExpiryTimer; + + // Audio capture buffer void captureBufferRecordStartSendMessage(); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 999f804e71..6b5659f6c0 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5956,6 +5956,39 @@ We are creating a voice channel for you. This may take up to one minute. + +Subscribed Voice Effects have expired. +[[URL] Renew your subscription] to reactivate them. + + + + +The active Voice Effect has expired, your normal voice settings have been applied. +[[URL] Renew your subscription] to reactivate it. + + + + +Voice Effects will expire in less than [INTERVAL] days. +[[URL] Renew your subscription] or they will be removed. + + + Date: Mon, 24 May 2010 16:21:56 +0100 Subject: EXT-7138 WIP Don't rebuild the voice effect combo list every time a different effect is selected. Added a notification on receiving new voice effects. --- indra/newview/llpanelvoiceeffect.cpp | 54 +++++++++++++--------- indra/newview/llpanelvoiceeffect.h | 2 +- indra/newview/llvoicevivox.cpp | 7 +++ .../newview/skins/default/xui/en/notifications.xml | 11 +++++ 4 files changed, 51 insertions(+), 23 deletions(-) (limited to 'indra/newview/llpanelvoiceeffect.cpp') diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp index 4f73f38edc..f4f0ea3ee7 100644 --- a/indra/newview/llpanelvoiceeffect.cpp +++ b/indra/newview/llpanelvoiceeffect.cpp @@ -72,7 +72,7 @@ BOOL LLPanelVoiceEffect::postBuild() effect_interface->addObserver(this); } - update(); + update(true); return TRUE; } @@ -112,39 +112,49 @@ void LLPanelVoiceEffect::onCommitVoiceEffect() // virtual void LLPanelVoiceEffect::onVoiceEffectChanged(bool effect_list_updated) { - update(); + update(effect_list_updated); } -void LLPanelVoiceEffect::update() +void LLPanelVoiceEffect::update(bool list_updated) { if (mVoiceEffectCombo) { LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); - if (!effect_interface || !LLVoiceClient::instance().isVoiceWorking()) + if (list_updated) { - mVoiceEffectCombo->setEnabled(false); - return; - } - - mVoiceEffectCombo->removeall(); - mVoiceEffectCombo->add(getString("no_voice_effect"), LLUUID::null); - mVoiceEffectCombo->addSeparator(); + // Add the default "No Voice Effect" entry. + mVoiceEffectCombo->removeall(); + mVoiceEffectCombo->add(getString("no_voice_effect"), LLUUID::null); + mVoiceEffectCombo->addSeparator(); - 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 entries for each Voice Effect. + const voice_effect_list_t& effect_list = effect_interface->getVoiceEffectList(); + if (!effect_list.empty()) { - mVoiceEffectCombo->add(it->first, it->second, ADD_BOTTOM); + for (voice_effect_list_t::const_iterator it = effect_list.begin(); it != effect_list.end(); ++it) + { + mVoiceEffectCombo->add(it->first, it->second, ADD_BOTTOM); + } + + mVoiceEffectCombo->addSeparator(); } - mVoiceEffectCombo->addSeparator(); + // Add the fixed entries to go to the preview floater or marketing page. + mVoiceEffectCombo->add(getString("preview_voice_effects"), PREVIEW_VOICE_EFFECTS); + mVoiceEffectCombo->add(getString("get_voice_effects"), GET_VOICE_EFFECTS); } - mVoiceEffectCombo->add(getString("preview_voice_effects"), PREVIEW_VOICE_EFFECTS); - mVoiceEffectCombo->add(getString("get_voice_effects"), GET_VOICE_EFFECTS); - - mVoiceEffectCombo->setValue(effect_interface->getVoiceEffect()); - mVoiceEffectCombo->setEnabled(true); + if (effect_interface && LLVoiceClient::instance().isVoiceWorking()) + { + // Select the current voice effect. + mVoiceEffectCombo->setValue(effect_interface->getVoiceEffect()); + mVoiceEffectCombo->setEnabled(true); + } + else + { + // If voice isn't working or Voice Effects are not supported disable the control. + mVoiceEffectCombo->setValue(LLUUID::null); + mVoiceEffectCombo->setEnabled(false); + } } } diff --git a/indra/newview/llpanelvoiceeffect.h b/indra/newview/llpanelvoiceeffect.h index bd7bdd04f2..235db5a9e4 100644 --- a/indra/newview/llpanelvoiceeffect.h +++ b/indra/newview/llpanelvoiceeffect.h @@ -53,7 +53,7 @@ public: private: void onCommitVoiceEffect(); - void update(); + void update(bool list_updated); /// Called by voice effect provider when voice effect list is changed. virtual void onVoiceEffectChanged(bool effect_list_updated); diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 070e4f0d2d..17f4b661be 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -6857,6 +6857,13 @@ void LLVivoxVoiceClient::accountGetSessionFontsResponse(int statusCode, const st } mVoiceFontsReceived = true; + // If new Voice Fonts have been found notify the user. + if (mVoiceFontsNew) + { + LLNotificationsUtil::add("VoiceEffectsNew"); + mVoiceFontsNew = false; + } + notifyVoiceFontObservers(true); } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 6b5659f6c0..b997dee30c 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5988,6 +5988,17 @@ Voice Effects will expire in less than [INTERVAL] days. [[URL] Renew your subscription] or they will be removed. + LLNotificationsUtil::add("VoiceEffectsNew"); + + +New Voice Effects are available! + + Date: Tue, 25 May 2010 13:51:28 +0100 Subject: EXT-7138 WIP Made selecting voice effects while the Voice Control Panel is docked work properly. --- indra/newview/llpanelvoiceeffect.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/llpanelvoiceeffect.cpp') diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp index f4f0ea3ee7..518afc5eb3 100644 --- a/indra/newview/llpanelvoiceeffect.cpp +++ b/indra/newview/llpanelvoiceeffect.cpp @@ -39,6 +39,7 @@ #include "llfloaterreg.h" #include "llpanel.h" #include "lltrans.h" +#include "lltransientfloatermgr.h" #include "llvoiceclient.h" static LLRegisterPanelClassWrapper t_panel_voice_effect("panel_voice_effect"); @@ -51,6 +52,9 @@ LLPanelVoiceEffect::LLPanelVoiceEffect() LLPanelVoiceEffect::~LLPanelVoiceEffect() { + LLView* combo_list_view = mVoiceEffectCombo->getChildView("ComboBox"); + LLTransientFloaterMgr::getInstance()->removeControlView(combo_list_view); + if(LLVoiceClient::instanceExists()) { LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); @@ -66,6 +70,11 @@ BOOL LLPanelVoiceEffect::postBuild() { mVoiceEffectCombo = getChild("voice_effect"); + // Need to tell LLTransientFloaterMgr about the combo list, otherwise it can't + // be clicked while in a docked floater as it extends outside the floater area. + LLView* combo_list_view = mVoiceEffectCombo->getChildView("ComboBox"); + LLTransientFloaterMgr::getInstance()->addControlView(combo_list_view); + LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); if (effect_interface) { -- cgit v1.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 +------- indra/newview/llfloatervoiceeffect.h | 6 +++--- indra/newview/llpanelvoiceeffect.cpp | 2 +- indra/newview/llpanelvoiceeffect.h | 2 +- 4 files changed, 6 insertions(+), 12 deletions(-) (limited to 'indra/newview/llpanelvoiceeffect.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(); diff --git a/indra/newview/llfloatervoiceeffect.h b/indra/newview/llfloatervoiceeffect.h index 46b241bd17..2a8330c72a 100644 --- a/indra/newview/llfloatervoiceeffect.h +++ b/indra/newview/llfloatervoiceeffect.h @@ -1,5 +1,6 @@ /** * @file llfloatervoiceeffect.h + * @author Aimee * @brief Selection and preview of voice effects. * * $LicenseInfo:firstyear=2010&license=viewergpl$ @@ -62,9 +63,8 @@ private: void onClickRecord(); void onClickPlay(); void onClickStop(); - void onClickAdd(); -// void onClickActivate(); - +// void onClickActivate(); + LLUUID mSelectedID; LLScrollListCtrl* mVoiceEffectList; }; diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp index 518afc5eb3..707e05048e 100644 --- a/indra/newview/llpanelvoiceeffect.cpp +++ b/indra/newview/llpanelvoiceeffect.cpp @@ -1,6 +1,6 @@ /** * @file llpanelvoiceeffect.cpp - * @author Aimee Walton + * @author Aimee * @brief Panel to select Voice Effects. * * $LicenseInfo:firstyear=2010&license=viewergpl$ diff --git a/indra/newview/llpanelvoiceeffect.h b/indra/newview/llpanelvoiceeffect.h index 235db5a9e4..c773b4ce94 100644 --- a/indra/newview/llpanelvoiceeffect.h +++ b/indra/newview/llpanelvoiceeffect.h @@ -1,6 +1,6 @@ /** * @file llpanelvoiceeffect.h - * @author Aimee Walton + * @author Aimee * @brief Panel to select Voice Effects. * * $LicenseInfo:firstyear=2010&license=viewergpl$ -- cgit v1.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/app_settings/settings.xml | 4 ++-- indra/newview/app_settings/settings_per_account.xml | 2 +- indra/newview/llfloatervoiceeffect.cpp | 6 +++--- indra/newview/llpanelvoiceeffect.cpp | 10 +++++----- indra/newview/llpanelvoiceeffect.h | 2 +- .../skins/default/xui/en/floater_voice_effect.xml | 17 +++++++++-------- indra/newview/skins/default/xui/en/notifications.xml | 14 +++++++------- .../newview/skins/default/xui/en/panel_voice_effect.xml | 5 +++-- 8 files changed, 31 insertions(+), 29 deletions(-) (limited to 'indra/newview/llpanelvoiceeffect.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 505403b155..4dd121fd22 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10609,7 +10609,7 @@ VoiceEffectExpiryWarningTime Comment - How much notice to give of voice effect subscriptions expiry, in seconds. + How much notice to give of Voice Morph subscriptions expiry, in seconds. Persist 1 Type @@ -10620,7 +10620,7 @@ VoiceMorphingEnabled Comment - Whether or not to enable Voice Effects and show the UI. + Whether or not to enable Voice Morphs and show the UI. Persist 0 Type diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index c94ae1fca1..d4000e9253 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -102,7 +102,7 @@ VoiceEffectDefault Comment - Selected voice effect + Selected Voice Morph Persist 1 Type 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()) { diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp index 707e05048e..fd470798ee 100644 --- a/indra/newview/llpanelvoiceeffect.cpp +++ b/indra/newview/llpanelvoiceeffect.cpp @@ -1,7 +1,7 @@ /** * @file llpanelvoiceeffect.cpp * @author Aimee - * @brief Panel to select Voice Effects. + * @brief Panel to select Voice Morphs. * * $LicenseInfo:firstyear=2010&license=viewergpl$ * @@ -102,7 +102,7 @@ void LLPanelVoiceEffect::onCommitVoiceEffect() LLSD value = mVoiceEffectCombo->getValue(); if (value.asInteger() == PREVIEW_VOICE_EFFECTS) { - // Open the voice effects management floater + // Open the Voice Morph preview floater LLFloaterReg::showInstance("voice_effect"); } else if (value.asInteger() == GET_VOICE_EFFECTS) @@ -131,12 +131,12 @@ void LLPanelVoiceEffect::update(bool list_updated) LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); if (list_updated) { - // Add the default "No Voice Effect" entry. + // Add the default "No Voice Morph" entry. mVoiceEffectCombo->removeall(); mVoiceEffectCombo->add(getString("no_voice_effect"), LLUUID::null); mVoiceEffectCombo->addSeparator(); - // Add entries for each Voice Effect. + // Add entries for each Voice Morph. const voice_effect_list_t& effect_list = effect_interface->getVoiceEffectList(); if (!effect_list.empty()) { @@ -155,7 +155,7 @@ void LLPanelVoiceEffect::update(bool list_updated) if (effect_interface && LLVoiceClient::instance().isVoiceWorking()) { - // Select the current voice effect. + // Select the current Voice Morph. mVoiceEffectCombo->setValue(effect_interface->getVoiceEffect()); mVoiceEffectCombo->setEnabled(true); } diff --git a/indra/newview/llpanelvoiceeffect.h b/indra/newview/llpanelvoiceeffect.h index c773b4ce94..79f9d2fe75 100644 --- a/indra/newview/llpanelvoiceeffect.h +++ b/indra/newview/llpanelvoiceeffect.h @@ -58,7 +58,7 @@ private: /// Called by voice effect provider when voice effect list is changed. virtual void onVoiceEffectChanged(bool effect_list_updated); - // Fixed entries in the voice effect list + // Fixed entries in the Voice Morph list typedef enum e_voice_effect_combo_items { NO_VOICE_EFFECT = 0, 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 4f4b20066d..207397d3dc 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml @@ -2,7 +2,7 @@ - (No Voice Effect) + (No Voice Morph) (Active) @@ -23,7 +23,7 @@ (New!) -Record a sample of your voice, and then select an effect to preview. -Close this window to return to in-world voice. +To preview any of the Voice Morphing effects, click the Record button to record a short snippet of voice, then click any Voice Morph in the list to hear how it will sound. + +To reconnect to Nearby Voice simply close this window.