mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 09:29:53 +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"
|
objectName: "AvatarInputsBar"
|
||||||
property int modality: Qt.NonModal
|
property int modality: Qt.NonModal
|
||||||
readonly property bool ignoreRadiusEnabled: AvatarInputs.ignoreRadiusEnabled;
|
readonly property bool ignoreRadiusEnabled: AvatarInputs.ignoreRadiusEnabled;
|
||||||
width: HMD.active ? audio.width : audioApplication.width;
|
|
||||||
height: HMD.active ? audio.height : audioApplication.height;
|
|
||||||
x: 10;
|
x: 10;
|
||||||
y: 5;
|
y: 5;
|
||||||
readonly property bool shouldReposition: true;
|
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 {
|
HifiAudio.MicBar {
|
||||||
id: audio;
|
id: audio;
|
||||||
visible: AvatarInputs.showAudioTools && HMD.active;
|
visible: AvatarInputs.showAudioTools && root.hmdActive;
|
||||||
standalone: true;
|
standalone: true;
|
||||||
dragTarget: parent;
|
dragTarget: parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiAudio.MicBarApplication {
|
HifiAudio.MicBarApplication {
|
||||||
id: audioApplication;
|
id: audioApplication;
|
||||||
visible: AvatarInputs.showAudioTools && !HMD.active;
|
visible: AvatarInputs.showAudioTools && !root.hmdActive;
|
||||||
onVisibleChanged: {
|
|
||||||
console.log("visible changed: " + visible);
|
|
||||||
}
|
|
||||||
standalone: true;
|
standalone: true;
|
||||||
dragTarget: parent;
|
dragTarget: parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
HMD.displayModeChanged.connect(function(isHmdMode) {
|
||||||
|
root.hmdActive = isHmdMode;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
BubbleIcon {
|
BubbleIcon {
|
||||||
dragTarget: parent
|
dragTarget: parent
|
||||||
visible: !HMD.active;
|
visible: !root.hmdActive;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,9 +19,9 @@ Rectangle {
|
||||||
id: micBar
|
id: micBar
|
||||||
HifiConstants { id: hifi; }
|
HifiConstants { id: hifi; }
|
||||||
|
|
||||||
|
property var muted: AudioScriptingInterface.muted;
|
||||||
readonly property var level: AudioScriptingInterface.inputLevel;
|
readonly property var level: AudioScriptingInterface.inputLevel;
|
||||||
readonly property var clipping: AudioScriptingInterface.clipping;
|
readonly property var clipping: AudioScriptingInterface.clipping;
|
||||||
readonly property var muted: AudioScriptingInterface.muted;
|
|
||||||
readonly property var pushToTalk: AudioScriptingInterface.pushToTalk;
|
readonly property var pushToTalk: AudioScriptingInterface.pushToTalk;
|
||||||
readonly property var pushingToTalk: AudioScriptingInterface.pushingToTalk;
|
readonly property var pushingToTalk: AudioScriptingInterface.pushingToTalk;
|
||||||
|
|
||||||
|
|
|
@ -228,6 +228,9 @@ void Audio::loadData() {
|
||||||
setMutedHMD(_hmdMutedSetting.get());
|
setMutedHMD(_hmdMutedSetting.get());
|
||||||
setPTTDesktop(_pttDesktopSetting.get());
|
setPTTDesktop(_pttDesktopSetting.get());
|
||||||
setPTTHMD(_pttHMDSetting.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 {
|
bool Audio::getPTTHMD() const {
|
||||||
|
|
Loading…
Reference in a new issue