From 3d50eb7995585a2916b884486a5301b2e4f9a6c2 Mon Sep 17 00:00:00 2001 From: ykeara Date: Sat, 18 May 2019 11:33:03 -0500 Subject: [PATCH] Fixes Various Audio Bugs (#198) * perf graph overlay/checkbox added * added toggle Chaperone action * toggle chaperone non-functional * fixed chaperone toggle action const to once * Added Proximity Sensor Action back-end, not implemented via logic Until fixed by valve * added default WMR controller profile * formated * formated steamvrtabcontroller.h * fixed un-intended change * fixed audio profile Bug w/ changed devices * fixed name being used as param instead of ID * fixed loop logic in saveAudioProfile * audio profile fix WIP defaults OVR integration * fixed profile Saves, delete logic and mirror logic needed * fixed QML format, added TODO message * Fixed Audio Profile Behavior * fixed qml reference error * audiodeviceselector changed qml * Removed some comments * changed Visibility slider Minimum to 30% (steamVR minimum allowed) * fixed mirror/playback same issue * fixed Audio device refresh bug, removed currently un-used proximity logic (commented out) * removed dead code --- src/res/qml/ChaperonePage.qml | 14 +++++++++----- .../device_selector/AudioDeviceSelector.qml | 1 - .../device_selector/MirrorDeviceSelector.qml | 2 +- src/res/qml/common/MySlider.qml | 2 ++ src/tabcontrollers/AudioTabController.cpp | 5 +++++ src/tabcontrollers/ChaperoneTabController.cpp | 4 ++-- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/res/qml/ChaperonePage.qml b/src/res/qml/ChaperonePage.qml index c5cb0ae..de8f3a2 100644 --- a/src/res/qml/ChaperonePage.qml +++ b/src/res/qml/ChaperonePage.qml @@ -247,13 +247,13 @@ MyStackViewPage { MySlider { id: chaperoneVisibilitySlider - from: 0.5 + from: 0.3 to: 1.0 stepSize: 0.01 value: 0.6 Layout.fillWidth: true onPositionChanged: { - var val = (this.position * 100)/2 + 50 + var val = (this.value * 100) chaperoneVisibilityText.text = Math.round(val) + "%" } onValueChanged: { @@ -272,7 +272,7 @@ MyStackViewPage { MyTextField { id: chaperoneVisibilityText - text: "50.00" + text: "60.00" keyBoardUID: 301 Layout.preferredWidth: 100 Layout.leftMargin: 10 @@ -280,11 +280,15 @@ MyStackViewPage { function onInputEvent(input) { var val = parseFloat(input) if (!isNaN(val)) { - if (val < 50.0) { - val = 50.0 + if (val < 30.0) { + val = 30.0 } else if (val > 100.0) { val = 100.0 } + if(val>100){ + val = 100.0 + } + var v = (val/100).toFixed(2) if (v <= chaperoneVisibilitySlider.to) { chaperoneVisibilitySlider.value = v diff --git a/src/res/qml/audio_page/device_selector/AudioDeviceSelector.qml b/src/res/qml/audio_page/device_selector/AudioDeviceSelector.qml index c99a5d2..314f46a 100644 --- a/src/res/qml/audio_page/device_selector/AudioDeviceSelector.qml +++ b/src/res/qml/audio_page/device_selector/AudioDeviceSelector.qml @@ -23,7 +23,6 @@ RowLayout { if (deviceIndex >= 0) { AudioTabController.setPlaybackDeviceIndex(deviceIndex) } - setShownAudioDevice(index) } } Component.onCompleted: { diff --git a/src/res/qml/audio_page/device_selector/MirrorDeviceSelector.qml b/src/res/qml/audio_page/device_selector/MirrorDeviceSelector.qml index 96fb36e..fb4d715 100644 --- a/src/res/qml/audio_page/device_selector/MirrorDeviceSelector.qml +++ b/src/res/qml/audio_page/device_selector/MirrorDeviceSelector.qml @@ -46,7 +46,7 @@ RowLayout { } onPlaybackDeviceListChanged: { audioMirrorNameCombo.devices = getAudioDeviceList() - setShownAudioDevice(AudioTabController.playbackDeviceIndex) + setShownAudioDevice(AudioTabController.mirrorDeviceIndex) } } function getAudioDeviceList() { diff --git a/src/res/qml/common/MySlider.qml b/src/res/qml/common/MySlider.qml index 344cc39..84ce328 100644 --- a/src/res/qml/common/MySlider.qml +++ b/src/res/qml/common/MySlider.qml @@ -8,6 +8,8 @@ Slider { snapMode: Slider.SnapAlways wheelEnabled: true hoverEnabled: true + to: 1.0 + from: 0.0 background: Rectangle { x: parent.leftPadding diff --git a/src/tabcontrollers/AudioTabController.cpp b/src/tabcontrollers/AudioTabController.cpp index 1a6276f..f01f238 100644 --- a/src/tabcontrollers/AudioTabController.cpp +++ b/src/tabcontrollers/AudioTabController.cpp @@ -51,6 +51,7 @@ void AudioTabController::initStage1() reloadPttProfiles(); reloadPttConfig(); reloadAudioProfiles(); + // TODO Verify new defaults working as intended befoere removing // applyDefaultProfile(); reloadAudioSettings(); @@ -171,6 +172,9 @@ void AudioTabController::eventLoopTick() if ( settingsUpdateCounter >= k_audioSettingsUpdateCounter ) { + // Not usable until OpenVR 1.4.x? + // Will require updates to action based system + /* if ( m_micProximitySensorCanMute ) { vr::VRControllerState_t controllerState; @@ -204,6 +208,7 @@ void AudioTabController::eventLoopTick() } } } + */ vr::EVRSettingsError vrSettingsError; char mirrorDeviceId[1024]; vr::VRSettings()->GetString( diff --git a/src/tabcontrollers/ChaperoneTabController.cpp b/src/tabcontrollers/ChaperoneTabController.cpp index 74369a2..22532a2 100644 --- a/src/tabcontrollers/ChaperoneTabController.cpp +++ b/src/tabcontrollers/ChaperoneTabController.cpp @@ -759,9 +759,9 @@ void ChaperoneTabController::setBoundsVisibility( float value, bool notify ) { if ( m_visibility != value ) { - if ( value <= 0.5f ) + if ( value <= 0.3f ) { - m_visibility = 0.5f; + m_visibility = 0.3f; } else {