mirror of
https://github.com/lubosz/overte.git
synced 2025-04-18 04:18:17 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into shadowControlsOffZvork
This commit is contained in:
commit
dbf1be5de3
8 changed files with 34 additions and 14 deletions
|
@ -112,6 +112,7 @@ Rectangle {
|
|||
|
||||
// mute is in its own row
|
||||
RowLayout {
|
||||
spacing: (margins.sizeCheckBox - 10.5) * 3;
|
||||
AudioControls.CheckBox {
|
||||
id: muteMic
|
||||
text: qsTr("Mute microphone");
|
||||
|
@ -123,6 +124,19 @@ Rectangle {
|
|||
checked = Qt.binding(function() { return AudioScriptingInterface.muted; }); // restore binding
|
||||
}
|
||||
}
|
||||
|
||||
AudioControls.CheckBox {
|
||||
id: stereoMic
|
||||
spacing: muteMic.spacing;
|
||||
text: qsTr("use stereo for stereo devices");
|
||||
checked: false;
|
||||
onClicked: {
|
||||
var success = Audio.setIsStereoInput(checked);
|
||||
if (!success) {
|
||||
checked = !checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
@ -204,6 +218,8 @@ Rectangle {
|
|||
text: devicename
|
||||
onPressed: {
|
||||
if (!checked) {
|
||||
stereoMic.checked = false;
|
||||
Audio.setIsStereoInput(false); // the next selected audio device might not support stereo
|
||||
AudioScriptingInterface.setInputDevice(info, bar.currentIndex === 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1397,9 +1397,11 @@ void AudioClient::setNoiseReduction(bool enable) {
|
|||
}
|
||||
|
||||
|
||||
void AudioClient::setIsStereoInput(bool isStereoInput) {
|
||||
if (isStereoInput != _isStereoInput) {
|
||||
bool AudioClient::setIsStereoInput(bool isStereoInput) {
|
||||
bool stereoInputChanged = false;
|
||||
if (isStereoInput != _isStereoInput && _inputDeviceInfo.supportedChannelCounts().contains(2)) {
|
||||
_isStereoInput = isStereoInput;
|
||||
stereoInputChanged = true;
|
||||
|
||||
if (_isStereoInput) {
|
||||
_desiredInputFormat.setChannelCount(2);
|
||||
|
@ -1419,6 +1421,8 @@ void AudioClient::setIsStereoInput(bool isStereoInput) {
|
|||
// restart the input device
|
||||
switchInputToAudioDevice(_inputDeviceInfo);
|
||||
}
|
||||
|
||||
return stereoInputChanged;
|
||||
}
|
||||
|
||||
bool AudioClient::outputLocalInjector(const AudioInjectorPointer& injector) {
|
||||
|
|
|
@ -192,7 +192,7 @@ public slots:
|
|||
void toggleMute();
|
||||
bool isMuted() { return _muted; }
|
||||
|
||||
virtual void setIsStereoInput(bool stereo) override;
|
||||
virtual bool setIsStereoInput(bool stereo) override;
|
||||
|
||||
void setNoiseReduction(bool isNoiseGateEnabled);
|
||||
bool isNoiseReductionEnabled() const { return _isNoiseGateEnabled; }
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
public slots:
|
||||
virtual bool shouldLoopbackInjectors() { return false; }
|
||||
|
||||
virtual void setIsStereoInput(bool stereo) = 0;
|
||||
virtual bool setIsStereoInput(bool stereo) = 0;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(AbstractAudioInterface*)
|
||||
|
|
|
@ -60,8 +60,10 @@ ScriptAudioInjector* AudioScriptingInterface::playSound(SharedSoundPointer sound
|
|||
}
|
||||
}
|
||||
|
||||
void AudioScriptingInterface::setStereoInput(bool stereo) {
|
||||
bool AudioScriptingInterface::setStereoInput(bool stereo) {
|
||||
bool stereoInputChanged = false;
|
||||
if (_localAudioInterface) {
|
||||
_localAudioInterface->setIsStereoInput(stereo);
|
||||
stereoInputChanged = _localAudioInterface->setIsStereoInput(stereo);
|
||||
}
|
||||
return stereoInputChanged;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ protected:
|
|||
// FIXME: there is no way to play a positionless sound
|
||||
Q_INVOKABLE ScriptAudioInjector* playSystemSound(SharedSoundPointer sound, const QVector3D& position);
|
||||
|
||||
Q_INVOKABLE void setStereoInput(bool stereo);
|
||||
Q_INVOKABLE bool setStereoInput(bool stereo);
|
||||
|
||||
signals:
|
||||
void mutedByMixer(); /// the client has been muted by the mixer
|
||||
|
|
|
@ -43,6 +43,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
this.totalVariance = 0;
|
||||
this.highVarianceCount = 0;
|
||||
this.veryhighVarianceCount = 0;
|
||||
this.orderedPluginNames = [];
|
||||
this.tabletID = null;
|
||||
this.blacklist = [];
|
||||
this.pointerManager = new PointerManager();
|
||||
|
|
|
@ -321,22 +321,19 @@ function multiDataUpdater(groupName, updateKeyPair, userDataElement, defaults) {
|
|||
}
|
||||
var keys = Object.keys(updateKeyPair);
|
||||
keys.forEach(function (key) {
|
||||
delete parsedData[groupName][key];
|
||||
if (updateKeyPair[key] !== null && updateKeyPair[key] !== "null") {
|
||||
if (updateKeyPair[key] instanceof Element) {
|
||||
if (updateKeyPair[key].type === "checkbox") {
|
||||
if (updateKeyPair[key].checked !== defaults[key]) {
|
||||
parsedData[groupName][key] = updateKeyPair[key].checked;
|
||||
}
|
||||
parsedData[groupName][key] = updateKeyPair[key].checked;
|
||||
} else {
|
||||
var val = isNaN(updateKeyPair[key].value) ? updateKeyPair[key].value : parseInt(updateKeyPair[key].value);
|
||||
if (val !== defaults[key]) {
|
||||
parsedData[groupName][key] = val;
|
||||
}
|
||||
parsedData[groupName][key] = val;
|
||||
}
|
||||
} else {
|
||||
parsedData[groupName][key] = updateKeyPair[key];
|
||||
}
|
||||
} else if (defaults[key] !== null && defaults[key] !== "null") {
|
||||
parsedData[groupName][key] = defaults[key];
|
||||
}
|
||||
});
|
||||
if (Object.keys(parsedData[groupName]).length === 0) {
|
||||
|
|
Loading…
Reference in a new issue