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

View file

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

View file

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

View file

@ -19,14 +19,18 @@ Rectangle {
id: micBar;
readonly property var level: AudioScriptingInterface.inputLevel;
readonly property var clipping: AudioScriptingInterface.clipping;
readonly property var muted: AudioScriptingInterface.muted;
readonly property var pushToTalk: AudioScriptingInterface.pushToTalk;
readonly property var pushingToTalk: AudioScriptingInterface.pushingToTalk;
property var muted: AudioScriptingInterface.muted;
property var pushToTalk: AudioScriptingInterface.pushToTalk;
property var pushingToTalk: AudioScriptingInterface.pushingToTalk;
readonly property var userSpeakingLevel: 0.4;
property bool gated: false;
Component.onCompleted: {
AudioScriptingInterface.noiseGateOpened.connect(function() { gated = false; });
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";
@ -86,8 +90,9 @@ Rectangle {
hoverEnabled: true;
scrollGestureEnabled: false;
onClicked: {
AudioScriptingInterface.muted = !AudioScriptingInterface.muted;
AudioScriptingInterface.muted = !muted;
Tablet.playSound(TabletEnums.ButtonClick);
muted = Qt.binding(function() { return AudioScriptingInterface.muted; }); // restore binding
}
drag.target: dragTarget;
onContainsMouseChanged: {

View file

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