warn when muted only affects hmd

This commit is contained in:
Wayne Chen 2019-03-29 10:45:40 -07:00
parent 3c65b92ff5
commit 2622408792
2 changed files with 5 additions and 6 deletions

View file

@ -228,7 +228,7 @@ Rectangle {
anchors.top: noiseReductionSwitch.bottom anchors.top: noiseReductionSwitch.bottom
anchors.topMargin: 24 anchors.topMargin: 24
anchors.left: parent.left anchors.left: parent.left
labelTextOn: qsTr("Push To Talk (T)"); labelTextOn: (bar.currentIndex === 0) ? qsTr("Push To Talk (T)") : qsTr("Push To Talk");
labelTextSize: 16; labelTextSize: 16;
backgroundOnColor: "#E3E3E3"; backgroundOnColor: "#E3E3E3";
checked: (bar.currentIndex === 0) ? AudioScriptingInterface.pushToTalkDesktop : AudioScriptingInterface.pushToTalkHMD; checked: (bar.currentIndex === 0) ? AudioScriptingInterface.pushToTalkDesktop : AudioScriptingInterface.pushToTalkHMD;
@ -254,7 +254,7 @@ Rectangle {
switchWidth: root.switchWidth; switchWidth: root.switchWidth;
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
labelTextOn: qsTr("Warn when muted"); labelTextOn: qsTr("Warn when muted in HMD");
labelTextSize: 16; labelTextSize: 16;
backgroundOnColor: "#E3E3E3"; backgroundOnColor: "#E3E3E3";
checked: AudioScriptingInterface.warnWhenMuted; checked: AudioScriptingInterface.warnWhenMuted;

View file

@ -18,7 +18,6 @@ import TabletScriptingInterface 1.0
Rectangle { Rectangle {
id: micBar; id: micBar;
readonly property var level: AudioScriptingInterface.inputLevel; readonly property var level: AudioScriptingInterface.inputLevel;
readonly property var warnWhenMuted: AudioScriptingInterface.warnWhenMuted;
readonly property var clipping: AudioScriptingInterface.clipping; readonly property var clipping: AudioScriptingInterface.clipping;
property var muted: AudioScriptingInterface.muted; property var muted: AudioScriptingInterface.muted;
property var pushToTalk: AudioScriptingInterface.pushToTalk; property var pushToTalk: AudioScriptingInterface.pushToTalk;
@ -55,7 +54,7 @@ Rectangle {
opacity: 0.7; opacity: 0.7;
onLevelChanged: { onLevelChanged: {
var rectOpacity = (muted && (level >= userSpeakingLevel)) && warnWhenMuted ? 1.0 : 0.7; var rectOpacity = (muted && (level >= userSpeakingLevel)) ? 1.0 : 0.7;
if (pushToTalk && !pushingToTalk) { if (pushToTalk && !pushingToTalk) {
rectOpacity = (level >= userSpeakingLevel) ? 1.0 : 0.7; rectOpacity = (level >= userSpeakingLevel) ? 1.0 : 0.7;
} else if (mouseArea.containsMouse && rectOpacity != 1.0) { } else if (mouseArea.containsMouse && rectOpacity != 1.0) {
@ -164,7 +163,7 @@ Rectangle {
Item { Item {
id: status; id: status;
visible: pushToTalk || (muted && (level >= userSpeakingLevel) && warnWhenMuted); visible: pushToTalk || (muted && (level >= userSpeakingLevel);
anchors { anchors {
left: parent.left; left: parent.left;
@ -188,7 +187,7 @@ Rectangle {
verticalCenter: parent.verticalCenter; verticalCenter: parent.verticalCenter;
} }
color: pushToTalk ? (pushingToTalk ? colors.unmutedColor : colors.mutedColor) : (level >= userSpeakingLevel && muted && warnWhenMuted) ? colors.mutedColor : colors.unmutedColor; color: pushToTalk ? (pushingToTalk ? colors.unmutedColor : colors.mutedColor) : (level >= userSpeakingLevel && muted) ? colors.mutedColor : colors.unmutedColor;
font.bold: true font.bold: true
text: pushToTalk ? (HMD.active ? "PTT" : "PTT-(T)") : (muted ? "MUTED" : "MUTE"); text: pushToTalk ? (HMD.active ? "PTT" : "PTT-(T)") : (muted ? "MUTED" : "MUTE");