summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2022-07-27 19:30:55 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2022-07-27 19:30:55 +0300
commit8771130ef72af23a163eb3dc08782bec979f0251 (patch)
treed4180e4f7fde8316e94fd864124a115598d3f595 /indra/newview
parent4c3f343799ca4be4b618dca8cf13a86e8941fb44 (diff)
SL-17809 Sounds from Avatar position instead of Camera position
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llvieweraudio.cpp15
-rw-r--r--indra/newview/llviewermedia.cpp15
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_sound.xml275
4 files changed, 180 insertions, 136 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 16d8cd9f06..b156e96d1f 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -14620,6 +14620,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>MediaSoundsEarLocation</key>
+ <map>
+ <key>Comment</key>
+ <string>Location of the virtual ear for media and sounds</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>VoiceHost</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp
index f810e5f4ef..cc73f7ca80 100644
--- a/indra/newview/llvieweraudio.cpp
+++ b/indra/newview/llvieweraudio.cpp
@@ -496,7 +496,20 @@ void audio_update_listener()
if (gAudiop)
{
// update listener position because agent has moved
- LLVector3d lpos_global = gAgentCamera.getCameraPositionGlobal();
+ static LLUICachedControl<S32> mEarLocation("MediaSoundsEarLocation", 0);
+ LLVector3d ear_position;
+ switch(mEarLocation)
+ {
+ case 0:
+ default:
+ ear_position = gAgentCamera.getCameraPositionGlobal();
+ break;
+
+ case 1:
+ ear_position = gAgent.getPositionGlobal();
+ break;
+ }
+ LLVector3d lpos_global = ear_position;
LLVector3 lpos_global_f;
lpos_global_f.setVec(lpos_global);
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 812f804ea9..03c9926e1d 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -3581,7 +3581,20 @@ void LLViewerMediaImpl::calculateInterest()
LLVector3d global_delta = agent_global - obj_global ;
mProximityDistance = global_delta.magVecSquared(); // use distance-squared because it's cheaper and sorts the same.
- LLVector3d camera_delta = gAgentCamera.getCameraPositionGlobal() - obj_global;
+ static LLUICachedControl<S32> mEarLocation("MediaSoundsEarLocation", 0);
+ LLVector3d ear_position;
+ switch(mEarLocation)
+ {
+ case 0:
+ default:
+ ear_position = gAgentCamera.getCameraPositionGlobal();
+ break;
+
+ case 1:
+ ear_position = agent_global;
+ break;
+ }
+ LLVector3d camera_delta = ear_position - obj_global;
mProximityCamera = camera_delta.magVec();
}
}
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 42a34d171a..ab2e9c72f3 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
@@ -322,154 +322,161 @@
name="enable_voice_check"
width="110"/>
<!-- -->
- <text
- follows="left|top"
- layout="topleft"
- height="15"
- left="0"
- top_pad="3"
- width="120"
- halign="right"
- name="media_autoplay_label">
- Media auto-play
- </text>
- <combo_box
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ layout="topleft"
+ left="23"
+ top_delta="22"
+ name="Listen media from"
+ height="15"
+ word_wrap="true"
+ width="112">
+ Hear media and sounds from:
+ </text>
+ <radio_group
+ control_name="MediaSoundsEarLocation"
+ follows="left|top"
+ top_delta="-6"
+ layout="topleft"
+ left_pad="20"
+ width="360"
+ height="40"
+ name="media_ear_location">
+ <radio_item
+ height="19"
+ label="Camera position"
+ follows="left|top"
+ layout="topleft"
+ name="0"
+ width="200"/>
+ <radio_item
+ height="19"
+ follows="left|top"
+ label="Avatar position"
+ layout="topleft"
+ left_delta="0"
+ name="1"
+ top_delta ="18"
+ width="200" />
+ </radio_group>
+ <check_box
+ name="media_show_on_others_btn"
+ control_name="MediaShowOnOthers"
+ value="true"
+ follows="left|top"
+ layout="topleft"
+ height="15"
+ top_pad="8"
+ tool_tip="Uncheck this to hide media attached to other avatars nearby"
+ label="Play media attached to other avatars"
+ left="20"
+ width="230"/>
+ <text
+ follows="left|top"
+ layout="topleft"
+ height="15"
+ left="23"
+ top_pad="8"
+ width="120"
+ name="media_autoplay_label">
+ Auto-play media
+ </text>
+ <combo_box
control_name="ParcelMediaAutoPlayEnable"
enabled_control="AudioStreamingMedia"
follows="left|top"
layout="topleft"
height="23"
- left_pad="7"
+ left_pad="-15"
top_delta="-4"
name="media_auto_play_combo"
- width="100">
- <item
- label="No"
- name="autoplay_disabled"
- value="0"/>
- <item
- label="Yes"
- name="autoplay_enabled"
- value="1"/>
- <item
- label="Ask"
- name="autoplay_ask"
- value="2"/>
- </combo_box>
- <check_box
- name="media_show_on_others_btn"
- control_name="MediaShowOnOthers"
- value="true"
- follows="left|bottom|right"
- height="15"
- tool_tip="Uncheck this to hide media attached to other avatars nearby"
- label="Play media attached to other avatars"
- left="25"
- width="230"/>
- <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="Play sounds from gestures"
- top_pad="1"
- left="25"/>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="20"
- layout="topleft"
- left="25"
- name="voice_chat_settings"
- width="200"
- top_pad="16">
- Voice Chat Settings
- </text>
- <text
- type="string"
- length="1"
- follows="left|top"
- layout="topleft"
- left="46"
- top_delta="16"
- name="Listen from"
- width="112">
- Listen from:
- </text>
- <icon
- follows="left|top"
- height="18"
- image_name="Cam_FreeCam_Off"
- layout="topleft"
- name="camera_icon"
- mouse_opaque="false"
- visible="true"
- width="18"
- left_pad="-4"
- top_delta="-5"/>
- <icon
- follows="left|top"
- height="18"
- image_name="Move_Walk_Off"
- layout="topleft"
- left_pad="170"
- name="avatar_icon"
- mouse_opaque="false"
- visible="true"
- width="18"
- top_delta="0" />
- <radio_group
- enabled_control="EnableVoiceChat"
- control_name="VoiceEarLocation"
- follows="left|top"
- layout="topleft"
- left_delta="-168"
- width="360"
- height="20"
- name="ear_location">
- <radio_item
- height="19"
- label="Camera position"
- follows="left|top"
- layout="topleft"
- name="0"
- width="200"/>
- <radio_item
- height="19"
- follows="left|top"
- label="Avatar position"
- layout="topleft"
- left_pad="-16"
- name="1"
- top_delta ="0"
- width="200" />
- </radio_group>
+ width="115">
+ <item
+ label="Never"
+ name="autoplay_disabled"
+ value="0"/>
+ <item
+ label="Always"
+ name="autoplay_enabled"
+ value="1"/>
+ <item
+ label="Ask"
+ name="autoplay_ask"
+ value="2"/>
+ </combo_box>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ layout="topleft"
+ left="23"
+ top_delta="30"
+ name="Listen from"
+ width="112">
+ Hear voice from:
+ </text>
+ <radio_group
+ enabled_control="EnableVoiceChat"
+ control_name="VoiceEarLocation"
+ follows="left|top"
+ layout="topleft"
+ left_pad="20"
+ top_delta="-6"
+ width="360"
+ height="40"
+ name="ear_location">
+ <radio_item
+ height="19"
+ label="Camera position"
+ follows="left|top"
+ layout="topleft"
+ name="0"
+ width="200"/>
+ <radio_item
+ height="19"
+ follows="left|top"
+ label="Avatar position"
+ layout="topleft"
+ left_delta="0"
+ name="1"
+ top_delta ="18"
+ width="200" />
+ </radio_group>
<check_box
control_name="LipSyncEnabled"
follows="left|top"
height="15"
label="Move avatar lips when speaking"
layout="topleft"
- left="44"
+ left="20"
name="enable_lip_sync"
- top_pad="5"
+ top_pad="10"
width="237"/>
- <check_box
- follows="top|left"
- enabled_control="EnableVoiceChat"
- control_name="PushToTalkToggle"
- height="15"
- label="Toggle speak on/off when I press button in toolbar"
- layout="topleft"
- left="44"
- name="push_to_talk_toggle_check"
- width="237"
- tool_tip="When in toggle mode, press and release the trigger key ONCE to switch your microphone on or off. When not in toggle mode, the microphone broadcasts your voice only while the trigger is being held down."
- top_pad="3"/>
+ <check_box
+ follows="top|left"
+ enabled_control="EnableVoiceChat"
+ control_name="PushToTalkToggle"
+ height="15"
+ label="Toggle speak on/off when I press button in toolbar"
+ layout="topleft"
+ left="20"
+ name="push_to_talk_toggle_check"
+ width="237"
+ tool_tip="When in toggle mode, press and release the trigger key ONCE to switch your microphone on or off. When not in toggle mode, the microphone broadcasts your voice only while the trigger is being held down."
+ top_pad="5"/>
+ <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="Play sounds from gestures"
+ top_pad="5"
+ left="20"/>
<button
control_name="ShowDeviceSettings"
follows="left|top"
@@ -478,7 +485,7 @@
label="Voice Input/Output devices"
layout="topleft"
left="20"
- top_pad="6"
+ top_pad="9"
name="device_settings_btn"
width="230">
</button>