From c418d616276ce16d910c6e5528f6aa058803e1c7 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 25 Jan 2013 17:47:36 -0800 Subject: CHUI-667 Upon exit from DND mode, a maximum of one sound should be played. Solution. Added a deferred sound class which will have sound id's added to it and upon unmuting the deferred sounds will be played. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llappviewer.cpp | 14 ++++++- indra/newview/lldeferredsounds.cpp | 45 ++++++++++++++++++++++ indra/newview/lldeferredsounds.h | 44 +++++++++++++++++++++ .../newview/lldonotdisturbnotificationstorage.cpp | 20 ++++++++++ indra/newview/llnotificationofferhandler.cpp | 3 +- indra/newview/llprogressview.cpp | 4 +- indra/newview/llvieweraudio.cpp | 7 ++++ 8 files changed, 135 insertions(+), 4 deletions(-) create mode 100644 indra/newview/lldeferredsounds.cpp create mode 100644 indra/newview/lldeferredsounds.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index d40537fc78..bd4cdac5f2 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -151,6 +151,7 @@ set(viewer_SOURCE_FILES lldaycyclemanager.cpp lldebugmessagebox.cpp lldebugview.cpp + lldeferredsounds.cpp lldelayedgestureerror.cpp lldirpicker.cpp lldonotdisturbnotificationstorage.cpp @@ -739,6 +740,7 @@ set(viewer_HEADER_FILES lldaycyclemanager.h lldebugmessagebox.h lldebugview.h + lldeferredsounds.h lldelayedgestureerror.h lldirpicker.h lldonotdisturbnotificationstorage.h diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3c42734e6e..a291fac5a1 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -201,6 +201,7 @@ #include "llviewercontrol.h" #include "lleventnotifier.h" #include "llcallbacklist.h" +#include "lldeferredsounds.h" #include "pipeline.h" #include "llgesturemgr.h" #include "llsky.h" @@ -220,6 +221,7 @@ #include "llmachineid.h" #include "llmainlooprepeater.h" +#include // *FIX: These extern globals should be cleaned up. // The globals either represent state/config/resource-storage of either @@ -456,7 +458,7 @@ void idle_afk_check() } // A callback set in LLAppViewer::init() -static void ui_audio_callback(const LLUUID& uuid) +void ui_audio_callback(const LLUUID& uuid) { if (gAudiop) { @@ -464,6 +466,15 @@ static void ui_audio_callback(const LLUUID& uuid) } } +// A callback set in LLAppViewer::init() +static void deferred_ui_audio_callback(const LLUUID& uuid) +{ + if (gAudiop) + { + LLDeferredSounds::instance().deferSound(uuid); + } +} + bool create_text_segment_icon_from_url_match(LLUrlMatch* match,LLTextBase* base) { if(!match || !base || base->getPlainText()) @@ -778,6 +789,7 @@ bool LLAppViewer::init() LLUI::initClass(settings_map, LLUIImageList::getInstance(), ui_audio_callback, + deferred_ui_audio_callback, &LLUI::sGLScaleFactor); LL_INFOS("InitInfo") << "UI initialized." << LL_ENDL ; diff --git a/indra/newview/lldeferredsounds.cpp b/indra/newview/lldeferredsounds.cpp new file mode 100644 index 0000000000..2b2b493875 --- /dev/null +++ b/indra/newview/lldeferredsounds.cpp @@ -0,0 +1,45 @@ +/** +* @file lldeferredsounds.cpp +* @brief Implementation of lldeferredsounds +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" + +#include "lldeferredsounds.h" + +void ui_audio_callback(const LLUUID& uuid); + +void LLDeferredSounds::deferSound(LLUUID sound) +{ + soundQueue.push(sound); +} +void LLDeferredSounds::playdeferredSounds() +{ + while(soundQueue.size()) + { + ui_audio_callback(soundQueue.front()); + soundQueue.pop(); + } +} diff --git a/indra/newview/lldeferredsounds.h b/indra/newview/lldeferredsounds.h new file mode 100644 index 0000000000..50da9acf2b --- /dev/null +++ b/indra/newview/lldeferredsounds.h @@ -0,0 +1,44 @@ +/** +* @file lldeferredsounds.h +* @brief Header file for lldeferredsounds +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLDEFERREDSOUNDS_H +#define LL_LLDEFERREDSOUNDS_H + +#include "llsingleton.h" + +class LLDeferredSounds : public LLSingleton +{ +private: + std::queue soundQueue; +public: + //Add sounds to be played once progress bar is hidden (such as after teleport or loading screen) + void deferSound(LLUUID sound); + + void playdeferredSounds(); +}; + +#endif // LL_LLDEFERREDSOUNDS_H + diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp index 15c42e8285..6e39d049a5 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.cpp +++ b/indra/newview/lldonotdisturbnotificationstorage.cpp @@ -146,6 +146,7 @@ void LLDoNotDisturbNotificationStorage::loadNotifications() LLNotifications& instance = LLNotifications::instance(); bool imToastExists = false; + bool offerExists = false; for (LLSD::array_const_iterator notification_it = data.beginArray(); notification_it != data.endArray(); @@ -160,6 +161,10 @@ void LLDoNotDisturbNotificationStorage::loadNotifications() { imToastExists = true; } + else if(notificationName == offerName) + { + offerExists = true; + } //New notification needs to be added notification = (LLNotificationPtr) new LLNotification(notification_params.with("is_dnd", true)); @@ -183,6 +188,11 @@ void LLDoNotDisturbNotificationStorage::loadNotifications() LLFloaterReg::showInstance("im_container"); } + if(imToastExists || offerExists) + { + make_ui_sound_deferred("UISndNewIncomingIMSession"); + } + //writes out empty .xml file (since LLCommunicationChannel::mHistory is empty) saveNotifications(); } @@ -196,6 +206,7 @@ void LLDoNotDisturbNotificationStorage::updateNotifications() LLNotifications& instance = LLNotifications::instance(); bool imToastExists = false; + bool offerExists = false; for (LLCommunicationChannel::history_list_t::const_iterator it = commChannel->beginHistory(); it != commChannel->endHistory(); @@ -208,6 +219,10 @@ void LLDoNotDisturbNotificationStorage::updateNotifications() { imToastExists = true; } + else if(notificationName == offerName) + { + offerExists = true; + } //Notification already exists in notification pipeline (same instance of app running) if (notification) @@ -222,6 +237,11 @@ void LLDoNotDisturbNotificationStorage::updateNotifications() LLFloaterReg::showInstance("im_container"); } + if(imToastExists || offerExists) + { + make_ui_sound("UISndNewIncomingIMSession"); + } + //When exit DND mode, write empty notifications file if(commChannel->getHistorySize()) { diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index da38c9063b..cde7bb18ce 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -120,7 +120,8 @@ bool LLOfferHandler::processNotification(const LLNotificationPtr& notification) channel->addToast(p); //Will not play a notification sound for inventory and teleport offer based upon chat preference - bool playSound = !((notification->getName() == "UserGiveItem" + bool playSound = !((notification->isDND()) + && (notification->getName() == "UserGiveItem" && gSavedSettings.getBOOL("PlaySoundInventoryOffer") == FALSE) || notification->getName() == "TeleportOffered" && gSavedSettings.getBOOL("PlaySoundTeleportOffer") == FALSE); diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index f86e583b9e..989f0b0e60 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -96,7 +96,7 @@ BOOL LLProgressView::postBuild() getChild("message_text")->setClickedCallback(onClickMessage, this); // hidden initially, until we need it - LLPanel::setVisible(FALSE); + setVisible(FALSE); LLNotifications::instance().getChannel("AlertModal")->connectChanged(boost::bind(&LLProgressView::onAlertModal, this, _1)); @@ -265,7 +265,7 @@ void LLProgressView::draw() gFocusMgr.releaseFocusIfNeeded( this ); // turn off panel that hosts intro so we see the world - LLPanel::setVisible(FALSE); + setVisible(FALSE); // stop observing events since we no longer care mMediaCtrl->remObserver( this ); diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 8d8c401dac..564bf7997a 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -30,6 +30,7 @@ #include "llagent.h" #include "llagentcamera.h" #include "llappviewer.h" +#include "lldeferredsounds.h" #include "llvieweraudio.h" #include "llviewercamera.h" #include "llviewercontrol.h" @@ -388,6 +389,12 @@ void audio_update_volume(bool force_update) gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); gAudiop->setMuted(mute_audio || progress_view_visible); + //Play any deferred sounds when unmuted + if(!gAudiop->getMuted()) + { + LLDeferredSounds::instance().playdeferredSounds(); + } + if (force_update) { audio_update_wind(true); -- cgit v1.2.3 From aa524b18e5486b19aede990cb30fb89a0b48c083 Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Mon, 28 Jan 2013 14:57:51 +0200 Subject: CHUI-701 FIXED Don't show toasts and flashing, if conversation is opened but isn't focused. --- indra/newview/llfloaterimnearbychathandler.cpp | 8 ++++++++ indra/newview/llimview.cpp | 19 ++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index f64cfd0245..8870d54cd2 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -604,6 +604,14 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, toast_msg = chat_msg.mText; } + //Don't show nearby toast, if conversation is visible but not focused + LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(LLUUID()); + if (session_floater + && session_floater->isInVisibleChain() && !session_floater->isMinimized() + && !(session_floater->getHost() && session_floater->getHost()->isMinimized())) + { + return; + } //Will show toast when chat preference is set if(gSavedSettings.getString("NotificationNearbyChatOptions") == "toast") diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index cb03c1d234..433ddad35d 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -204,19 +204,16 @@ void on_new_message(const LLSD& msg) bool conversation_floater_not_focused = conversation_floater_is_closed || !im_box->hasFocus(); + // Skip toasting and flashing if we have open window of IM with this session id + if (session_floater + && session_floater->isInVisibleChain() + && !session_floater->isMinimized() + && !(session_floater->getHost() && session_floater->getHost()->isMinimized())) + { + return; + } if ("toast" == action) { - // Skip toasting and flashing if we have open window of IM with this session id - if (session_floater - && session_floater->isInVisibleChain() - && session_floater->hasFocus() - && !session_floater->isMinimized() - && !(session_floater->getHost() && session_floater->getHost()->isMinimized()) - ) - { - return; - } - //User is not focused on conversation containing the message if(session_floater_not_focused) { -- cgit v1.2.3 From 57795d3c89b6eee3ff68f327d2a6c840350d8dcb Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Mon, 28 Jan 2013 18:53:46 +0200 Subject: CHUI-706 FIXED Appropriate function is now called in xml --- indra/newview/skins/default/xui/en/menu_url_group.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/menu_url_group.xml b/indra/newview/skins/default/xui/en/menu_url_group.xml index 2cb125ce09..c5eaf94d22 100644 --- a/indra/newview/skins/default/xui/en/menu_url_group.xml +++ b/indra/newview/skins/default/xui/en/menu_url_group.xml @@ -7,7 +7,7 @@ layout="topleft" name="show_group"> + function="Url.Execute" /> -- cgit v1.2.3 From 4c5790d4bf24d80fd88f36e85a4aa51d4dc06c30 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 28 Jan 2013 18:27:54 -0800 Subject: CHUI-667: Post code review changes --- indra/newview/llappviewer.cpp | 8 +++----- indra/newview/lldeferredsounds.cpp | 12 ++++++------ indra/newview/lldeferredsounds.h | 6 ++++-- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a291fac5a1..d09c835e41 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -221,8 +221,6 @@ #include "llmachineid.h" #include "llmainlooprepeater.h" -#include - // *FIX: These extern globals should be cleaned up. // The globals either represent state/config/resource-storage of either // this app, or another 'component' of the viewer. App globals should be @@ -458,11 +456,11 @@ void idle_afk_check() } // A callback set in LLAppViewer::init() -void ui_audio_callback(const LLUUID& uuid) +static void ui_audio_callback(const LLUUID& uuid) { if (gAudiop) { - gAudiop->triggerSound(uuid, gAgent.getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_UI); + gAudiop->triggerSound(SoundData(uuid, gAgent.getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_UI)); } } @@ -471,7 +469,7 @@ static void deferred_ui_audio_callback(const LLUUID& uuid) { if (gAudiop) { - LLDeferredSounds::instance().deferSound(uuid); + LLDeferredSounds::instance().deferSound(SoundData(uuid, gAgent.getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_UI)); } } diff --git a/indra/newview/lldeferredsounds.cpp b/indra/newview/lldeferredsounds.cpp index 2b2b493875..9416e7cd29 100644 --- a/indra/newview/lldeferredsounds.cpp +++ b/indra/newview/lldeferredsounds.cpp @@ -29,17 +29,17 @@ #include "lldeferredsounds.h" -void ui_audio_callback(const LLUUID& uuid); +#include "llaudioengine.h" -void LLDeferredSounds::deferSound(LLUUID sound) +void LLDeferredSounds::deferSound(SoundData& sound) { - soundQueue.push(sound); + soundVector.push_back(sound); } void LLDeferredSounds::playdeferredSounds() { - while(soundQueue.size()) + while(soundVector.size()) { - ui_audio_callback(soundQueue.front()); - soundQueue.pop(); + gAudiop->triggerSound(soundVector.back()); + soundVector.pop_back(); } } diff --git a/indra/newview/lldeferredsounds.h b/indra/newview/lldeferredsounds.h index 50da9acf2b..bf1eb62957 100644 --- a/indra/newview/lldeferredsounds.h +++ b/indra/newview/lldeferredsounds.h @@ -29,13 +29,15 @@ #include "llsingleton.h" +struct SoundData; + class LLDeferredSounds : public LLSingleton { private: - std::queue soundQueue; + std::vector soundVector; public: //Add sounds to be played once progress bar is hidden (such as after teleport or loading screen) - void deferSound(LLUUID sound); + void deferSound(SoundData& sound); void playdeferredSounds(); }; -- cgit v1.2.3 From e179add865fef30f6ad86ffd074f267fd01cb41d Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 29 Jan 2013 11:02:23 -0800 Subject: CHUI-667: Attempting to correct Mac/Linux build issue. --- indra/newview/llappviewer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d09c835e41..2fd9dd0dce 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -460,7 +460,8 @@ static void ui_audio_callback(const LLUUID& uuid) { if (gAudiop) { - gAudiop->triggerSound(SoundData(uuid, gAgent.getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_UI)); + SoundData soundData(uuid, gAgent.getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_UI); + gAudiop->triggerSound(soundData); } } @@ -469,7 +470,8 @@ static void deferred_ui_audio_callback(const LLUUID& uuid) { if (gAudiop) { - LLDeferredSounds::instance().deferSound(SoundData(uuid, gAgent.getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_UI)); + SoundData soundData(uuid, gAgent.getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_UI); + LLDeferredSounds::instance().deferSound(soundData); } } -- cgit v1.2.3 From edb5be4ec0a88931933a27dc7e94d45ea249591d Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 29 Jan 2013 14:41:37 -0800 Subject: CHUI-88 I shouldn't see Conference IMs from people I muted. Fix: In order to mute a user who initiated a conference/group chat, the session must be created on the server side and then left. --- indra/newview/llimview.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 8f010850f7..3a5743f309 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3454,12 +3454,10 @@ public: (time_t) message_params["timestamp"].asInteger(); BOOL is_do_not_disturb = gAgent.isDoNotDisturb(); - BOOL is_muted = LLMuteList::getInstance()->isMuted( - from_id, - name, - LLMute::flagTextChat); - if (is_do_not_disturb || is_muted) + //don't return if user is muted b/c proper way to ignore a muted user who + //initiated an adhoc/group conference is to create then leave the session (see STORM-1731) + if (is_do_not_disturb) { return; } -- cgit v1.2.3