diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index b4e42d276f..1f20486e1e 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -106,7 +106,7 @@ Rectangle { } } function updateNoiseReductionThresholdFromQML(sliderValue) { - if (AudioScriptingInterface.getNoiseReductionThreshold() != sliderValue) { + if (AudioScriptingInterface.getNoiseReductionThreshold() !== sliderValue) { AudioScriptingInterface.setNoiseReductionThreshold(sliderValue); } } @@ -496,7 +496,7 @@ Rectangle { Item { id: noiseReductionHeader x: margins.paddings; - width: parent.width - margins.paddings*2; + width: parent.width - margins.paddings * 2; height: 36; anchors.top: secondSeparator.bottom; anchors.topMargin: 10; @@ -506,7 +506,7 @@ Rectangle { 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.leftMargin: -size / 4; // The glyph has empty space at left about 25% anchors.verticalCenter: parent.verticalCenter; size: 30; } @@ -552,7 +552,7 @@ Rectangle { checked: AudioScriptingInterface.acousticEchoCancellation; onCheckedChanged: { AudioScriptingInterface.acousticEchoCancellation = checked; - checked = Qt.binding(function() { return AudioScriptingInterface.acousticEchoCancellation; }); + checked = Qt.binding(function () { return AudioScriptingInterface.acousticEchoCancellation; }); } } @@ -569,7 +569,7 @@ Rectangle { checked: AudioScriptingInterface.noiseReduction; onCheckedChanged: { AudioScriptingInterface.noiseReduction = checked; - checked = Qt.binding(function() { return AudioScriptingInterface.noiseReduction; }); // restore binding + checked = Qt.binding(function () { return AudioScriptingInterface.noiseReduction; }); // restore binding } } @@ -584,10 +584,10 @@ Rectangle { labelTextSize: 16; backgroundOnColor: "#E3E3E3"; checked: !AudioScriptingInterface.noiseReductionAutomatic; - visible: AudioScriptingInterface.noiseReduction === true; + visible: AudioScriptingInterface.noiseReduction; onCheckedChanged: { AudioScriptingInterface.noiseReductionAutomatic = !checked; - checked = Qt.binding(function() { return !AudioScriptingInterface.noiseReductionAutomatic; }); // restore binding + checked = Qt.binding(function () { return !AudioScriptingInterface.noiseReductionAutomatic; }); // restore binding } } } @@ -598,9 +598,9 @@ Rectangle { x: margins.paddings; anchors.top: noiseReductionSwitches.bottom; anchors.topMargin: 16; - width: parent.width - margins.paddings*2; + width: parent.width - margins.paddings * 2; height: avatarGainSliderTextMetrics.height + 10; - visible: AudioScriptingInterface.noiseReduction === true && AudioScriptingInterface.noiseReductionAutomatic !== true; + visible: AudioScriptingInterface.noiseReduction && !AudioScriptingInterface.noiseReductionAutomatic; HifiControlsUit.Slider { id: noiseReductionThresholdSlider @@ -626,16 +626,16 @@ Rectangle { // Do nothing. } onDoubleClicked: { - noiseReductionThresholdSlider.value = 0.0 + noiseReductionThresholdSlider.value = 0.0; } onPressed: { // Pass through to Slider - mouse.accepted = false + mouse.accepted = false; } onReleased: { // the above mouse.accepted seems to make this // never get called, nonetheless... - mouse.accepted = false + mouse.accepted = false; } } } @@ -693,9 +693,9 @@ Rectangle { visible: !status.visible; Component.onCompleted: { - AudioScriptingInterface.noiseGateOpened.connect(function() { noiseBar.gated = false; }); - AudioScriptingInterface.noiseGateClosed.connect(function() { noiseBar.gated = true; }); - AudioScriptingInterface.inputLevelChanged.connect(function() { noiseBar.level = AudioScriptingInterface.inputLevel; }); + AudioScriptingInterface.noiseGateOpened.connect(function () { noiseBar.gated = false; }); + AudioScriptingInterface.noiseGateClosed.connect(function () { noiseBar.gated = true; }); + AudioScriptingInterface.inputLevelChanged.connect(function () { noiseBar.level = AudioScriptingInterface.inputLevel; }); } Rectangle { // base @@ -908,4 +908,4 @@ Rectangle { } } } -} \ No newline at end of file +} diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index ae4e0f9d1a..078e7561a8 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -275,7 +275,7 @@ public: Q_INVOKABLE float getSystemInjectorGain(); /**jsdoc - * Sets the noise gate threshold before your mic audio is transmitted. (Applies only if Audio.noiseReductionAutomatic is off.) + * Sets the noise gate threshold before your mic audio is transmitted. (Applies only if Audio.noiseReductionAutomatic is false.) * @function Audio.setNoiseReductionThreshold * @param {number} threshold - The level that your input must surpass to be transmitted. 0.0 (open the gate completely) – 1.0 */ @@ -419,14 +419,13 @@ signals: /**jsdoc * Triggered when the audio input noise reduction mode is changed. * @function Audio.noiseReductionAutomaticChanged - * @param {boolean} isEnabled - true if audio input noise reduction automatic mode is enabled, otherwise false. - * This means the mode is set to 'manual'. + * @param {boolean} isEnabled - true if audio input noise reduction automatic mode is enabled, false if in manual mode. * @returns {Signal} */ void noiseReductionAutomaticChanged(bool isEnabled); /**jsdoc - * Triggered when audio input noise reduction threshold is changed. + * Triggered when the audio input noise reduction threshold is changed. * @function Audio.noiseReductionThresholdChanged * @param {number} threshold - The threshold for the audio input noise reduction, range 0.0 (open the gate completely) – 1.0 * (close the gate completely).