summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Yap <none@none>2011-06-12 16:00:33 -0400
committerJonathan Yap <none@none>2011-06-12 16:00:33 -0400
commitac504815137ec01767717e7c1a4c419a995f629c (patch)
tree48f34f243169b5c6e0c96aec68470c9050e1bc83
parent12d9d1d3ef76518171ae87aae2467593218f8413 (diff)
STORM-787 Mute Gestures Button
-rw-r--r--doc/contributions.txt1
-rw-r--r--indra/newview/app_settings/settings.xml11
-rwxr-xr-xindra/newview/llfloaterpreference.cpp9
-rw-r--r--indra/newview/llfloaterpreference.h1
-rw-r--r--indra/newview/llviewermessage.cpp3
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_sound.xml22
6 files changed, 43 insertions, 4 deletions
diff --git a/doc/contributions.txt b/doc/contributions.txt
index daaffe2dee..5cd8d06426 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -442,6 +442,7 @@ Jonathan Yap
STORM-1095
STORM-1236
STORM-1259
+ STORM-787
Kage Pixel
VWR-11
Ken March
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index fc7fd2dd8a..9b12b8057f 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3058,6 +3058,17 @@
<key>Value</key>
<integer>1</integer>
</map>
+ <key>EnableGestureSounds</key>
+ <map>
+ <key>Comment</key>
+ <string>Play sounds from gestures</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
<key>EnableMouselook</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 60a2f813aa..7848484ac6 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -327,6 +327,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
mCommitCallbackRegistrar.add("Pref.SelectSkin", boost::bind(&LLFloaterPreference::onSelectSkin, this));
mCommitCallbackRegistrar.add("Pref.VoiceSetKey", boost::bind(&LLFloaterPreference::onClickSetKey, this));
mCommitCallbackRegistrar.add("Pref.VoiceSetMiddleMouse", boost::bind(&LLFloaterPreference::onClickSetMiddleMouse, this));
+ mCommitCallbackRegistrar.add("Pref.SetSounds", boost::bind(&LLFloaterPreference::onClickSetSounds, this));
// mCommitCallbackRegistrar.add("Pref.ClickSkipDialogs", boost::bind(&LLFloaterPreference::onClickSkipDialogs, this));
// mCommitCallbackRegistrar.add("Pref.ClickResetDialogs", boost::bind(&LLFloaterPreference::onClickResetDialogs, this));
mCommitCallbackRegistrar.add("Pref.ClickEnablePopup", boost::bind(&LLFloaterPreference::onClickEnablePopup, this));
@@ -1286,6 +1287,14 @@ void LLFloaterPreference::onClickSetMiddleMouse()
p2t_line_editor->setValue(advanced_preferences->getString("middle_mouse"));
}
}
+
+void LLFloaterPreference::onClickSetSounds()
+{
+ // Disable Enable gesture sounds checkbox if the master sound is disabled
+ // or if sound effects are disabled.
+ getChild<LLCheckBoxCtrl>("gesture_audio_play_btn")->setEnabled(!gSavedSettings.getBOOL("MuteSounds"));
+}
+
/*
void LLFloaterPreference::onClickSkipDialogs()
{
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index ef92575347..61f2c78640 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -129,6 +129,7 @@ public:
void onClickSetKey();
void setKey(KEY key);
void onClickSetMiddleMouse();
+ void onClickSetSounds();
// void onClickSkipDialogs();
// void onClickResetDialogs();
void onClickEnablePopup();
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 3832be727f..0aada644f3 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -4332,6 +4332,9 @@ void process_sound_trigger(LLMessageSystem *msg, void **)
{
return;
}
+
+ // Don't play sounds from gestures if they are not enabled.
+ if (!gSavedSettings.getBOOL("EnableGestureSounds")) return;
gAudiop->triggerSound(sound_id, owner_id, gain, LLAudioEngine::AUDIO_TYPE_SFX, pos_global);
}
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
index 91fe6f544c..1bdd2ccefb 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
@@ -123,8 +123,8 @@
function="Pref.setControlFalse"
parameter="MuteAmbient" />
</slider>
- <button
- control_name="MuteAmbient"
+ <button
+ control_name="MuteAmbient"
disabled_control="MuteAudio"
follows="top|left"
height="16"
@@ -157,7 +157,7 @@
function="Pref.setControlFalse"
parameter="MuteSounds" />
</slider>
- <button
+ <button
control_name="MuteSounds"
disabled_control="MuteAudio"
follows="top|left"
@@ -169,7 +169,10 @@
left_pad="5"
name="mute_audio"
tab_stop="false"
- width="16" />
+ width="16">
+ <button.commit_callback
+ function="Pref.SetSounds"/>
+ </button>
<slider
control_name="AudioLevelMusic"
disabled_control="MuteAudio"
@@ -312,6 +315,17 @@
width="110"/>
<!-- -->
<check_box
+ name="gesture_audio_play_btn"
+ control_name="EnableGestureSounds"
+ disabled_control="MuteAudio"
+ value="true"
+ follows="left|bottom|right"
+ height="15"
+ tool_tip="Check this to hear sounds from gestures"
+ label="Enable sounds from gestures"
+ top_pad="1"
+ left="25"/>
+ <check_box
name="media_auto_play_btn"
control_name="ParcelMediaAutoPlayEnable"
enabled_control="AudioStreamingMedia"