mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-31 10:01:11 +02:00
Merge pull request #15613 from zfox23/SUI/newAudioProperties
Fix the janky audio output settings UI
This commit is contained in:
commit
934ea76966
6 changed files with 140 additions and 57 deletions
|
@ -68,21 +68,20 @@ Flickable {
|
||||||
|
|
||||||
SimplifiedControls.Slider {
|
SimplifiedControls.Slider {
|
||||||
id: peopleVolume
|
id: peopleVolume
|
||||||
property real lastValueSent
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
|
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
|
||||||
height: 30
|
height: 30
|
||||||
labelText: "People Volume"
|
labelText: "People Volume"
|
||||||
from: -60.0
|
from: simplifiedUI.numericConstants.mutedValue
|
||||||
to: 20.0
|
to: 20.0
|
||||||
defaultValue: 0.0
|
defaultValue: 0.0
|
||||||
stepSize: 5.0
|
stepSize: 5.0
|
||||||
value: AudioScriptingInterface.getAvatarGain()
|
value: AudioScriptingInterface.avatarGain
|
||||||
live: true
|
live: true
|
||||||
function updatePeopleGain(sliderValue) {
|
function updatePeopleGain(sliderValue) {
|
||||||
if (AudioScriptingInterface.getAvatarGain() !== sliderValue) {
|
if (AudioScriptingInterface.avatarGain !== sliderValue) {
|
||||||
AudioScriptingInterface.setAvatarGain(sliderValue);
|
AudioScriptingInterface.avatarGain = sliderValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
|
@ -97,22 +96,21 @@ Flickable {
|
||||||
|
|
||||||
SimplifiedControls.Slider {
|
SimplifiedControls.Slider {
|
||||||
id: environmentVolume
|
id: environmentVolume
|
||||||
property real lastValueSent
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
Layout.topMargin: 2
|
Layout.topMargin: 2
|
||||||
height: 30
|
height: 30
|
||||||
labelText: "Environment Volume"
|
labelText: "Environment Volume"
|
||||||
from: -60.0
|
from: simplifiedUI.numericConstants.mutedValue
|
||||||
to: 20.0
|
to: 20.0
|
||||||
defaultValue: 0.0
|
defaultValue: 0.0
|
||||||
stepSize: 5.0
|
stepSize: 5.0
|
||||||
value: AudioScriptingInterface.getInjectorGain()
|
value: AudioScriptingInterface.serverInjectorGain
|
||||||
live: true
|
live: true
|
||||||
function updateEnvironmentGain(sliderValue) {
|
function updateEnvironmentGain(sliderValue) {
|
||||||
if (AudioScriptingInterface.getInjectorGain() !== sliderValue) {
|
if (AudioScriptingInterface.serverInjectorGain !== sliderValue) {
|
||||||
AudioScriptingInterface.setInjectorGain(sliderValue);
|
AudioScriptingInterface.serverInjectorGain = sliderValue;
|
||||||
AudioScriptingInterface.setLocalInjectorGain(sliderValue);
|
AudioScriptingInterface.localInjectorGain = sliderValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
|
@ -127,21 +125,20 @@ Flickable {
|
||||||
|
|
||||||
SimplifiedControls.Slider {
|
SimplifiedControls.Slider {
|
||||||
id: systemSoundVolume
|
id: systemSoundVolume
|
||||||
property real lastValueSent
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
Layout.topMargin: 2
|
Layout.topMargin: 2
|
||||||
height: 30
|
height: 30
|
||||||
labelText: "System Sound Volume"
|
labelText: "System Sound Volume"
|
||||||
from: -60.0
|
from: simplifiedUI.numericConstants.mutedValue
|
||||||
to: 20.0
|
to: 20.0
|
||||||
defaultValue: 0.0
|
defaultValue: 0.0
|
||||||
stepSize: 5.0
|
stepSize: 5.0
|
||||||
value: AudioScriptingInterface.getSystemInjectorGain()
|
value: AudioScriptingInterface.systemInjectorGain
|
||||||
live: true
|
live: true
|
||||||
function updateSystemGain(sliderValue) {
|
function updateSystemGain(sliderValue) {
|
||||||
if (AudioScriptingInterface.getSystemInjectorGain() !== sliderValue) {
|
if (AudioScriptingInterface.systemInjectorGain !== sliderValue) {
|
||||||
AudioScriptingInterface.setSystemInjectorGain(sliderValue);
|
AudioScriptingInterface.systemInjectorGain = sliderValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
|
|
|
@ -221,4 +221,8 @@ QtObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readonly property QtObject numericConstants: QtObject {
|
||||||
|
readonly property real mutedValue: -60.0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,7 +203,10 @@ Rectangle {
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: outputDeviceButton
|
id: outputDeviceButton
|
||||||
property bool outputMuted: false
|
property bool outputMuted: AudioScriptingInterface.avatarGain === simplifiedUI.numericConstants.mutedValue &&
|
||||||
|
AudioScriptingInterface.serverInjectorGain === simplifiedUI.numericConstants.mutedValue &&
|
||||||
|
AudioScriptingInterface.localInjectorGain === simplifiedUI.numericConstants.mutedValue &&
|
||||||
|
AudioScriptingInterface.systemInjectorGain === simplifiedUI.numericConstants.mutedValue
|
||||||
source: outputDeviceButton.outputMuted ? "./images/outputDeviceMuted.svg" : "./images/outputDeviceLoud.svg"
|
source: outputDeviceButton.outputMuted ? "./images/outputDeviceMuted.svg" : "./images/outputDeviceLoud.svg"
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: 20
|
width: 20
|
||||||
|
@ -228,9 +231,8 @@ Rectangle {
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Tablet.playSound(TabletEnums.ButtonClick);
|
Tablet.playSound(TabletEnums.ButtonClick);
|
||||||
outputDeviceButton.outputMuted = !outputDeviceButton.outputMuted;
|
|
||||||
|
|
||||||
if (outputDeviceButton.outputMuted && !AudioScriptingInterface.muted) {
|
if (!outputDeviceButton.outputMuted && !AudioScriptingInterface.muted) {
|
||||||
AudioScriptingInterface.muted = true;
|
AudioScriptingInterface.muted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,7 +240,7 @@ Rectangle {
|
||||||
"source": "SimplifiedTopBar.qml",
|
"source": "SimplifiedTopBar.qml",
|
||||||
"method": "setOutputMuted",
|
"method": "setOutputMuted",
|
||||||
"data": {
|
"data": {
|
||||||
"outputMuted": outputDeviceButton.outputMuted
|
"outputMuted": !outputDeviceButton.outputMuted
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -454,10 +456,6 @@ Rectangle {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "updateOutputMuted":
|
|
||||||
outputDeviceButton.outputMuted = message.data.outputMuted;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "updateStatusButton":
|
case "updateStatusButton":
|
||||||
statusButton.currentStatus = message.data.currentStatus;
|
statusButton.currentStatus = message.data.currentStatus;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -400,10 +400,19 @@ void Audio::setReverbOptions(const AudioEffectOptions* options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Audio::setAvatarGain(float gain) {
|
void Audio::setAvatarGain(float gain) {
|
||||||
|
bool changed = false;
|
||||||
|
if (getAvatarGain() != gain) {
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
// ask the NodeList to set the master avatar gain
|
// ask the NodeList to set the master avatar gain
|
||||||
DependencyManager::get<NodeList>()->setAvatarGain(QUuid(), gain);
|
DependencyManager::get<NodeList>()->setAvatarGain(QUuid(), gain);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
emit avatarGainChanged(gain);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float Audio::getAvatarGain() {
|
float Audio::getAvatarGain() {
|
||||||
|
@ -413,10 +422,19 @@ float Audio::getAvatarGain() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Audio::setInjectorGain(float gain) {
|
void Audio::setInjectorGain(float gain) {
|
||||||
|
bool changed = false;
|
||||||
|
if (getInjectorGain() != gain) {
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
// ask the NodeList to set the audio injector gain
|
// ask the NodeList to set the audio injector gain
|
||||||
DependencyManager::get<NodeList>()->setInjectorGain(gain);
|
DependencyManager::get<NodeList>()->setInjectorGain(gain);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
emit serverInjectorGainChanged(gain);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float Audio::getInjectorGain() {
|
float Audio::getInjectorGain() {
|
||||||
|
@ -426,6 +444,11 @@ float Audio::getInjectorGain() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Audio::setLocalInjectorGain(float gain) {
|
void Audio::setLocalInjectorGain(float gain) {
|
||||||
|
bool changed = false;
|
||||||
|
if (getLocalInjectorGain() != gain) {
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
if (_localInjectorGain != gain) {
|
if (_localInjectorGain != gain) {
|
||||||
_localInjectorGain = gain;
|
_localInjectorGain = gain;
|
||||||
|
@ -436,6 +459,11 @@ void Audio::setLocalInjectorGain(float gain) {
|
||||||
DependencyManager::get<AudioClient>()->setLocalInjectorGain(gain);
|
DependencyManager::get<AudioClient>()->setLocalInjectorGain(gain);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
emit localInjectorGainChanged(gain);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float Audio::getLocalInjectorGain() {
|
float Audio::getLocalInjectorGain() {
|
||||||
|
@ -445,6 +473,11 @@ float Audio::getLocalInjectorGain() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Audio::setSystemInjectorGain(float gain) {
|
void Audio::setSystemInjectorGain(float gain) {
|
||||||
|
bool changed = false;
|
||||||
|
if (getSystemInjectorGain() != gain) {
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
if (_systemInjectorGain != gain) {
|
if (_systemInjectorGain != gain) {
|
||||||
_systemInjectorGain = gain;
|
_systemInjectorGain = gain;
|
||||||
|
@ -455,6 +488,10 @@ void Audio::setSystemInjectorGain(float gain) {
|
||||||
DependencyManager::get<AudioClient>()->setSystemInjectorGain(gain);
|
DependencyManager::get<AudioClient>()->setSystemInjectorGain(gain);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
emit systemInjectorGainChanged(gain);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float Audio::getSystemInjectorGain() {
|
float Audio::getSystemInjectorGain() {
|
||||||
|
|
|
@ -66,6 +66,10 @@ class Audio : public AudioScriptingInterface, protected ReadWriteLockable {
|
||||||
* @property {boolean} pushToTalkHMD - <code>true</code> if HMD push-to-talk is enabled, otherwise <code>false</code>.
|
* @property {boolean} pushToTalkHMD - <code>true</code> if HMD push-to-talk is enabled, otherwise <code>false</code>.
|
||||||
* @property {boolean} pushingToTalk - <code>true</code> if the user is currently pushing-to-talk, otherwise
|
* @property {boolean} pushingToTalk - <code>true</code> if the user is currently pushing-to-talk, otherwise
|
||||||
* <code>false</code>.
|
* <code>false</code>.
|
||||||
|
* @property {float} avatarGain - The gain (relative volume) that avatars' voices are played at. This gain is used at the server.
|
||||||
|
* @property {float} localInjectorGain - The gain (relative volume) that local injectors (local environment sounds) are played at.
|
||||||
|
* @property {float} serverInjectorGain - The gain (relative volume) that server injectors (server environment sounds) are played at. This gain is used at the server.
|
||||||
|
* @property {float} systemInjectorGain - The gain (relative volume) that system sounds are played at.
|
||||||
*
|
*
|
||||||
* @comment The following properties are from AudioScriptingInterface.h.
|
* @comment The following properties are from AudioScriptingInterface.h.
|
||||||
* @property {boolean} isStereoInput - <code>true</code> if the input audio is being used in stereo, otherwise
|
* @property {boolean} isStereoInput - <code>true</code> if the input audio is being used in stereo, otherwise
|
||||||
|
@ -90,6 +94,10 @@ class Audio : public AudioScriptingInterface, protected ReadWriteLockable {
|
||||||
Q_PROPERTY(bool pushToTalkDesktop READ getPTTDesktop WRITE setPTTDesktop NOTIFY pushToTalkDesktopChanged)
|
Q_PROPERTY(bool pushToTalkDesktop READ getPTTDesktop WRITE setPTTDesktop NOTIFY pushToTalkDesktopChanged)
|
||||||
Q_PROPERTY(bool pushToTalkHMD READ getPTTHMD WRITE setPTTHMD NOTIFY pushToTalkHMDChanged)
|
Q_PROPERTY(bool pushToTalkHMD READ getPTTHMD WRITE setPTTHMD NOTIFY pushToTalkHMDChanged)
|
||||||
Q_PROPERTY(bool pushingToTalk READ getPushingToTalk WRITE setPushingToTalk NOTIFY pushingToTalkChanged)
|
Q_PROPERTY(bool pushingToTalk READ getPushingToTalk WRITE setPushingToTalk NOTIFY pushingToTalkChanged)
|
||||||
|
Q_PROPERTY(float avatarGain READ getAvatarGain WRITE setAvatarGain NOTIFY avatarGainChanged)
|
||||||
|
Q_PROPERTY(float localInjectorGain READ getLocalInjectorGain WRITE setLocalInjectorGain NOTIFY localInjectorGainChanged)
|
||||||
|
Q_PROPERTY(float serverInjectorGain READ getInjectorGain WRITE setInjectorGain NOTIFY serverInjectorGainChanged)
|
||||||
|
Q_PROPERTY(float systemInjectorGain READ getSystemInjectorGain WRITE setSystemInjectorGain NOTIFY systemInjectorGainChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QString AUDIO;
|
static QString AUDIO;
|
||||||
|
@ -412,6 +420,38 @@ signals:
|
||||||
*/
|
*/
|
||||||
void pushingToTalkChanged(bool talking);
|
void pushingToTalkChanged(bool talking);
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Triggered when the avatar gain changes.
|
||||||
|
* @function Audio.avatarGainChanged
|
||||||
|
* @param {float} gain - The new avatar gain value.
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void avatarGainChanged(float gain);
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Triggered when the local injector gain changes.
|
||||||
|
* @function Audio.localInjectorGainChanged
|
||||||
|
* @param {float} gain - The new local injector gain value.
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void localInjectorGainChanged(float gain);
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Triggered when the server injector gain changes.
|
||||||
|
* @function Audio.serverInjectorGainChanged
|
||||||
|
* @param {float} gain - The new server injector gain value.
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void serverInjectorGainChanged(float gain);
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Triggered when the system injector gain changes.
|
||||||
|
* @function Audio.systemInjectorGainChanged
|
||||||
|
* @param {float} gain - The new system injector gain value.
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void systemInjectorGainChanged(float gain);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
|
|
@ -238,40 +238,39 @@ function updateOutputDeviceMutedOverlay(isMuted) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var savedAvatarGain = Audio.getAvatarGain();
|
var savedAvatarGain = Audio.avatarGain;
|
||||||
var savedInjectorGain = Audio.getInjectorGain();
|
var savedServerInjectorGain = Audio.serverInjectorGain;
|
||||||
var savedLocalInjectorGain = Audio.getLocalInjectorGain();
|
var savedLocalInjectorGain = Audio.localInjectorGain;
|
||||||
var savedSystemInjectorGain = Audio.getSystemInjectorGain();
|
var savedSystemInjectorGain = Audio.systemInjectorGain;
|
||||||
|
var MUTED_VALUE_DB = -60; // This should always match `SimplifiedConstants.qml` -> numericConstants -> mutedValue!
|
||||||
function setOutputMuted(outputMuted) {
|
function setOutputMuted(outputMuted) {
|
||||||
updateOutputDeviceMutedOverlay(outputMuted);
|
|
||||||
|
|
||||||
if (outputMuted) {
|
if (outputMuted) {
|
||||||
savedAvatarGain = Audio.getAvatarGain();
|
savedAvatarGain = Audio.avatarGain;
|
||||||
savedInjectorGain = Audio.getInjectorGain();
|
savedServerInjectorGain = Audio.serverInjectorGain;
|
||||||
savedLocalInjectorGain = Audio.getLocalInjectorGain();
|
savedLocalInjectorGain = Audio.localInjectorGain;
|
||||||
savedSystemInjectorGain = Audio.getSystemInjectorGain();
|
savedSystemInjectorGain = Audio.systemInjectorGain;
|
||||||
|
|
||||||
Audio.setAvatarGain(-60);
|
Audio.avatarGain = MUTED_VALUE_DB;
|
||||||
Audio.setInjectorGain(-60);
|
Audio.serverInjectorGain = MUTED_VALUE_DB;
|
||||||
Audio.setLocalInjectorGain(-60);
|
Audio.localInjectorGain = MUTED_VALUE_DB;
|
||||||
Audio.setSystemInjectorGain(-60);
|
Audio.systemInjectorGain = MUTED_VALUE_DB;
|
||||||
} else {
|
} else {
|
||||||
if (savedAvatarGain === -60) {
|
if (savedAvatarGain === MUTED_VALUE_DB) {
|
||||||
savedAvatarGain = 0;
|
savedAvatarGain = 0;
|
||||||
}
|
}
|
||||||
Audio.setAvatarGain(savedAvatarGain);
|
Audio.avatarGain = savedAvatarGain;
|
||||||
if (savedInjectorGain === -60) {
|
if (savedServerInjectorGain === MUTED_VALUE_DB) {
|
||||||
savedInjectorGain = 0;
|
savedServerInjectorGain = 0;
|
||||||
}
|
}
|
||||||
Audio.setInjectorGain(savedInjectorGain);
|
Audio.serverInjectorGain = savedServerInjectorGain;
|
||||||
if (savedLocalInjectorGain === -60) {
|
if (savedLocalInjectorGain === MUTED_VALUE_DB) {
|
||||||
savedLocalInjectorGain = 0;
|
savedLocalInjectorGain = 0;
|
||||||
}
|
}
|
||||||
Audio.setLocalInjectorGain(savedLocalInjectorGain);
|
Audio.localInjectorGain = savedLocalInjectorGain;
|
||||||
if (savedSystemInjectorGain === -60) {
|
if (savedSystemInjectorGain === MUTED_VALUE_DB) {
|
||||||
savedSystemInjectorGain = 0;
|
savedSystemInjectorGain = 0;
|
||||||
}
|
}
|
||||||
Audio.setSystemInjectorGain(savedSystemInjectorGain);
|
Audio.systemInjectorGain = savedSystemInjectorGain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -334,7 +333,10 @@ function onTopBarClosed() {
|
||||||
|
|
||||||
|
|
||||||
function isOutputMuted() {
|
function isOutputMuted() {
|
||||||
return Audio.getAvatarGain() === -60 && Audio.getInjectorGain() === -60 && Audio.getLocalInjectorGain() === -60 && Audio.getSystemInjectorGain() === -60;
|
return Audio.avatarGain === MUTED_VALUE_DB &&
|
||||||
|
Audio.serverInjectorGain === MUTED_VALUE_DB &&
|
||||||
|
Audio.localInjectorGain === MUTED_VALUE_DB &&
|
||||||
|
Audio.systemInjectorGain === MUTED_VALUE_DB;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -371,14 +373,6 @@ function loadSimplifiedTopBar() {
|
||||||
// The eventbridge takes a nonzero time to initialize, so we have to wait a bit
|
// The eventbridge takes a nonzero time to initialize, so we have to wait a bit
|
||||||
// for the QML to load and for that to happen before updating the UI.
|
// for the QML to load and for that to happen before updating the UI.
|
||||||
Script.setTimeout(function() {
|
Script.setTimeout(function() {
|
||||||
topBarWindow.sendToQml({
|
|
||||||
"source": "simplifiedUI.js",
|
|
||||||
"method": "updateOutputMuted",
|
|
||||||
"data": {
|
|
||||||
"outputMuted": isOutputMuted()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
sendLocalStatusToQml();
|
sendLocalStatusToQml();
|
||||||
}, WAIT_FOR_TOP_BAR_MS);
|
}, WAIT_FOR_TOP_BAR_MS);
|
||||||
}
|
}
|
||||||
|
@ -469,6 +463,11 @@ function onStatusChanged() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function maybeUpdateOutputDeviceMutedOverlay() {
|
||||||
|
updateOutputDeviceMutedOverlay(isOutputMuted());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var simplifiedNametag = Script.require("./simplifiedNametag/simplifiedNametag.js?" + Date.now());
|
var simplifiedNametag = Script.require("./simplifiedNametag/simplifiedNametag.js?" + Date.now());
|
||||||
var SimplifiedStatusIndicator = Script.require("./simplifiedStatusIndicator/simplifiedStatusIndicator.js?" + Date.now());
|
var SimplifiedStatusIndicator = Script.require("./simplifiedStatusIndicator/simplifiedStatusIndicator.js?" + Date.now());
|
||||||
var si;
|
var si;
|
||||||
|
@ -501,6 +500,10 @@ function startup() {
|
||||||
Audio.mutedDesktopChanged.connect(onDesktopInputDeviceMutedChanged);
|
Audio.mutedDesktopChanged.connect(onDesktopInputDeviceMutedChanged);
|
||||||
Window.geometryChanged.connect(onGeometryChanged);
|
Window.geometryChanged.connect(onGeometryChanged);
|
||||||
HMD.displayModeChanged.connect(ensureFirstPersonCameraInHMD);
|
HMD.displayModeChanged.connect(ensureFirstPersonCameraInHMD);
|
||||||
|
Audio.avatarGainChanged.connect(maybeUpdateOutputDeviceMutedOverlay);
|
||||||
|
Audio.localInjectorGainChanged.connect(maybeUpdateOutputDeviceMutedOverlay);
|
||||||
|
Audio.serverInjectorGainChanged.connect(maybeUpdateOutputDeviceMutedOverlay);
|
||||||
|
Audio.systemInjectorGainChanged.connect(maybeUpdateOutputDeviceMutedOverlay);
|
||||||
|
|
||||||
oldShowAudioTools = AvatarInputs.showAudioTools;
|
oldShowAudioTools = AvatarInputs.showAudioTools;
|
||||||
AvatarInputs.showAudioTools = false;
|
AvatarInputs.showAudioTools = false;
|
||||||
|
@ -551,6 +554,10 @@ function shutdown() {
|
||||||
Audio.mutedDesktopChanged.disconnect(onDesktopInputDeviceMutedChanged);
|
Audio.mutedDesktopChanged.disconnect(onDesktopInputDeviceMutedChanged);
|
||||||
Window.geometryChanged.disconnect(onGeometryChanged);
|
Window.geometryChanged.disconnect(onGeometryChanged);
|
||||||
HMD.displayModeChanged.disconnect(ensureFirstPersonCameraInHMD);
|
HMD.displayModeChanged.disconnect(ensureFirstPersonCameraInHMD);
|
||||||
|
Audio.avatarGainChanged.disconnect(maybeUpdateOutputDeviceMutedOverlay);
|
||||||
|
Audio.localInjectorGainChanged.disconnect(maybeUpdateOutputDeviceMutedOverlay);
|
||||||
|
Audio.serverInjectorGainChanged.disconnect(maybeUpdateOutputDeviceMutedOverlay);
|
||||||
|
Audio.systemInjectorGainChanged.disconnect(maybeUpdateOutputDeviceMutedOverlay);
|
||||||
|
|
||||||
AvatarInputs.showAudioTools = oldShowAudioTools;
|
AvatarInputs.showAudioTools = oldShowAudioTools;
|
||||||
AvatarInputs.showBubbleTools = oldShowBubbleTools;
|
AvatarInputs.showBubbleTools = oldShowBubbleTools;
|
||||||
|
|
Loading…
Reference in a new issue