From 37bded0a9b0c13a102f35ee6ad747624e0656263 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 18:48:43 +0200 Subject: [PATCH 01/14] Move volume control up from bottom --- interface/resources/qml/hifi/audio/Audio.qml | 330 +++++++++---------- 1 file changed, 165 insertions(+), 165 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 963a3246fc..78be1d2d06 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -328,171 +328,7 @@ Rectangle { qsTr("Press and hold grip triggers on both of your controllers to talk."); } } - - Separator { - id: secondSeparator; - anchors.top: pttTextContainer.visible ? pttTextContainer.bottom : switchesContainer.bottom; - anchors.topMargin: 10; - } - - Item { - id: inputDeviceHeader - x: margins.paddings; - width: parent.width - margins.paddings*2; - height: 36; - anchors.top: secondSeparator.bottom; - anchors.topMargin: 10; - - HiFiGlyphs { - width: margins.sizeCheckBox; - text: hifi.glyphs.mic; - color: hifi.colors.white; - anchors.left: parent.left; - anchors.leftMargin: -size/4; //the glyph has empty space at left about 25% - anchors.verticalCenter: parent.verticalCenter; - size: 30; - } - RalewayRegular { - anchors.verticalCenter: parent.verticalCenter; - width: margins.sizeText + margins.sizeLevel; - anchors.left: parent.left; - anchors.leftMargin: margins.sizeCheckBox; - size: 22; - color: hifi.colors.white; - text: qsTr("Choose input device"); - } - } - - ListView { - id: inputView; - width: rightMostInputLevelPos; - anchors.top: inputDeviceHeader.bottom; - anchors.topMargin: 10; - x: margins.paddings - interactive: false; - height: contentHeight; - - clip: true; - model: AudioScriptingInterface.devices.input; - delegate: Item { - width: rightMostInputLevelPos - margins.paddings*2 - height: ((type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1)) ? - (margins.sizeCheckBox > checkBoxInput.implicitHeight ? margins.sizeCheckBox + 4 : checkBoxInput.implicitHeight + 4) : 0 - visible: (type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1) - AudioControls.CheckBox { - id: checkBoxInput - anchors.left: parent.left - spacing: margins.sizeCheckBox - boxSize - anchors.verticalCenter: parent.verticalCenter - width: parent.width - inputLevel.width - clip: true - checkable: !checked - checked: bar.currentIndex === 0 ? selectedDesktop : selectedHMD; - boxSize: margins.sizeCheckBox / 2 - isRound: true - text: devicename - fontSize: 16; - onPressed: { - if (!checked) { - stereoInput.checked = false; - AudioScriptingInterface.setStereoInput(false); // the next selected audio device might not support stereo - AudioScriptingInterface.setInputDevice(info, bar.currentIndex === 1); - } - } - } - AudioControls.InputPeak { - id: inputLevel - anchors.right: parent.right - peak: model.peak; - anchors.verticalCenter: parent.verticalCenter - visible: ((bar.currentIndex === 1 && isVR) || - (bar.currentIndex === 0 && !isVR)) && - AudioScriptingInterface.devices.input.peakValuesAvailable; - } - } - } - - AudioControls.LoopbackAudio { - id: loopbackAudio - x: margins.paddings - anchors.top: inputView.bottom; - anchors.topMargin: 10; - - visible: (bar.currentIndex === 1 && isVR) || - (bar.currentIndex === 0 && !isVR); - anchors { left: parent.left; leftMargin: margins.paddings } - } - - Separator { - id: thirdSeparator; - anchors.top: loopbackAudio.visible ? loopbackAudio.bottom : inputView.bottom; - anchors.topMargin: 10; - } - - Item { - id: outputDeviceHeader; - anchors.topMargin: 10; - anchors.top: thirdSeparator.bottom; - x: margins.paddings; - width: parent.width - margins.paddings*2 - height: 36 - - HiFiGlyphs { - anchors.left: parent.left - anchors.leftMargin: -size/4 //the glyph has empty space at left about 25% - anchors.verticalCenter: parent.verticalCenter; - width: margins.sizeCheckBox - text: hifi.glyphs.unmuted; - color: hifi.colors.white; - size: 36; - } - - RalewayRegular { - width: margins.sizeText + margins.sizeLevel - anchors.left: parent.left - anchors.leftMargin: margins.sizeCheckBox - anchors.verticalCenter: parent.verticalCenter; - size: 22; - color: hifi.colors.white; - text: qsTr("Choose output device"); - } - } - - ListView { - id: outputView - width: parent.width - margins.paddings*2 - x: margins.paddings; - interactive: false; - height: contentHeight; - anchors.top: outputDeviceHeader.bottom; - anchors.topMargin: 10; - clip: true; - model: AudioScriptingInterface.devices.output; - delegate: Item { - width: rightMostInputLevelPos - height: ((type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1)) ? - (margins.sizeCheckBox > checkBoxOutput.implicitHeight ? margins.sizeCheckBox + 4 : checkBoxOutput.implicitHeight + 4) : 0 - visible: (type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1) - - AudioControls.CheckBox { - id: checkBoxOutput - width: parent.width - spacing: margins.sizeCheckBox - boxSize - boxSize: margins.sizeCheckBox / 2 - isRound: true - checked: bar.currentIndex === 0 ? selectedDesktop : selectedHMD; - checkable: !checked - text: devicename - fontSize: 16 - onPressed: { - if (!checked) { - AudioScriptingInterface.setOutputDevice(info, bar.currentIndex === 1); - } - } - } - } - } - + Item { id: avatarGainContainer x: margins.paddings; @@ -677,6 +513,170 @@ Rectangle { } } + Separator { + id: secondSeparator; + anchors.top: pttTextContainer.visible ? pttTextContainer.bottom : switchesContainer.bottom; + anchors.topMargin: 10; + } + + Item { + id: inputDeviceHeader + x: margins.paddings; + width: parent.width - margins.paddings*2; + height: 36; + anchors.top: secondSeparator.bottom; + anchors.topMargin: 10; + + HiFiGlyphs { + width: margins.sizeCheckBox; + text: hifi.glyphs.mic; + color: hifi.colors.white; + anchors.left: parent.left; + anchors.leftMargin: -size/4; //the glyph has empty space at left about 25% + anchors.verticalCenter: parent.verticalCenter; + size: 30; + } + RalewayRegular { + anchors.verticalCenter: parent.verticalCenter; + width: margins.sizeText + margins.sizeLevel; + anchors.left: parent.left; + anchors.leftMargin: margins.sizeCheckBox; + size: 22; + color: hifi.colors.white; + text: qsTr("Choose input device"); + } + } + + ListView { + id: inputView; + width: rightMostInputLevelPos; + anchors.top: inputDeviceHeader.bottom; + anchors.topMargin: 10; + x: margins.paddings + interactive: false; + height: contentHeight; + + clip: true; + model: AudioScriptingInterface.devices.input; + delegate: Item { + width: rightMostInputLevelPos - margins.paddings*2 + height: ((type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1)) ? + (margins.sizeCheckBox > checkBoxInput.implicitHeight ? margins.sizeCheckBox + 4 : checkBoxInput.implicitHeight + 4) : 0 + visible: (type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1) + AudioControls.CheckBox { + id: checkBoxInput + anchors.left: parent.left + spacing: margins.sizeCheckBox - boxSize + anchors.verticalCenter: parent.verticalCenter + width: parent.width - inputLevel.width + clip: true + checkable: !checked + checked: bar.currentIndex === 0 ? selectedDesktop : selectedHMD; + boxSize: margins.sizeCheckBox / 2 + isRound: true + text: devicename + fontSize: 16; + onPressed: { + if (!checked) { + stereoInput.checked = false; + AudioScriptingInterface.setStereoInput(false); // the next selected audio device might not support stereo + AudioScriptingInterface.setInputDevice(info, bar.currentIndex === 1); + } + } + } + AudioControls.InputPeak { + id: inputLevel + anchors.right: parent.right + peak: model.peak; + anchors.verticalCenter: parent.verticalCenter + visible: ((bar.currentIndex === 1 && isVR) || + (bar.currentIndex === 0 && !isVR)) && + AudioScriptingInterface.devices.input.peakValuesAvailable; + } + } + } + + AudioControls.LoopbackAudio { + id: loopbackAudio + x: margins.paddings + anchors.top: inputView.bottom; + anchors.topMargin: 10; + + visible: (bar.currentIndex === 1 && isVR) || + (bar.currentIndex === 0 && !isVR); + anchors { left: parent.left; leftMargin: margins.paddings } + } + + Separator { + id: thirdSeparator; + anchors.top: loopbackAudio.visible ? loopbackAudio.bottom : inputView.bottom; + anchors.topMargin: 10; + } + + Item { + id: outputDeviceHeader; + anchors.topMargin: 10; + anchors.top: thirdSeparator.bottom; + x: margins.paddings; + width: parent.width - margins.paddings*2 + height: 36 + + HiFiGlyphs { + anchors.left: parent.left + anchors.leftMargin: -size/4 //the glyph has empty space at left about 25% + anchors.verticalCenter: parent.verticalCenter; + width: margins.sizeCheckBox + text: hifi.glyphs.unmuted; + color: hifi.colors.white; + size: 36; + } + + RalewayRegular { + width: margins.sizeText + margins.sizeLevel + anchors.left: parent.left + anchors.leftMargin: margins.sizeCheckBox + anchors.verticalCenter: parent.verticalCenter; + size: 22; + color: hifi.colors.white; + text: qsTr("Choose output device"); + } + } + + ListView { + id: outputView + width: parent.width - margins.paddings*2 + x: margins.paddings; + interactive: false; + height: contentHeight; + anchors.top: outputDeviceHeader.bottom; + anchors.topMargin: 10; + clip: true; + model: AudioScriptingInterface.devices.output; + delegate: Item { + width: rightMostInputLevelPos + height: ((type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1)) ? + (margins.sizeCheckBox > checkBoxOutput.implicitHeight ? margins.sizeCheckBox + 4 : checkBoxOutput.implicitHeight + 4) : 0 + visible: (type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1) + + AudioControls.CheckBox { + id: checkBoxOutput + width: parent.width + spacing: margins.sizeCheckBox - boxSize + boxSize: margins.sizeCheckBox / 2 + isRound: true + checked: bar.currentIndex === 0 ? selectedDesktop : selectedHMD; + checkable: !checked + text: devicename + fontSize: 16 + onPressed: { + if (!checked) { + AudioScriptingInterface.setOutputDevice(info, bar.currentIndex === 1); + } + } + } + } + } + AudioControls.PlaySampleSound { id: playSampleSound x: margins.paddings From eaf2ce89e06a208610e6624f1889b2271e7da352 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 19:23:51 +0200 Subject: [PATCH 02/14] Actually move it up this time --- interface/resources/qml/hifi/audio/Audio.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 78be1d2d06..a9a5d55c69 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -332,7 +332,7 @@ Rectangle { Item { id: avatarGainContainer x: margins.paddings; - anchors.top: outputView.bottom; + anchors.top: pttTextContainer.bottom; anchors.topMargin: 10; width: parent.width - margins.paddings*2 height: avatarGainSliderTextMetrics.height @@ -515,7 +515,7 @@ Rectangle { Separator { id: secondSeparator; - anchors.top: pttTextContainer.visible ? pttTextContainer.bottom : switchesContainer.bottom; + anchors.top: systemInjectorGainContainer.visible ? systemInjectorGainContainer.bottom : switchesContainer.bottom; anchors.topMargin: 10; } From 6b8519c7ff40a12c9a39610c5f150fd76c3c9592 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 19:38:03 +0200 Subject: [PATCH 03/14] Fix "Test your sound" --- interface/resources/qml/hifi/audio/Audio.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index a9a5d55c69..550ebcf037 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -680,7 +680,7 @@ Rectangle { AudioControls.PlaySampleSound { id: playSampleSound x: margins.paddings - anchors.top: systemInjectorGainContainer.bottom; + anchors.top: outputView.bottom; anchors.topMargin: 10; } } From b0eb08c03fadd9715daa517722b0c1dc9d753e02 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 19:54:49 +0200 Subject: [PATCH 04/14] Try to add bottom margin --- interface/resources/qml/hifi/audio/Audio.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 550ebcf037..d8f2d2a74e 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -682,6 +682,7 @@ Rectangle { x: margins.paddings anchors.top: outputView.bottom; anchors.topMargin: 10; + bottomMargin: 5; } } From 8284dd16cf135e38d7f0d5f8f74367bd08765b8d Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 20:19:03 +0200 Subject: [PATCH 05/14] Revert last commit and add spacer item to bottom. --- interface/resources/qml/hifi/audio/Audio.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index d8f2d2a74e..e1599206ff 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -682,7 +682,12 @@ Rectangle { x: margins.paddings anchors.top: outputView.bottom; anchors.topMargin: 10; - bottomMargin: 5; + } + + // Spacer item + Item { + anchors.top: playSampleSound.bottom; + anchors.topMargin: 5; } } From ee6de9e868cffb456c6521f9d1ee445cd32bbfb4 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 21:10:48 +0200 Subject: [PATCH 06/14] Move "Test your voice" and "Test your sound" to top of their category --- interface/resources/qml/hifi/audio/Audio.qml | 48 ++++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index e1599206ff..cfa5ca6d96 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -546,11 +546,22 @@ Rectangle { text: qsTr("Choose input device"); } } + + AudioControls.LoopbackAudio { + id: loopbackAudio + x: margins.paddings + anchors.top: inputDeviceHeader.bottom; + anchors.topMargin: 10; + visible: (bar.currentIndex === 1 && isVR) || + (bar.currentIndex === 0 && !isVR); + anchors { left: parent.left; leftMargin: margins.paddings } + } + ListView { id: inputView; width: rightMostInputLevelPos; - anchors.top: inputDeviceHeader.bottom; + anchors.top: loopbackAudio.bottom; anchors.topMargin: 10; x: margins.paddings interactive: false; @@ -596,17 +607,6 @@ Rectangle { } } - AudioControls.LoopbackAudio { - id: loopbackAudio - x: margins.paddings - anchors.top: inputView.bottom; - anchors.topMargin: 10; - - visible: (bar.currentIndex === 1 && isVR) || - (bar.currentIndex === 0 && !isVR); - anchors { left: parent.left; leftMargin: margins.paddings } - } - Separator { id: thirdSeparator; anchors.top: loopbackAudio.visible ? loopbackAudio.bottom : inputView.bottom; @@ -641,14 +641,21 @@ Rectangle { text: qsTr("Choose output device"); } } - + + AudioControls.PlaySampleSound { + id: playSampleSound + x: margins.paddings + anchors.top: outputDeviceHeader.bottom; + anchors.topMargin: 10; + } + ListView { id: outputView width: parent.width - margins.paddings*2 x: margins.paddings; interactive: false; height: contentHeight; - anchors.top: outputDeviceHeader.bottom; + anchors.top: playSampleSound.bottom; anchors.topMargin: 10; clip: true; model: AudioScriptingInterface.devices.output; @@ -676,19 +683,12 @@ Rectangle { } } } - - AudioControls.PlaySampleSound { - id: playSampleSound - x: margins.paddings - anchors.top: outputView.bottom; - anchors.topMargin: 10; - } // Spacer item Item { - anchors.top: playSampleSound.bottom; - anchors.topMargin: 5; + anchors.top: outputView.bottom; + anchors.topMargin: 10; } } -} +} \ No newline at end of file From d4f79413eb4232c2217fb310fef27948600b4553 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 21:27:41 +0200 Subject: [PATCH 07/14] Fix seperator and move up inputLevel --- interface/resources/qml/hifi/audio/Audio.qml | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index cfa5ca6d96..e30a4bfe93 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -558,6 +558,16 @@ Rectangle { anchors { left: parent.left; leftMargin: margins.paddings } } + AudioControls.InputPeak { + id: inputLevel + anchors.right: parent.right + peak: model.peak; + anchors.verticalCenter: parent.verticalCenter + visible: ((bar.currentIndex === 1 && isVR) || + (bar.currentIndex === 0 && !isVR)) && + AudioScriptingInterface.devices.input.peakValuesAvailable; + } + ListView { id: inputView; width: rightMostInputLevelPos; @@ -594,22 +604,13 @@ Rectangle { AudioScriptingInterface.setInputDevice(info, bar.currentIndex === 1); } } - } - AudioControls.InputPeak { - id: inputLevel - anchors.right: parent.right - peak: model.peak; - anchors.verticalCenter: parent.verticalCenter - visible: ((bar.currentIndex === 1 && isVR) || - (bar.currentIndex === 0 && !isVR)) && - AudioScriptingInterface.devices.input.peakValuesAvailable; - } + } } } Separator { id: thirdSeparator; - anchors.top: loopbackAudio.visible ? loopbackAudio.bottom : inputView.bottom; + anchors.top: inputView.visible ? inputView.bottom : outputDeviceHeader.bottom; anchors.topMargin: 10; } From 4a0d011b5338f6a259332c32d4d61602803d4bbd Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 21:39:53 +0200 Subject: [PATCH 08/14] Shorten PushToTalk text on vr, since it didn't fit into the window --- interface/resources/qml/hifi/audio/Audio.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index e30a4bfe93..6b23b0a1ca 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -325,7 +325,7 @@ Rectangle { size: 16; text: (bar.currentIndex === 0) ? qsTr("Press and hold the button \"T\" to talk.") : - qsTr("Press and hold grip triggers on both of your controllers to talk."); + qsTr("Press and hold triggers on both of your controllers to talk."); } } From 845cc4454c3121b6abc034b4bdd06df98819a3dc Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 21:47:09 +0200 Subject: [PATCH 09/14] Add Vircadia contributors line --- interface/resources/qml/hifi/audio/Audio.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 6b23b0a1ca..44cf288049 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -6,6 +6,7 @@ // // Created by Vlad Stelmahovsky on 03/22/2017 // Copyright 2017 High Fidelity, Inc. +// Copyright 2020 Vircadia contributors. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html From 0c8cc0a8065984f25aef43c3f3086bf8170d495c Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 23:32:52 +0200 Subject: [PATCH 10/14] Try to remove empty space when "Test your voice" button is not visible --- interface/resources/qml/hifi/audio/Audio.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 44cf288049..b3ac3f620e 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -572,7 +572,7 @@ Rectangle { ListView { id: inputView; width: rightMostInputLevelPos; - anchors.top: loopbackAudio.bottom; + anchors.top: (loopbackAudio.visible === 1) ? loopbackAudio.bottom : inputDeviceHeader.bottom; anchors.topMargin: 10; x: margins.paddings interactive: false; From 3aefa6ad9c60a7e03ecbc1201e7db326a263e582 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 23:37:26 +0200 Subject: [PATCH 11/14] Remove if statements that are not needed anymore --- interface/resources/qml/hifi/audio/Audio.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index b3ac3f620e..054d709c4a 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -516,7 +516,7 @@ Rectangle { Separator { id: secondSeparator; - anchors.top: systemInjectorGainContainer.visible ? systemInjectorGainContainer.bottom : switchesContainer.bottom; + anchors.top: systemInjectorGainContainer.bottom; anchors.topMargin: 10; } @@ -611,7 +611,7 @@ Rectangle { Separator { id: thirdSeparator; - anchors.top: inputView.visible ? inputView.bottom : outputDeviceHeader.bottom; + anchors.top: inputView.bottom; anchors.topMargin: 10; } From 878c6c68c829b3f7b128bfc9b8b52c9d2c4380a2 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 19 Jun 2020 23:46:04 +0200 Subject: [PATCH 12/14] Fix inputView if statement --- interface/resources/qml/hifi/audio/Audio.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 054d709c4a..a3bd3c6fff 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -572,7 +572,7 @@ Rectangle { ListView { id: inputView; width: rightMostInputLevelPos; - anchors.top: (loopbackAudio.visible === 1) ? loopbackAudio.bottom : inputDeviceHeader.bottom; + anchors.top: loopbackAudio.visible ? loopbackAudio.bottom : inputDeviceHeader.bottom; anchors.topMargin: 10; x: margins.paddings interactive: false; From bb91c1c89bc9d01ddc246b9cd36ee926a55ae787 Mon Sep 17 00:00:00 2001 From: motofckr9k Date: Fri, 3 Jul 2020 10:22:06 +0200 Subject: [PATCH 13/14] Fix blocks --- interface/resources/qml/hifi/audio/Audio.qml | 77 ++++++++++---------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index a3bd3c6fff..944a0e9d3b 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -326,10 +326,10 @@ Rectangle { size: 16; text: (bar.currentIndex === 0) ? qsTr("Press and hold the button \"T\" to talk.") : - qsTr("Press and hold triggers on both of your controllers to talk."); + qsTr("Press and hold grip triggers on your controllers to talk."); } } - + Item { id: avatarGainContainer x: margins.paddings; @@ -546,29 +546,28 @@ Rectangle { color: hifi.colors.white; text: qsTr("Choose input device"); } - } - - AudioControls.LoopbackAudio { - id: loopbackAudio - x: margins.paddings - anchors.top: inputDeviceHeader.bottom; - anchors.topMargin: 10; + AudioControls.LoopbackAudio { + id: loopbackAudio + x: margins.paddings + anchors.top: inputDeviceHeader.bottom; + anchors.topMargin: 10; - visible: (bar.currentIndex === 1 && isVR) || - (bar.currentIndex === 0 && !isVR); - anchors { left: parent.left; leftMargin: margins.paddings } + visible: (bar.currentIndex === 1 && isVR) || + (bar.currentIndex === 0 && !isVR); + anchors { left: parent.left; leftMargin: margins.paddings } + } + + AudioControls.InputPeak { + id: inputLevel + anchors.right: parent.right + peak: model.peak; + anchors.verticalCenter: parent.verticalCenter + visible: ((bar.currentIndex === 1 && isVR) || + (bar.currentIndex === 0 && !isVR)) && + AudioScriptingInterface.devices.input.peakValuesAvailable; + } } - - AudioControls.InputPeak { - id: inputLevel - anchors.right: parent.right - peak: model.peak; - anchors.verticalCenter: parent.verticalCenter - visible: ((bar.currentIndex === 1 && isVR) || - (bar.currentIndex === 0 && !isVR)) && - AudioScriptingInterface.devices.input.peakValuesAvailable; - } - + ListView { id: inputView; width: rightMostInputLevelPos; @@ -577,14 +576,14 @@ Rectangle { x: margins.paddings interactive: false; height: contentHeight; - + clip: true; model: AudioScriptingInterface.devices.input; delegate: Item { width: rightMostInputLevelPos - margins.paddings*2 - height: ((type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1)) ? + height: ((type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1)) ? (margins.sizeCheckBox > checkBoxInput.implicitHeight ? margins.sizeCheckBox + 4 : checkBoxInput.implicitHeight + 4) : 0 - visible: (type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1) + visible: (type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1) AudioControls.CheckBox { id: checkBoxInput anchors.left: parent.left @@ -605,7 +604,7 @@ Rectangle { AudioScriptingInterface.setInputDevice(info, bar.currentIndex === 1); } } - } + } } } @@ -642,15 +641,15 @@ Rectangle { color: hifi.colors.white; text: qsTr("Choose output device"); } + + AudioControls.PlaySampleSound { + id: playSampleSound + x: margins.paddings + anchors.top: outputDeviceHeader.bottom; + anchors.topMargin: 10; + } } - - AudioControls.PlaySampleSound { - id: playSampleSound - x: margins.paddings - anchors.top: outputDeviceHeader.bottom; - anchors.topMargin: 10; - } - + ListView { id: outputView width: parent.width - margins.paddings*2 @@ -663,9 +662,9 @@ Rectangle { model: AudioScriptingInterface.devices.output; delegate: Item { width: rightMostInputLevelPos - height: ((type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1)) ? + height: ((type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1)) ? (margins.sizeCheckBox > checkBoxOutput.implicitHeight ? margins.sizeCheckBox + 4 : checkBoxOutput.implicitHeight + 4) : 0 - visible: (type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1) + visible: (type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1) AudioControls.CheckBox { id: checkBoxOutput @@ -685,8 +684,8 @@ Rectangle { } } } - - // Spacer item + + // Spacer item Item { anchors.top: outputView.bottom; anchors.topMargin: 10; From 6737068b0202769cc1cb5d4cca73652a53ed20ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gro=C3=9F?= Date: Tue, 7 Jul 2020 00:28:19 +0200 Subject: [PATCH 14/14] Test --- interface/resources/qml/hifi/audio/Audio.qml | 62 +++++++++----------- 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 944a0e9d3b..31f3ee44df 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -326,7 +326,7 @@ Rectangle { size: 16; text: (bar.currentIndex === 0) ? qsTr("Press and hold the button \"T\" to talk.") : - qsTr("Press and hold grip triggers on your controllers to talk."); + qsTr("Press and hold grip triggers on both controllers to talk."); } } @@ -537,6 +537,7 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter; size: 30; } + RalewayRegular { anchors.verticalCenter: parent.verticalCenter; width: margins.sizeText + margins.sizeLevel; @@ -546,26 +547,16 @@ Rectangle { color: hifi.colors.white; text: qsTr("Choose input device"); } - AudioControls.LoopbackAudio { - id: loopbackAudio - x: margins.paddings - anchors.top: inputDeviceHeader.bottom; - anchors.topMargin: 10; + } - visible: (bar.currentIndex === 1 && isVR) || - (bar.currentIndex === 0 && !isVR); - anchors { left: parent.left; leftMargin: margins.paddings } - } - - AudioControls.InputPeak { - id: inputLevel - anchors.right: parent.right - peak: model.peak; - anchors.verticalCenter: parent.verticalCenter - visible: ((bar.currentIndex === 1 && isVR) || - (bar.currentIndex === 0 && !isVR)) && - AudioScriptingInterface.devices.input.peakValuesAvailable; - } + AudioControls.LoopbackAudio { + id: loopbackAudio + x: margins.paddings + anchors.top: inputDeviceHeader.bottom; + anchors.topMargin: 10; + visible: (bar.currentIndex === 1 && isVR) || + (bar.currentIndex === 0 && !isVR); + anchors { left: parent.left; leftMargin: margins.paddings } } ListView { @@ -605,6 +596,15 @@ Rectangle { } } } + AudioControls.InputPeak { + id: inputLevel + anchors.right: parent.right + peak: model.peak; + anchors.verticalCenter: parent.verticalCenter + visible: ((bar.currentIndex === 1 && isVR) || + (bar.currentIndex === 0 && !isVR)) && + AudioScriptingInterface.devices.input.peakValuesAvailable; + } } } @@ -641,13 +641,13 @@ Rectangle { color: hifi.colors.white; text: qsTr("Choose output device"); } + } - AudioControls.PlaySampleSound { - id: playSampleSound - x: margins.paddings - anchors.top: outputDeviceHeader.bottom; - anchors.topMargin: 10; - } + AudioControls.PlaySampleSound { + id: playSampleSound + x: margins.paddings + anchors.top: outputDeviceHeader.bottom; + anchors.topMargin: 10; } ListView { @@ -655,7 +655,7 @@ Rectangle { width: parent.width - margins.paddings*2 x: margins.paddings; interactive: false; - height: contentHeight; + height: contentHeight + 10; anchors.top: playSampleSound.bottom; anchors.topMargin: 10; clip: true; @@ -665,7 +665,6 @@ Rectangle { height: ((type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1)) ? (margins.sizeCheckBox > checkBoxOutput.implicitHeight ? margins.sizeCheckBox + 4 : checkBoxOutput.implicitHeight + 4) : 0 visible: (type != "hmd" && bar.currentIndex === 0) || (type != "desktop" && bar.currentIndex === 1) - AudioControls.CheckBox { id: checkBoxOutput width: parent.width @@ -684,12 +683,5 @@ Rectangle { } } } - - // Spacer item - Item { - anchors.top: outputView.bottom; - anchors.topMargin: 10; - } } - } \ No newline at end of file