Merge pull request #15625 from zfox23/SUI/BUGZ-336

Fix BUGZ-336: Microphone test does not stop unless you press the button to "stop test"
This commit is contained in:
Shannon Romano 2019-05-23 15:17:37 -07:00 committed by GitHub
commit aaf4bef34e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 18 deletions

View file

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

View file

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