Fix BUGZ-336

This commit is contained in:
Zach Fox 2019-05-23 14:25:06 -07:00
parent 3232b1a028
commit 78fdd2d673
2 changed files with 10 additions and 18 deletions

View file

@ -251,6 +251,7 @@ Flickable {
} }
SimplifiedControls.Button { SimplifiedControls.Button {
id: audioLoopbackButton
property bool audioLoopedBack: AudioScriptingInterface.getLocalEcho() property bool audioLoopedBack: AudioScriptingInterface.getLocalEcho()
function startAudioLoopback() { function startAudioLoopback() {
@ -266,17 +267,14 @@ Flickable {
} }
} }
Timer { Component.onDestruction: stopAudioLoopback();
id: loopbackTimer
interval: 8000 onVisibleChanged: {
running: false if (!visible) {
repeat: false
onTriggered: {
stopAudioLoopback(); stopAudioLoopback();
} }
} }
id: testYourMicButton
enabled: !HMD.active enabled: !HMD.active
anchors.left: parent.left anchors.left: parent.left
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
@ -285,10 +283,8 @@ Flickable {
text: audioLoopedBack ? "STOP TESTING" : "TEST YOUR MIC" text: audioLoopedBack ? "STOP TESTING" : "TEST YOUR MIC"
onClicked: { onClicked: {
if (audioLoopedBack) { if (audioLoopedBack) {
loopbackTimer.stop();
stopAudioLoopback(); stopAudioLoopback();
} else { } else {
loopbackTimer.restart();
startAudioLoopback(); startAudioLoopback();
} }
} }

View file

@ -235,6 +235,7 @@ Flickable {
} }
SimplifiedControls.Button { SimplifiedControls.Button {
id: audioLoopbackButton
property bool audioLoopedBack: AudioScriptingInterface.getLocalEcho() property bool audioLoopedBack: AudioScriptingInterface.getLocalEcho()
function startAudioLoopback() { function startAudioLoopback() {
@ -250,17 +251,14 @@ Flickable {
} }
} }
Timer { Component.onDestruction: stopAudioLoopback();
id: loopbackTimer
interval: 8000 onVisibleChanged: {
running: false if (!visible) {
repeat: false
onTriggered: {
stopAudioLoopback(); stopAudioLoopback();
} }
} }
id: testYourMicButton
enabled: HMD.active enabled: HMD.active
anchors.left: parent.left anchors.left: parent.left
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
@ -269,10 +267,8 @@ Flickable {
text: audioLoopedBack ? "STOP TESTING" : "TEST YOUR MIC" text: audioLoopedBack ? "STOP TESTING" : "TEST YOUR MIC"
onClicked: { onClicked: {
if (audioLoopedBack) { if (audioLoopedBack) {
loopbackTimer.stop();
stopAudioLoopback(); stopAudioLoopback();
} else { } else {
loopbackTimer.restart();
startAudioLoopback(); startAudioLoopback();
} }
} }