showing ptt text always + hmd mode switch fix

This commit is contained in:
Wayne Chen 2019-03-25 17:32:03 -07:00
parent 6aebd000d6
commit c54e8f5569
5 changed files with 31 additions and 14 deletions

View file

@ -22,7 +22,7 @@ Rectangle {
property var dragTarget: null; property var dragTarget: null;
property bool ignoreRadiusEnabled: AvatarInputs.ignoreRadiusEnabled; property bool ignoreRadiusEnabled: AvatarInputs.ignoreRadiusEnabled;
onIgnoreRadiusEnabledChanged: { function updateOpacity() {
if (ignoreRadiusEnabled) { if (ignoreRadiusEnabled) {
bubbleRect.opacity = 0.7; bubbleRect.opacity = 0.7;
} else { } else {
@ -30,6 +30,14 @@ Rectangle {
} }
} }
Component.onCompleted: {
updateOpacity();
}
onIgnoreRadiusEnabledChanged: {
updateOpacity();
}
color: "#00000000"; color: "#00000000";
border { border {
width: mouseArea.containsMouse || mouseArea.containsPress ? 2 : 0; width: mouseArea.containsMouse || mouseArea.containsPress ? 2 : 0;

View file

@ -177,14 +177,14 @@ Rectangle {
onClicked: { onClicked: {
if (pushToTalk && !checked) { if (pushToTalk && !checked) {
// disable push to talk if unmuting // disable push to talk if unmuting
if ((bar.currentIndex === 0)) { if (bar.currentIndex === 0) {
AudioScriptingInterface.pushToTalkDesktop = false; AudioScriptingInterface.pushToTalkDesktop = false;
} }
else { else {
AudioScriptingInterface.pushToTalkHMD = false; AudioScriptingInterface.pushToTalkHMD = false;
} }
} }
if ((bar.currentIndex === 0)) { if (bar.currentIndex === 0) {
AudioScriptingInterface.mutedDesktop = checked; AudioScriptingInterface.mutedDesktop = checked;
} }
else { else {
@ -293,7 +293,6 @@ Rectangle {
Item { Item {
id: pttTextContainer id: pttTextContainer
visible: pushToTalk;
anchors.top: switchesContainer.bottom; anchors.top: switchesContainer.bottom;
anchors.topMargin: 10; anchors.topMargin: 10;
anchors.left: parent.left; anchors.left: parent.left;

View file

@ -22,14 +22,18 @@ Rectangle {
property var muted: AudioScriptingInterface.muted; property var muted: AudioScriptingInterface.muted;
readonly property var level: AudioScriptingInterface.inputLevel; readonly property var level: AudioScriptingInterface.inputLevel;
readonly property var clipping: AudioScriptingInterface.clipping; readonly property var clipping: AudioScriptingInterface.clipping;
readonly property var pushToTalk: AudioScriptingInterface.pushToTalk; property var pushToTalk: AudioScriptingInterface.pushToTalk;
readonly property var pushingToTalk: AudioScriptingInterface.pushingToTalk; property var pushingToTalk: AudioScriptingInterface.pushingToTalk;
readonly property var userSpeakingLevel: 0.4; readonly property var userSpeakingLevel: 0.4;
property bool gated: false; property bool gated: false;
Component.onCompleted: { Component.onCompleted: {
AudioScriptingInterface.noiseGateOpened.connect(function() { gated = false; }); AudioScriptingInterface.noiseGateOpened.connect(function() { gated = false; });
AudioScriptingInterface.noiseGateClosed.connect(function() { gated = true; }); AudioScriptingInterface.noiseGateClosed.connect(function() { gated = true; });
HMD.displayModeChanged.connect(function() {
muted = AudioScriptingInterface.muted;
pushToTalk = AudioScriptingInterface.pushToTalk;
});
} }
property bool standalone: false; property bool standalone: false;
@ -147,7 +151,6 @@ Rectangle {
Item { Item {
id: status; id: status;
readonly property string color: colors.icon;
visible: (pushToTalk && !pushingToTalk) || muted; visible: (pushToTalk && !pushingToTalk) || muted;
@ -166,7 +169,7 @@ Rectangle {
verticalCenter: parent.verticalCenter; verticalCenter: parent.verticalCenter;
} }
color: parent.color; color: colors.icon;
text: (pushToTalk && !pushingToTalk) ? (HMD.active ? "MUTED PTT" : "MUTED PTT-(T)") : (muted ? "MUTED" : "MUTE"); text: (pushToTalk && !pushingToTalk) ? (HMD.active ? "MUTED PTT" : "MUTED PTT-(T)") : (muted ? "MUTED" : "MUTE");
font.pointSize: 12; font.pointSize: 12;
@ -180,7 +183,7 @@ Rectangle {
width: pushToTalk && !pushingToTalk ? (HMD.active ? 27 : 25) : 50; width: pushToTalk && !pushingToTalk ? (HMD.active ? 27 : 25) : 50;
height: 4; height: 4;
color: parent.color; color: colors.icon;
} }
Rectangle { Rectangle {
@ -191,7 +194,7 @@ Rectangle {
width: pushToTalk && !pushingToTalk ? (HMD.active ? 27 : 25) : 50; width: pushToTalk && !pushingToTalk ? (HMD.active ? 27 : 25) : 50;
height: 4; height: 4;
color: parent.color; color: colors.icon;
} }
} }

View file

@ -19,14 +19,18 @@ Rectangle {
id: micBar; id: micBar;
readonly property var level: AudioScriptingInterface.inputLevel; readonly property var level: AudioScriptingInterface.inputLevel;
readonly property var clipping: AudioScriptingInterface.clipping; readonly property var clipping: AudioScriptingInterface.clipping;
readonly property var muted: AudioScriptingInterface.muted; property var muted: AudioScriptingInterface.muted;
readonly property var pushToTalk: AudioScriptingInterface.pushToTalk; property var pushToTalk: AudioScriptingInterface.pushToTalk;
readonly property var pushingToTalk: AudioScriptingInterface.pushingToTalk; property var pushingToTalk: AudioScriptingInterface.pushingToTalk;
readonly property var userSpeakingLevel: 0.4; readonly property var userSpeakingLevel: 0.4;
property bool gated: false; property bool gated: false;
Component.onCompleted: { Component.onCompleted: {
AudioScriptingInterface.noiseGateOpened.connect(function() { gated = false; }); AudioScriptingInterface.noiseGateOpened.connect(function() { gated = false; });
AudioScriptingInterface.noiseGateClosed.connect(function() { gated = true; }); AudioScriptingInterface.noiseGateClosed.connect(function() { gated = true; });
HMD.displayModeChanged.connect(function() {
muted = AudioScriptingInterface.muted;
pushToTalk = AudioScriptingInterface.pushToTalk;
});
} }
readonly property string unmutedIcon: "../../../icons/tablet-icons/mic-unmute-i.svg"; readonly property string unmutedIcon: "../../../icons/tablet-icons/mic-unmute-i.svg";
@ -86,8 +90,9 @@ Rectangle {
hoverEnabled: true; hoverEnabled: true;
scrollGestureEnabled: false; scrollGestureEnabled: false;
onClicked: { onClicked: {
AudioScriptingInterface.muted = !AudioScriptingInterface.muted; AudioScriptingInterface.muted = !muted;
Tablet.playSound(TabletEnums.ButtonClick); Tablet.playSound(TabletEnums.ButtonClick);
muted = Qt.binding(function() { return AudioScriptingInterface.muted; }); // restore binding
} }
drag.target: dragTarget; drag.target: dragTarget;
onContainsMouseChanged: { onContainsMouseChanged: {

View file

@ -75,6 +75,7 @@ button.clicked.connect(onClicked);
tablet.screenChanged.connect(onScreenChanged); tablet.screenChanged.connect(onScreenChanged);
Audio.mutedChanged.connect(onMuteToggled); Audio.mutedChanged.connect(onMuteToggled);
Audio.pushToTalkChanged.connect(onMuteToggled); Audio.pushToTalkChanged.connect(onMuteToggled);
HMD.displayModeChanged.connect(onMuteToggled);
Script.scriptEnding.connect(function () { Script.scriptEnding.connect(function () {
if (onAudioScreen) { if (onAudioScreen) {
@ -84,6 +85,7 @@ Script.scriptEnding.connect(function () {
tablet.screenChanged.disconnect(onScreenChanged); tablet.screenChanged.disconnect(onScreenChanged);
Audio.mutedChanged.disconnect(onMuteToggled); Audio.mutedChanged.disconnect(onMuteToggled);
Audio.pushToTalkChanged.disconnect(onMuteToggled); Audio.pushToTalkChanged.disconnect(onMuteToggled);
HMD.displayModeChanged.disconnect(onMuteToggled);
tablet.removeButton(button); tablet.removeButton(button);
}); });