mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 23:53:26 +02:00
fixing qml bug in MicBar
This commit is contained in:
parent
390ce9bb26
commit
3ea45de7c7
3 changed files with 31 additions and 9 deletions
|
@ -19,30 +19,49 @@ Item {
|
|||
objectName: "AvatarInputsBar"
|
||||
property int modality: Qt.NonModal
|
||||
readonly property bool ignoreRadiusEnabled: AvatarInputs.ignoreRadiusEnabled;
|
||||
width: HMD.active ? audio.width : audioApplication.width;
|
||||
height: HMD.active ? audio.height : audioApplication.height;
|
||||
x: 10;
|
||||
y: 5;
|
||||
readonly property bool shouldReposition: true;
|
||||
property bool hmdActive: HMD.active;
|
||||
width: hmdActive ? audio.width : audioApplication.width;
|
||||
height: hmdActive ? audio.height : audioApplication.height;
|
||||
|
||||
onHmdActiveChanged: {
|
||||
console.log("hmd active = " + hmdActive);
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: hmdActiveCheckTimer;
|
||||
interval: 500;
|
||||
repeat: true;
|
||||
onTriggered: {
|
||||
root.hmdActive = HMD.active;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HifiAudio.MicBar {
|
||||
id: audio;
|
||||
visible: AvatarInputs.showAudioTools && HMD.active;
|
||||
visible: AvatarInputs.showAudioTools && root.hmdActive;
|
||||
standalone: true;
|
||||
dragTarget: parent;
|
||||
}
|
||||
|
||||
HifiAudio.MicBarApplication {
|
||||
id: audioApplication;
|
||||
visible: AvatarInputs.showAudioTools && !HMD.active;
|
||||
onVisibleChanged: {
|
||||
console.log("visible changed: " + visible);
|
||||
}
|
||||
visible: AvatarInputs.showAudioTools && !root.hmdActive;
|
||||
standalone: true;
|
||||
dragTarget: parent;
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
HMD.displayModeChanged.connect(function(isHmdMode) {
|
||||
root.hmdActive = isHmdMode;
|
||||
});
|
||||
}
|
||||
|
||||
BubbleIcon {
|
||||
dragTarget: parent
|
||||
visible: !HMD.active;
|
||||
visible: !root.hmdActive;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,9 +19,9 @@ Rectangle {
|
|||
id: micBar
|
||||
HifiConstants { id: hifi; }
|
||||
|
||||
property var muted: AudioScriptingInterface.muted;
|
||||
readonly property var level: AudioScriptingInterface.inputLevel;
|
||||
readonly property var clipping: AudioScriptingInterface.clipping;
|
||||
readonly property var muted: AudioScriptingInterface.muted;
|
||||
readonly property var pushToTalk: AudioScriptingInterface.pushToTalk;
|
||||
readonly property var pushingToTalk: AudioScriptingInterface.pushingToTalk;
|
||||
|
||||
|
|
|
@ -228,6 +228,9 @@ void Audio::loadData() {
|
|||
setMutedHMD(_hmdMutedSetting.get());
|
||||
setPTTDesktop(_pttDesktopSetting.get());
|
||||
setPTTHMD(_pttHMDSetting.get());
|
||||
|
||||
auto client = DependencyManager::get<AudioClient>().data();
|
||||
QMetaObject::invokeMethod(client, "setMuted", Q_ARG(bool, isMuted()), Q_ARG(bool, false));
|
||||
}
|
||||
|
||||
bool Audio::getPTTHMD() const {
|
||||
|
|
Loading…
Reference in a new issue