* update qt6 upgrade progress

* add flawed addition for QRenderTarget and link needed libs

* update to better logging format

* move many assets and qml files into qrc

* get rid of deprecation messages

* remove additional deprecation notices

* make Qt6 finally render on desktop with some progress on vr

* initialize QRhi with QQuickRenderControl

* use default values to stop SegFaults

* fix compilation on windows

* add windows files for aiding in running exe

* fix formatting of testing qt.conf

* first attempt on using textures instead of files in AudioTabController

* Fix public/private access issue

---------

Co-authored-by: RTUnreal <unreal@rtinf.net>
This commit is contained in:
ykeara
2024-04-03 22:49:24 -05:00
committed by GitHub
co-authored by RTUnreal
parent 72e91e9116
commit ca0ec3e07d
109 changed files with 1558 additions and 9421 deletions
+404
View File
@@ -0,0 +1,404 @@
cmake_minimum_required(VERSION 3.20)
project(AdvancedSettings VERSION 5.7.4 LANGUAGES CXX)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Gui Multimedia Qml Quick WebSockets Widgets QuickControls2 QuickDialogs2 Svg)
find_package(Qt${QT_VERSION_MAJOR} OPTIONAL_COMPONENTS DBus)
qt_standard_project_setup()
if(QT_KNOWN_POLICY_QTP0001)
qt_policy(SET QTP0001 NEW)
endif()
# ability to just put .qrc files into the source list
set(CMAKE_AUTORCC ON)
set(SRCS
src/alarm_clock/vr_alarm.cpp
src/keyboard_input/input_parser.cpp
src/keyboard_input/keyboard_input.cpp
src/main.cpp
src/openvr/ivrinput.cpp
src/openvr/lh_console_util.cpp
src/openvr/openvr_init.cpp
src/openvr/ovr_application_wrapper.cpp
src/openvr/ovr_overlay_wrapper.cpp
src/openvr/ovr_settings_wrapper.cpp
src/openvr/ovr_system_wrapper.cpp
src/overlaycontroller.cpp
src/settings/settings.cpp
src/settings/settings_object.cpp
src/tabcontrollers/AudioTabController.cpp
src/tabcontrollers/ChaperoneTabController.cpp
src/tabcontrollers/FixFloorTabController.cpp
src/tabcontrollers/MoveCenterTabController.cpp
src/tabcontrollers/RotationTabController.cpp
src/tabcontrollers/SettingsTabController.cpp
src/tabcontrollers/StatisticsTabController.cpp
src/tabcontrollers/SteamVRTabController.cpp
src/tabcontrollers/UtilitiesTabController.cpp
src/tabcontrollers/VideoTabController.cpp
src/utils/ChaperoneUtils.cpp
src/utils/FrameRateUtils.cpp
src/utils/paths.cpp
src/utils/setup.cpp
src/utils/update_rate.cpp
)
set(QML_FILES
src/res/qml/utilities_page/keyboard_utils/KeyboardGroupBox.qml
src/res/qml/utilities_page/media_keys/MediaControllerKeys.qml
src/res/qml/utilities_page/media_keys/MediaButton.qml
src/res/qml/utilities_page/misc/MiscBox.qml
src/res/qml/utilities_page/alarm_clock/AlarmGroupBox.qml
src/res/qml/utilities_page/UtilitiesPage.qml
src/res/qml/motion_page/space_drag/SpaceDragGroupBox.qml
src/res/qml/motion_page/height_toggle/HeightToggleGroupBox.qml
src/res/qml/motion_page/gravity/GravityGroupBox.qml
src/res/qml/motion_page/MotionPage.qml
src/res/qml/PlayspacePage.qml
src/res/qml/SettingsPage.qml
src/res/qml/ChaperoneWarningsPage.qml
src/res/qml/chaperone_page/ChaperonePage.qml
src/res/qml/chaperone_page/change_orientation/ChangeOrientationGroupBox.qml
src/res/qml/chaperone_page/chaperone_additional/ChaperoneAdditionalPage.qml
src/res/qml/chaperone_page/chaperone_additional/chaperonemisc/ChaperoneMiscGroupBox.qml
src/res/qml/chaperone_page/chaperone_additional/chaperonetype/ChaperoneTypeGroupBox.qml
src/res/qml/chaperone_page/chaperone_additional/chaperoneboundscolor/ChaperoneBoundsColorGroupBox.qml
src/res/qml/RootPage.qml
src/res/qml/steamvr_page/steamvrmisc/SteamVRMiscGroupBox.qml
src/res/qml/steamvr_page/SteamVRPage.qml
src/res/qml/steamvr_page/camera/CameraGroupBox.qml
src/res/qml/steamvr_page/steamvr_additional/SteamVRTXRXPage.qml
src/res/qml/steamvr_page/steamvrbind/SteamVRBindGroupBox.qml
src/res/qml/audio_page/device_selector/MicDeviceSelector.qml
src/res/qml/audio_page/device_selector/AudioDeviceSelector.qml
src/res/qml/audio_page/device_selector/MirrorDeviceSelector.qml
src/res/qml/audio_page/device_selector/MirrorVolumeSlider.qml
src/res/qml/audio_page/device_selector/MicVolumeSlider.qml
src/res/qml/audio_page/dialog_boxes/AudioDeleteProfileDialog.qml
src/res/qml/audio_page/dialog_boxes/AudioNewProfileDialog.qml
src/res/qml/audio_page/dialog_boxes/AudioMessageDialog.qml
src/res/qml/audio_page/proximity/ProximityToggle.qml
src/res/qml/audio_page/profiles/ProfileButtons.qml
src/res/qml/audio_page/AudioPage.qml
src/res/qml/audio_page/push_to_talk/PttButtons.qml
src/res/qml/FixFloorPage.qml
src/res/qml/common/MySlider.qml
src/res/qml/common/MyResources.qml
src/res/qml/common/MyPushButton.qml
src/res/qml/common/HourComboBox.qml
src/res/qml/common/MyText.qml
src/res/qml/common/MyToggleButton.qml
src/res/qml/common/MinuteSecondComboBox.qml
src/res/qml/common/MyComboBox.qml
src/res/qml/common/MyTextField.qml
src/res/qml/common/TimeAssembly.qml
src/res/qml/common/MyDialogOkPopup.qml
src/res/qml/common/mainwidget.qml
src/res/qml/common/LineSeparator.qml
src/res/qml/common/MyPushButton2.qml
src/res/qml/common/MyStackViewPage.qml
src/res/qml/common/MyRadioButton.qml
src/res/qml/common/FullWidthSliderBox.qml
src/res/qml/common/MyDialogOkCancelPopup.qml
src/res/qml/rotation_page/view_ratchet/ViewRatchetGroupBox.qml
src/res/qml/rotation_page/redirected/RedirectedGroupBox.qml
src/res/qml/rotation_page/redirected/AutoTurnGroupBox.qml
src/res/qml/rotation_page/snap_turn/SnapTurnGroupBox.qml
src/res/qml/rotation_page/space_turn/SpaceTurnGroupBox.qml
src/res/qml/rotation_page/RotationPage.qml
src/res/qml/video_page/brightness/BrightnessGroupBox.qml
src/res/qml/video_page/profiles/VideoProfileGroupBox.qml
src/res/qml/video_page/overlaycolorbright/OverlayMethodGroupBox.qml
src/res/qml/video_page/miscvid/VideoMiscGroupBox.qml
src/res/qml/video_page/supersampling/SuperSamplingGroupBox.qml
src/res/qml/video_page/color/ColorGroupBox.qml
src/res/qml/video_page/VideoPage.qml
src/res/qml/video_page/dialogboxes/VideoNewProfileDialog.qml
src/res/qml/video_page/dialogboxes/VideoMessageDialog.qml
src/res/qml/video_page/dialogboxes/VideoDeleteProfileDialog.qml
src/res/qml/StatisticsPage.qml
)
set(RESOURCES src/res/resources.qrc)
# make alias path relative to src/res/qml
foreach(qml_file ${QML_FILES})
cmake_path(RELATIVE_PATH qml_file BASE_DIRECTORY src/res/qml OUTPUT_VARIABLE qml_alias)
set_source_files_properties(${qml_file} PROPERTIES QT_RESOURCE_ALIAS ${qml_alias})
endforeach()
set_source_files_properties(src/res/qml/common/MyResources.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE)
qt_add_executable(AdvancedSettings WIN32 MACOSX_BUNDLE ${SRCS} ${RESOURCES})
target_include_directories(AdvancedSettings PUBLIC
src
third-party/nlohmann
third-party/openvr/headers)
# Avoid collision between executable name and QML module directory (QTBUG-98568).
if(NOT WIN32 AND NOT APPLE)
set_property(TARGET AdvancedSettings PROPERTY OUTPUT_NAME AdvancedSettings_app)
endif()
target_compile_definitions(AdvancedSettings PRIVATE
APPLICATION_VERSION=\"${PROJECT_VERSION}\"
)
find_library(OPENVR_LIBRARIES
NAMES
openvr_api
PATHS
${CMAKE_CURRENT_SOURCE_DIR}/third-party/openvr/bin
${CMAKE_CURRENT_SOURCE_DIR}/third-party/openvr/lib
PATH_SUFFIXES
linux64
win64
NO_DEFAULT_PATH
NO_CMAKE_FIND_ROOT_PATH)
target_link_libraries(AdvancedSettings PRIVATE
Qt::Core
Qt::Gui
# For QRhi
Qt::GuiPrivate
Qt::Multimedia
Qt::Qml
Qt::Quick
Qt::WebSockets
Qt::Widgets
Qt::QuickControls2
Qt::QuickDialogs2
Qt::Svg
${OPENVR_LIBRARIES}
)
qt_add_qml_module(AdvancedSettings
URI AdvancedSettings
VERSION ${PROJECT_VERSION}
QML_FILES ${QML_FILES}
)
if(GCC)
target_compile_options(AdvancedSettings
-Wcast-align
-Wconversion
-Wdouble-promotion
-Wduplicated-branches
-Wduplicated-cond
-Wextra
-Wformat=2
-Wlogical-op
-Wno-sign-conversion
-Wnon-virtual-dtor
-Wnull-dereference
-Wold-style-cast
-Woverloaded-virtual
-Wpedantic
-Wrestrict
-Wshadow
-Wunused
-Wzero-as-null-pointer-constant
-flto
)
if(warnings_as_errors)
target_compile_options(AdvancedSettings
-Werror
)
endif()
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(AdvancedSettings
--system-header-prefix=qt
--system-header-prefix=third-party
-Wcast-align
-Wconversion
-Wdouble-promotion
-Wextra
-Wextra-semi
-Wformat=2
-Wmissing-variable-declarations
-Wmost
-Wno-sign-conversion
-Wnon-virtual-dtor
-Wold-style-cast
-Woverloaded-virtual
-Wpedantic
-Wshadow
-Wunused
-Wzero-as-null-pointer-constant
-flto
)
if(warnings_as_errors)
target_compile_options(AdvancedSettings
-Werror
)
endif()
endif()
if(debugSymbolsAndLogs)
target_compile_definitions(AdvancedSettings PRIVATE
ENABLE_DEBUG_LOGGING
)
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
cmake_path(GET QT_DIR PARENT_PATH QT_ROOT)
cmake_path(GET QT_ROOT PARENT_PATH QT_ROOT)
cmake_path(GET QT_ROOT PARENT_PATH QT_ROOT)
cmake_path(NATIVE_PATH QT_ROOT NORMALIZE NATIVE_QT_ROOT)
cmake_path(NATIVE_PATH QT_DIR NORMALIZE NATIVE_QT_DIR)
cmake_path(NATIVE_PATH PROJECT_SOURCE_DIR NORMALIZE NATIVE_PROJECT_SOURCE_DIR)
# Needs to be executed: Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
configure_file(build_scripts/win/env.ps1.in env.ps1)
configure_file(build_scripts/win/env.sh.in env.sh @ONLY)
# Adds default qt plugins path
configure_file(build_scripts/win/qt.conf.in qt.conf ESCAPE_QUOTES)
target_sources(AdvancedSettings PUBLIC
src/keyboard_input/input_sender_win.cpp
src/media_keys/media_keys_win.cpp
src/tabcontrollers/audiomanager/AudioManagerWindows.cpp
)
target_link_libraries(AdvancedSettings PRIVATE
ole32
user32
)
target_include_directories(AdvancedSettings PUBLIC third-party/policyconfig)
target_compile_definitions(AdvancedSettings PRIVATE
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
)
if(MSVC)
target_compile_options(AdvancedSettings PUBLIC
/Gw
/W4
/permissive-
/w14254
/w14263
/w14265
/w14287
/w14296
/w14311
/w14545
/w14546
/w14547
/w14549
/w14555
/w14640
/w14826
/w14905
/w14906
/w14928
/wd4127
/we4289
)
if(warnings_as_errors)
target_compile_options(AdvancedSettings
/WX
)
endif()
elseif(win32-clang-msvc)
target_compile_options(AdvancedSettings
-Wcast-align
-Wdouble-promotion
-Wextra
-Wformat=2
-Wmissing-variable-declarations
-Wmost
-Wnon-virtual-dtor
-Wold-style-cast
-Woverloaded-virtual
-Wshadow
-Wunused
-flto
/Gw
/W4
/imsvc /imsvc /imsvc
/w14254
/w14263
/w14265
/w14287
/w14296
/w14311
/w14545
/w14546
/w14547
/w14549
/w14555
/w14640
/w14826
/w14905
/w14906
/w14928
/wd4127
/we4289
)
endif()
elseif(UNIX AND NOT MACOS)
if(noX11)
target_sources(AdvancedSettings PUBLIC
src/keyboard_input/input_sender_dummy.cpp
)
else()
target_sources(AdvancedSettings PUBLIC
src/keyboard_input/input_sender_X11.cpp
)
target_link_libraries(AdvancedSettings PRIVATE
Xtst
X11
)
endif()
if(noDBUS)
target_sources(AdvancedSettings PUBLIC
src/media_keys/media_keys_dummy.cpp
)
else()
target_sources(AdvancedSettings PUBLIC
src/media_keys/media_keys_dbus.cpp
)
target_link_libraries(AdvancedSettings PRIVATE
Qt::DBus
)
endif()
if(noPulse)
target_sources(AdvancedSettings PUBLIC
src/tabcontrollers/audiomanager/AudioManagerDummy.cpp
)
else()
target_sources(AdvancedSettings PUBLIC
src/tabcontrollers/audiomanager/AudioManagerPulse.cpp
)
target_link_libraries(AdvancedSettings PRIVATE
pulse
)
endif()
elseif(MACOS)
target_sources(AdvancedSettings PUBLIC
src/keyboard_input/input_sender_dummy.cpp
src/media_keys/media_keys_dummy.cpp
src/tabcontrollers/audiomanager/AudioManagerDummy.cpp
)
endif()
-129
View File
@@ -1,129 +0,0 @@
QT += core gui qml quick multimedia widgets websockets
CONFIG += c++1z file_copies optimize_full
DEFINES += ELPP_THREAD_SAFE ELPP_QT_LOGGING ELPP_NO_DEFAULT_LOG_FILE
VERSION = "$$cat($$PWD/build_scripts/compile_version_string.txt)"
DEFINES += APPLICATION_VERSION=\\\"$$VERSION\\\"
# Qmake can't handle non-integers in the version string,
# so we take out anything after the dash.
SPLIT_VERSION_STRING = $$split(VERSION, -)
NUMERICAL_VERSION_NUMBER = $$member(SPLIT_VERSION_STRING, 0, 0)
VERSION = $$NUMERICAL_VERSION_NUMBER
# Keep the literal version number in the description field for debugging.
QMAKE_TARGET_DESCRIPTION = "$$cat($$PWD/build_scripts/compile_version_string.txt)"
lessThan(QT_MAJOR_VERSION, 5): error("requires Qt 5.12 or higher")
lessThan(QT_MINOR_VERSION, 12): error("requires Qt 5.12 or higher")
TARGET = AdvancedSettings
TEMPLATE = app
win32:DESTDIR = bin/win64/AdvancedSettings
unix:DESTDIR = bin/linux/AdvancedSettings
include_dir = $$PWD/build_scripts/qt/
win32-msvc {
include($$include_dir/compilers/msvc.pri)
}
win32-clang-msvc{
include($$include_dir/compilers/clang-msvc.pri)
}
*g++* {
include($$include_dir/compilers/gcc.pri)
}
#Look for anything clang that is not clang-msvc, since it does not
#allow all the same switches as regular clang.
*clang|*clang-g++|*clang-libc++ {
include($$include_dir/compilers/clang.pri)
}
include($$include_dir/sources.pri)
include($$include_dir/resources.pri)
# Copy extra files
COPIES += resCopy readmeCopy licenseCopy packageFoldersCopy openvrApiCopy packageFilesCopy
COPY_DEST_DIR = $$OUT_PWD/$$DESTDIR
resCopy.files = $$files(src/res)
resCopy.path = $$COPY_DEST_DIR
readmeCopy.files = Readme.md
readmeCopy.path = $$COPY_DEST_DIR
licenseCopy.files = LICENSE \
third-party/openvr/LICENSE-VALVE \
third-party/easylogging++/LICENSE-MIT
licenseCopy.path = $$COPY_DEST_DIR
packageFoldersCopy.files = src/package_files/default_action_manifests
packageFoldersCopy.path = $$COPY_DEST_DIR
packageFilesCopy.files = src/package_files/action_manifest.json src/package_files/manifest.vrmanifest
win32:packageFilesCopy.files += src/package_files/qt.conf src/package_files/restartvrserver.bat src/package_files/startdesktopmode.bat
packageFilesCopy.path = $$COPY_DEST_DIR
win32:openvrApiCopy.files = third-party/openvr/bin/win64/openvr_api.dll
unix:openvrApiCopy.files = third-party/openvr/lib/linux64/libopenvr_api.so
openvrApiCopy.path = $$COPY_DEST_DIR
# Deploy openssl when on win32
win32 {
COPIES += opensslCopy
opensslCopy.files = third-party/openssl/libcrypto-1_1-x64.dll
opensslCopy.files += third-party/openssl/libssl-1_1-x64.dll
opensslCopy.files += third-party/openssl/LICENSE-OPENSSL
opensslCopy.path = $$COPY_DEST_DIR
}
# Deploy resources and DLLs to exe dir on Windows
win32 {
WINDEPLOYQT_LOCATION = $$dirname(QMAKE_QMAKE)/windeployqt.exe
CONFIG( debug, debug|release ) {
WINDEPLOYQT_BUILD_TARGET += "--debug"
} else {
WINDEPLOYQT_BUILD_TARGET += "--release"
}
WINDEPLOYQT_OPTIONS = --dir $$COPY_DEST_DIR/qtdata \
--libdir $$COPY_DEST_DIR \
--plugindir $$COPY_DEST_DIR/qtdata/plugins \
--no-system-d3d-compiler \
--no-opengl-sw \
$$WINDEPLOYQT_BUILD_TARGET \
--qmldir $$PWD/src/res/qml \
$$COPY_DEST_DIR/AdvancedSettings.exe
WINDEPLOYQT_FULL_LINE = "$$WINDEPLOYQT_LOCATION $$WINDEPLOYQT_OPTIONS"
# Force windeployqt to run in cmd, because powershell has different syntax
# for running executables.
QMAKE_POST_LINK = cmd /c $$WINDEPLOYQT_FULL_LINE
}
# Add make install support
unix {
isEmpty(PREFIX){
PREFIX = /opt/OpenVR-AdvancedSettings
}
message(PREFIX value is: \'$$PREFIX\'. `make install` will install to this location.)
application.path = $$PREFIX
application.files = $$COPY_DEST_DIR
INSTALLS += application
}
debugSymbolsAndLogs {
message(Debug symbols and logging enabled.)
CONFIG += force_debug_info
DEFINES += ENABLE_DEBUG_LOGGING
}
warnings_as_errors {
message(Warnings as errors enabled.)
}
@@ -1,16 +0,0 @@
QMAKE_CXXFLAGS += -Wextra
QMAKE_CXXFLAGS += -Wshadow
QMAKE_CXXFLAGS += -Wold-style-cast
QMAKE_CXXFLAGS += -Wnon-virtual-dtor
QMAKE_CXXFLAGS += -Wcast-align -Wunused -Woverloaded-virtual -Wformat=2
QMAKE_CXXFLAGS += -Wdouble-promotion
# Enable Link Time Optimization
QMAKE_CXXFLAGS += -flto
# Clang LTO requires the gold linker instead of ld
QMAKE_LFLAGS += -flto -fuse-ld=gold
-18
View File
@@ -1,18 +0,0 @@
include(common-msvc.pri)
#win32-clang-msvc is unable to correctly build the first time
#with warnings as errors on. There seems to be an issue with the moc_predefs.h
#file not being built correctly when /WX is on. Until the issue is fixed,
#win32-clang-msvc is built without /WX.
#clang-msvc does not enable the c++17 flag with qmake's c++1z flag.
QMAKE_CXXFLAGS += /std:c++17
include(clang-gcc-common-switches.pri)
QMAKE_CXXFLAGS += -Wmost
QMAKE_CXXFLAGS += -Weffc++ -Wmissing-variable-declarations
#clang-msvc spams warnings on -Wconversion and -Wsign-conversion
# from the moc .cpp files including Qt stuff.
-62
View File
@@ -1,62 +0,0 @@
# comments are the value of CLANG_VERSION
CLANG_VERSION = $$system("clang++ --version | grep 'clang version'")
# clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
CLANG_VERSION = $$split(CLANG_VERSION, ' ')
# CLANG_VERSION is now a list, this is shown as spaces in QMAKE
# clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
CLANG_VERSION = $$member(CLANG_VERSION, 2)
# 6.0.0-1ubuntu2
CLANG_VERSION = $$split(CLANG_VERSION, '.')
# 6 0 0-1ubuntu2
CLANG_VERSION = $$member(CLANG_VERSION, 0)
# 6
greaterThan(CLANG_VERSION, 4) {
message('clang++' version is above 4. Using regular clang++.)
QMAKE_CXX = clang++
QMAKE_LINK = clang++
}
else {
message('clang++' version is not above 4. Attempting to use highest specific version.)
system("clang++-5 --version") {
QMAKE_CXX = clang++-5
QMAKE_LINK = clang++-5
message('clang++-5' found.)
}
system("clang++-6 --version") {
QMAKE_CXX = clang++-6
QMAKE_LINK = clang++-6
message('clang++-6' found.)
}
system("clang++-7 --version") {
QMAKE_CXX = clang++-7
QMAKE_LINK = clang++-7
message('clang++-7' found.)
}
system("clang++-8 --version") {
QMAKE_CXX = clang++-8
QMAKE_LINK = clang++-8
message('clang++-8' found.)
}
}
system("$$QMAKE_CXX --version")
include(clang-gcc-common-switches.pri)
QMAKE_CXXFLAGS += -Wmost
QMAKE_CXXFLAGS += -Wpedantic
warnings_as_errors {
QMAKE_CXXFLAGS += -Werror
}
#All includes from the third-party directory will not warn.
QMAKE_CXXFLAGS += --system-header-prefix=third-party
QMAKE_CXXFLAGS += --system-header-prefix=qt
# Sign conversion warns on auto generated Qt MOC files.
QMAKE_CXXFLAGS += -Weffc++ -Wconversion -Wno-sign-conversion
QMAKE_CXXFLAGS += -Wextra-semi -Wzero-as-null-pointer-constant -Wmissing-variable-declarations
@@ -1,49 +0,0 @@
#Removing -W3 from both FLAGS is necessary, otherwise compiler will give
#D9025: overriding '/W4' with '/W3'
QMAKE_CFLAGS_WARN_ON -= -W3
QMAKE_CXXFLAGS_WARN_ON -= -W3
#C4127 is a warning in qvarlengtharray.h that can not be turned off
#on the current version of MSVC.
QMAKE_CXXFLAGS += /W4 /wd4127
# The codecvt header being used in AudioManagerWindows.cpp is deprecated by the standard,
# but no suitable replacement has been standardized yet. It is possible to use the Windows
# specific MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h>
DEFINES += _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
# Enables Whole Program Optimization
QMAKE_CXXFLAGS += /Gw
# 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
QMAKE_CXXFLAGS += /w14254
# 'function': member function does not override any base class virtual member function
QMAKE_CXXFLAGS += /w14263
# 'classname': class has virtual functions, but destructor is not virtual instances of this class may not be destructed correctly
QMAKE_CXXFLAGS += /w14265
# 'operator': unsigned/negative constant mismatch
QMAKE_CXXFLAGS += /w14287
# nonstandard extension used: 'variable': loop control variable declared in the for-loop is used outside the for-loop scope
QMAKE_CXXFLAGS += /we4289
# 'operator': expression is always 'boolean_value'
QMAKE_CXXFLAGS += /w14296
# 'variable': pointer truncation from 'type1' to 'type2'
QMAKE_CXXFLAGS += /w14311
# expression before comma evaluates to a function which is missing an argument list
QMAKE_CXXFLAGS += /w14545
# function call before comma missing argument list
QMAKE_CXXFLAGS += /w14546
# 'operator': operator before comma has no effect; expected operator with side-effect
QMAKE_CXXFLAGS += /w14547
# 'operator': operator before comma has no effect; did you intend 'operator'?
QMAKE_CXXFLAGS += /w14549
# expression has no effect; expected expression with side-effect
QMAKE_CXXFLAGS += /w14555
# Enable warning on thread un-safe static member initialization
QMAKE_CXXFLAGS += /w14640
# Conversion from 'type1' to 'type_2' is sign-extended. This may cause unexpected runtime behavior.
QMAKE_CXXFLAGS += /w14826
# wide string literal cast to 'LPSTR'
QMAKE_CXXFLAGS += /w14905
# string literal cast to 'LPWSTR'
QMAKE_CXXFLAGS += /w14906
# illegal copy-initialization; more than one user-defined conversion has been implicitly applied
QMAKE_CXXFLAGS += /w14928
-44
View File
@@ -1,44 +0,0 @@
GCC_VERSION = $$system("g++ -dumpversion")
greaterThan(GCC_VERSION, 6) {
message('g++' version is above 6. Using regular g++.)
}
else {
message('g++' version is not above 6. Attempting to use highest specific version.)
system(g++-7 --version) {
message('g++-7' found.)
QMAKE_CXX = g++-7
QMAKE_LINK = g++-7
}
system(g++-8 --version) {
message('g++-8' found.)
QMAKE_CXX = g++-8
QMAKE_LINK = g++-8
}
system(g++-9 --version) {
message('g++-9' found.)
QMAKE_CXX = g++-9
QMAKE_LINK = g++-9
}
}
system("$$QMAKE_CXX --version")
include(clang-gcc-common-switches.pri)
QMAKE_CXXFLAGS += -Wpedantic
warnings_as_errors {
QMAKE_CXXFLAGS += -Werror
}
# GCC only switches
QMAKE_CXXFLAGS += -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wrestrict -Wnull-dereference
# Sign conversion warns on auto generated Qt MOC files.
QMAKE_CXXFLAGS += -Wconversion -Wno-sign-conversion
QMAKE_CXXFLAGS += -Wzero-as-null-pointer-constant
# Qmake will append this even though higher optimization levels are used.
QMAKE_LFLAGS_RELEASE -= -Wl,-O1
QMAKE_LFLAGS += -Wl,-O3 -O3
-12
View File
@@ -1,12 +0,0 @@
include(common-msvc.pri)
warnings_as_errors {
# Warnings as errors
QMAKE_CXXFLAGS += /WX
}
# Enables Link Time Optimization
QMAKE_CXXFLAGS += /GL
# Force standards-conformance
QMAKE_CXXFLAGS += /permissive-
-69
View File
@@ -1,69 +0,0 @@
project_dir = $$PWD/../../
win32:LIBS += -L"$$project_dir/third-party/openvr/lib/win64" -luser32 -lole32
unix:LIBS += -L"$$project_dir/third-party/openvr/lib/linux64"
LIBS += -lopenvr_api
RESOURCES += src/res/resources.qrc
DISTFILES += \
src/res/sounds/alarm01.wav \
src/res/sounds/click.wav \
src/res/sounds/focus.wav \
src/res/img/audio/microphone/ptt_notification.png \
src/res/img/audio/microphone/ptt_notification.svg \
src/res/img/battery/* \
src/res/img/icons/* \
src/res/img/alarm/* \
src/res/img/video/* \
src/res/img/chaperone/* \
src/res/qml/qmldir \
src/res/qml/audio_page/* \
src/res/qml/ChaperonePage.qml \
src/res/qml/ChaperoneWarningsPage.qml \
src/res/qml/chaperone_page/* \
src/res/qml/chaperone_page/change_orientation/* \
src/res/qml/chaperone_page/chaperone_additional/* \
src/res/qml/chaperone_page/chaperone_additional/chaperoneboundscolor/* \
src/res/qml/chaperone_page/chaperone_additional/chaperonetype/* \
src/res/qml/chaperone_page/chaperone_additional/chaperonemisc/* \
src/res/qml/FixFloorPage.qml \
src/res/qml/PlayspacePage.qml \
src/res/qml/motion_page/* \
src/res/qml/motion_page/gravity/* \
src/res/qml/motion_page/height_toggle/* \
src/res/qml/motion_page/space_drag/* \
src/res/qml/RootPage.qml \
src/res/qml/SettingsPage.qml \
src/res/qml/StatisticsPage.qml \
src/res/qml/steamvr_page/SteamVRPage.qml \
src/res/qml/steamvr_page/steamvr_additional/* \
src/res/qml/steamvr_page/camera/* \
src/res/qml/steamvr_page/steamvrmisc/* \
src/res/qml/steamvr_page/steamvrbind/* \
src/res/qml/utilities_page/* \
src/res/qml/utilities_page/media_keys/* \
src/res/qml/utilities_page/keyboard_utils/* \
src/res/qml/utilities_page/alarm_clock/* \
src/res/qml/utilities_page/misc/* \
src/res/qml/audio_page/dialog_boxes/* \
src/res/qml/audio_page/device_selector/* \
src/res/qml/audio_page/proximity/* \
src/res/qml/audio_page/push_to_talk/* \
src/res/qml/audio_page/profiles/* \
src/res/qml/video_page/* \
src/res/qml/video_page/brightness/* \
src/res/qml/video_page/color/* \
src/res/qml/video_page/supersampling/* \
src/res/qml/video_page/miscvid/* \
src/res/qml/video_page/profiles/* \
src/res/qml/video_page/dialogboxes/* \
src/res/qml/video_page/overlaycolorbright/* \
src/res/qml/rotation_page/* \
src/res/qml/rotation_page/redirected/* \
src/res/qml/rotation_page/snap_turn/* \
src/res/qml/rotation_page/space_turn/* \
src/res/qml/rotation_page/view_ratchet/* \
src/res/qml/common/*
win32:RC_ICONS += src/res/img/icons/advicon256px.ico
-157
View File
@@ -1,157 +0,0 @@
SOURCES += src/main.cpp\
src/overlaycontroller.cpp \
src/tabcontrollers/AudioTabController.cpp \
src/tabcontrollers/ChaperoneTabController.cpp \
src/tabcontrollers/FixFloorTabController.cpp \
src/tabcontrollers/MoveCenterTabController.cpp \
src/tabcontrollers/SettingsTabController.cpp \
src/tabcontrollers/StatisticsTabController.cpp \
src/tabcontrollers/SteamVRTabController.cpp \
src/tabcontrollers/UtilitiesTabController.cpp \
src/tabcontrollers/VideoTabController.cpp \
src/tabcontrollers/RotationTabController.cpp\
src/utils/ChaperoneUtils.cpp \
src/openvr/openvr_init.cpp \
src/openvr/ivrinput.cpp \
src/openvr/ovr_settings_wrapper.cpp \
src/openvr/ovr_overlay_wrapper.cpp \
src/openvr/ovr_system_wrapper.cpp \
src/openvr/lh_console_util.cpp \
src/openvr/ovr_application_wrapper.cpp \
src/utils/setup.cpp \
src/utils/paths.cpp \
src/utils/FrameRateUtils.cpp \
src/keyboard_input/keyboard_input.cpp \
src/keyboard_input/input_parser.cpp \
src/settings/settings.cpp \
src/settings/settings_object.cpp \
src/alarm_clock/vr_alarm.cpp \
src/utils/update_rate.cpp \
HEADERS += src/overlaycontroller.h \
src/tabcontrollers/AudioTabController.h \
src/tabcontrollers/ChaperoneTabController.h \
src/tabcontrollers/FixFloorTabController.h \
src/tabcontrollers/MoveCenterTabController.h \
src/tabcontrollers/SettingsTabController.h \
src/tabcontrollers/StatisticsTabController.h \
src/tabcontrollers/SteamVRTabController.h \
src/tabcontrollers/UtilitiesTabController.h \
src/tabcontrollers/VideoTabController.h \
src/tabcontrollers/audiomanager/AudioManager.h \
src/tabcontrollers/RotationTabController.h\
src/keyboard_input/keyboard_input.h \
src/media_keys/media_keys.h \
src/utils/Matrix.h \
src/utils/ChaperoneUtils.h \
src/quaternion/quaternion.h \
src/openvr/openvr_init.h \
src/openvr/ivrinput_action.h \
src/openvr/ivrinput_manifest.h \
src/openvr/ivrinput_action_set.h \
src/openvr/ivrinput_input_source.h \
src/openvr/ivrinput.h \
src/openvr/ovr_settings_wrapper.h \
src/openvr/ovr_overlay_wrapper.h \
src/openvr/ovr_system_wrapper.h \
src/openvr/ovr_application_wrapper.h \
src/openvr/lh_console_util.h \
src/utils/setup.h \
src/utils/paths.h \
src/utils/FrameRateUtils.h \
src/keyboard_input/input_parser.h \
src/keyboard_input/input_sender.h \
src/settings/settings.h \
src/settings/internal/setting_value.h \
src/settings/internal/settings_internal.h \
src/settings/internal/settings_controller.h \
src/settings/internal/specific_setting_value.h \
src/settings/settings_object.h \
src/settings/internal/settings_object_data.h \
src/alarm_clock/vr_alarm.h \
src/settings/internal/settings_object_data.h \
src/settings/internal/settings_object_data.h \
src/utils/update_rate.h \
win32 {
SOURCES += src/tabcontrollers/audiomanager/AudioManagerWindows.cpp \
src/keyboard_input/input_sender_win.cpp \
src/media_keys/media_keys_win.cpp
HEADERS += src/tabcontrollers/audiomanager/AudioManagerWindows.h
}
unix:!macx {
!noX11 {
message(X11 features enabled.)
SOURCES += src/keyboard_input/input_sender_X11.cpp
CONFIG += x11
LIBS += -lXtst
}
else {
message(X11 features disabled.)
SOURCES += src/keyboard_input/input_sender_dummy.cpp
}
!noDBUS {
message(DBUS features enabled.)
SOURCES += src/media_keys/media_keys_dbus.cpp
QT += dbus
}
else {
message(DBUS features disabled.)
SOURCES += src/media_keys/media_keys_dummy.cpp
}
!noPulse {
message(PulseAudio features enabled.)
SOURCES += src/tabcontrollers/audiomanager/AudioManagerPulse.cpp
HEADERS += src/tabcontrollers/audiomanager/AudioManagerPulse.h \
src/tabcontrollers/audiomanager/AudioManagerPulse_internal.h
LIBS += -lpulse
}
else {
message(PulseAudio features disabled.)
SOURCES += src/tabcontrollers/audiomanager/AudioManagerDummy.cpp
HEADERS += src/tabcontrollers/audiomanager/AudioManagerDummy.h
}
}
macx {
SOURCES += src/keyboard_input/input_sender_dummy.cpp \
src/media_keys/media_keys_dummy.cpp \
src/tabcontrollers/audiomanager/AudioManagerDummy.cpp
HEADERS += src/tabcontrollers/audiomanager/AudioManagerDummy.h
}
win32-msvc {
INCLUDEPATH += third-party/openvr/headers \
third-party/easylogging++ \
third-party/policyconfig
}
win32-clang-msvc {
QMAKE_CXXFLAGS += /imsvc "$$PWD/../../third-party/openvr/headers"
QMAKE_CXXFLAGS += /imsvc "$$PWD/../../third-party/easylogging++"
QMAKE_CXXFLAGS += /imsvc "$$PWD/../../third-party/policyconfig"
}
# Anything g++ or clang
# In order to suppress warnings in third party headers
*clang|*clang-g++|*clang-libc++|*g++* {
#Force Linux to look into the current dir for the OpenVR lib
QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN\''
QMAKE_CXXFLAGS += -isystem $$[QT_INSTALL_HEADERS]
QMAKE_CXXFLAGS += -isystem $$[QT_INSTALL_HEADERS]/QtCore
QMAKE_CXXFLAGS += -isystem $$[QT_INSTALL_HEADERS]/QtGui
QMAKE_CXXFLAGS += -isystem $$PWD/../../third-party/openvr/headers
QMAKE_CXXFLAGS += -isystem $$PWD/../../third-party/easylogging++
}
# easylogging++ used to be a header only lib. Now requires easylogging++.cc
SOURCES += third-party/easylogging++/easylogging++.cc
+5
View File
@@ -0,0 +1,5 @@
if ($null -ne $env:_SAVED_PATH) {
$env:PATH=$env:_SAVED_PATH;
}
$env:_SAVED_PATH=$env:PATH;
$env:PATH+=";@NATIVE_QT_ROOT@\bin;@NATIVE_PROJECT_SOURCE_DIR@\third-party\openvr\bin\win64";
+9
View File
@@ -0,0 +1,9 @@
export _SAVED_PATH="${_SAVED_PATH:-}"
if [ ! -z "$_SAVED_PATH" ]; then
export PATH="$_SAVED_PATH"
fi
export _SAVED_PATH="$PATH"
export PATH="$PATH:$(echo "@NATIVE_QT_ROOT@"|sed -E 's/(\w):/\/\L\1/')/bin:$(echo "@PROJECT_SOURCE_DIR@"|sed -E 's/(\w):/\/\L\1/')/third-party/openvr/bin/win64"
echo $_SAVED_PATH
echo $PATH
+2
View File
@@ -0,0 +1,2 @@
[Paths]
Plugins=@QT_ROOT@\\plugins
+8
View File
@@ -0,0 +1,8 @@
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VENDOR "OVRAS Team")
# NSIS installer config
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/src/res/img/icons/advicon256px.ico")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
set(CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME} ${CMAKE_VERSION}")
set(CPACK_NSIS_MODIFY_PATH OFF)
+1
View File
@@ -0,0 +1 @@
build/compile_commands.json
+17 -13
View File
@@ -1,8 +1,11 @@
#include <easylogging++.h>
#include "../tabcontrollers/UtilitiesTabController.h" #include "../tabcontrollers/UtilitiesTabController.h"
#include "vr_alarm.h" #include "vr_alarm.h"
#include "../openvr/ovr_overlay_wrapper.h" #include "../openvr/ovr_overlay_wrapper.h"
#include "../utils/update_rate.h" #include "../utils/update_rate.h"
#include <thread>
#include <QtLogging>
#include <QtDebug>
namespace alarm_clock namespace alarm_clock
{ {
@@ -76,13 +79,14 @@ void VrAlarm::checkAlarmStatus()
&& timeToAlarmActivation > 0; && timeToAlarmActivation > 0;
if ( activateAlarm ) if ( activateAlarm )
{ {
LOG( INFO ) << "Alarm fired at " << m_alarm.hour() << ":" qInfo() << "Alarm fired at " << m_alarm.hour() << ":"
<< m_alarm.minute() << ":" << m_alarm.second() << "."; << m_alarm.minute() << ":" << m_alarm.second() << ".";
showAlarmNotification(); showAlarmNotification();
setAlarmEnabled( false ); setAlarmEnabled( false );
std::thread t( std::thread t(
[]( vr::VROverlayHandle_t overlayHandle ) { []( vr::VROverlayHandle_t overlayHandle )
{
// This will freeze the overlay for 3 seconds // This will freeze the overlay for 3 seconds
std::this_thread::sleep_for( std::chrono::seconds( 3 ) ); std::this_thread::sleep_for( std::chrono::seconds( 3 ) );
ovr_overlay_wrapper::hideOverlay( overlayHandle ); ovr_overlay_wrapper::hideOverlay( overlayHandle );
@@ -102,9 +106,9 @@ void VrAlarm::setAlarmTime( const int hour, const int minute, const int second )
{ {
if ( !QTime::isValid( hour, minute, second ) ) if ( !QTime::isValid( hour, minute, second ) )
{ {
LOG( ERROR ) << "setAlarmTime passed invalid time values: '" << hour qCritical() << "setAlarmTime passed invalid time values: '" << hour
<< "' hours, '" << minute << "' minutes, '" << second << "' hours, '" << minute << "' minutes, '" << second
<< "' seconds."; << "' seconds.";
} }
setSetting( IntSetting::UTILITY_alarmHour, hour ); setSetting( IntSetting::UTILITY_alarmHour, hour );
@@ -119,20 +123,20 @@ void VrAlarm::modAlarmTime( const int hour, const int minute, const int second )
{ {
if ( hour > 22 || hour < -22 ) if ( hour > 22 || hour < -22 )
{ {
LOG( ERROR ) << "modAlarmTime called with incorrect hour value: '" qCritical() << "modAlarmTime called with incorrect hour value: '"
<< hour << "'. Values not applied."; << hour << "'. Values not applied.";
return; return;
} }
if ( minute > 58 || minute < -58 ) if ( minute > 58 || minute < -58 )
{ {
LOG( ERROR ) << "modAlarmTime called with incorrect minute value: '" qCritical() << "modAlarmTime called with incorrect minute value: '"
<< minute << "'. Values not applied."; << minute << "'. Values not applied.";
return; return;
} }
if ( second > 58 || minute < -58 ) if ( second > 58 || minute < -58 )
{ {
LOG( ERROR ) << "modAlarmTime called with incorrect second value: '" qCritical() << "modAlarmTime called with incorrect second value: '"
<< second << "'. Values not applied."; << second << "'. Values not applied.";
return; return;
} }
+6 -3
View File
@@ -1,5 +1,8 @@
#include "input_parser.h" #include "input_parser.h"
#include <QtLogging>
#include <QtDebug>
std::optional<Token> getModifier( const char& character ) noexcept std::optional<Token> getModifier( const char& character ) noexcept
{ {
switch ( character ) switch ( character )
@@ -50,7 +53,7 @@ std::optional<Token> getFunctionNumber( const char& character ) noexcept
return Token::KEY_F9; return Token::KEY_F9;
default: default:
LOG( INFO ) << "Unknown function key number: " << character; qInfo() << "Unknown function key number: " << character;
return std::nullopt; return std::nullopt;
} }
} }
@@ -80,7 +83,7 @@ std::optional<Token> getFunctionNumberExtended( const char& character ) noexcept
case '9': case '9':
return Token::KEY_F19; return Token::KEY_F19;
default: default:
LOG( INFO ) << "Unknown function key number: " << character; qInfo() << "Unknown function key number: " << character;
return std::nullopt; return std::nullopt;
} }
} }
@@ -210,7 +213,7 @@ std::vector<Token>
if ( !isupper( *ch ) || isspace( *ch ) ) if ( !isupper( *ch ) || isspace( *ch ) )
{ {
LOG( INFO ) << "Unknown character found in sequence: " << *ch; qInfo() << "Unknown character found in sequence: " << *ch;
continue; continue;
} }
// Everything below is upper case // Everything below is upper case
-1
View File
@@ -3,7 +3,6 @@
#include <vector> #include <vector>
#include <cctype> #include <cctype>
#include <optional> #include <optional>
#include <easylogging++.h>
enum class Token enum class Token
{ {
-1
View File
@@ -1,6 +1,5 @@
#pragma once #pragma once
#include "input_parser.h" #include "input_parser.h"
#include <easylogging++.h>
enum class KeyStatus enum class KeyStatus
{ {
+4 -2
View File
@@ -2,6 +2,8 @@
#include <vector> #include <vector>
#include <Windows.h> #include <Windows.h>
#include <cctype> #include <cctype>
#include <QtLogging>
#include <QtDebug>
WORD convertToVirtualKeycode( const Token token ) WORD convertToVirtualKeycode( const Token token )
{ {
@@ -183,13 +185,13 @@ void sendKeyboardInputRaw( std::vector<INPUT> inputs )
0, 0,
nullptr ) ) nullptr ) )
{ {
LOG( ERROR ) qCritical()
<< "Error calling SendInput(): Could not get error message (" << "Error calling SendInput(): Could not get error message ("
<< errCode << ")"; << errCode << ")";
} }
else else
{ {
LOG( ERROR ) << "Error calling SendInput(): " << err; qCritical() << "Error calling SendInput(): " << err;
} }
} }
} }
+19 -28
View File
@@ -1,6 +1,11 @@
#include "utils/setup.h" #include "utils/setup.h"
#include "settings/settings.h" #include "settings/settings.h"
#include "openvr/ovr_settings_wrapper.h" #include "openvr/ovr_settings_wrapper.h"
#include <QtLogging>
#include <QtDebug>
#include <memory>
#ifdef _WIN64 #ifdef _WIN64
# include <windows.h> # include <windows.h>
extern "C" __declspec( dllexport ) DWORD NvOptimusEnablement = 0x00000001; extern "C" __declspec( dllexport ) DWORD NvOptimusEnablement = 0x00000001;
@@ -8,16 +13,13 @@ extern "C" __declspec( dllexport ) DWORD AmdPowerXpressRequestHighPerformance
= 0x00000001; = 0x00000001;
#endif #endif
INITIALIZE_EASYLOGGINGPP
int main( int argc, char* argv[] ) int main( int argc, char* argv[] )
{ {
setUpLogging(); setUpLogging();
LOG( INFO ) << "Settings File: " qInfo() << "Settings File: " << settings::initializeAndGetSettingsPath();
<< settings::initializeAndGetSettingsPath();
LOG( INFO ) << settings::getSettingsAndValues(); qInfo() << settings::getSettingsAndValues();
QCoreApplication::setAttribute( Qt::AA_Use96Dpi ); QCoreApplication::setAttribute( Qt::AA_Use96Dpi );
QCoreApplication::setAttribute( Qt::AA_UseDesktopOpenGL ); QCoreApplication::setAttribute( Qt::AA_UseDesktopOpenGL );
@@ -30,8 +32,6 @@ int main( int argc, char* argv[] )
mainEventLoop.setApplicationVersion( mainEventLoop.setApplicationVersion(
application_strings::applicationVersionString ); application_strings::applicationVersionString );
qInstallMessageHandler( mainQtMessageHandler );
const auto commandLineArgs const auto commandLineArgs
= argument::returnCommandLineParser( mainEventLoop ); = argument::returnCommandLineParser( mainEventLoop );
@@ -51,34 +51,25 @@ int main( int argc, char* argv[] )
{ {
QQmlEngine qmlEngine; QQmlEngine qmlEngine;
advsettings::OverlayController controller( commandLineArgs.desktopMode, std::unique_ptr<advsettings::OverlayController> controller(
commandLineArgs.forceNoSound, new advsettings::OverlayController( commandLineArgs.desktopMode,
qmlEngine ); commandLineArgs.forceNoSound,
qmlEngine ) );
constexpr auto widgetPath = "res/qml/common/mainwidget.qml";
const auto path = paths::binaryDirectoryFindFile( widgetPath );
if ( !path.has_value() )
{
LOG( ERROR ) << "Unable to find file '" << widgetPath << "'.";
throw std::runtime_error(
"Unable to find critical file. See log for more information." );
}
const auto url const auto url
= QUrl::fromLocalFile( QString::fromStdString( ( *path ) ) ); = QUrl( "qrc:/qt/qml/AdvancedSettings/common/mainwidget.qml" );
QQmlComponent component( &qmlEngine, url ); QQmlComponent component( &qmlEngine, url );
auto errors = component.errors(); auto errors = component.errors();
for ( auto& e : errors ) for ( auto& e : errors )
{ {
LOG( ERROR ) << "QML Error: " << e.toString().toStdString() qCritical() << "QML Error: "
<< std::endl; << e.toString().toStdString(); //<< std::endl;
} }
auto quickObj = component.create(); auto quickObj = component.create();
controller.SetWidget( qobject_cast<QQuickItem*>( quickObj ), controller->SetWidget( qobject_cast<QQuickItem*>( quickObj ),
application_strings::applicationDisplayName, application_strings::applicationDisplayName,
application_strings::applicationKey ); application_strings::applicationKey );
// Attempts to install the application manifest on all "regular" starts. // Attempts to install the application manifest on all "regular" starts.
if ( !commandLineArgs.forceNoManifest ) if ( !commandLineArgs.forceNoManifest )
@@ -99,7 +90,7 @@ int main( int argc, char* argv[] )
} }
catch ( std::exception& e ) catch ( std::exception& e )
{ {
LOG( ERROR ) << e.what(); qCritical() << e.what();
} }
} }
@@ -129,7 +120,7 @@ int main( int argc, char* argv[] )
} }
catch ( const std::exception& e ) catch ( const std::exception& e )
{ {
LOG( FATAL ) << e.what(); qFatal() << e.what();
return ReturnErrorCode::GENERAL_FAILURE; return ReturnErrorCode::GENERAL_FAILURE;
} }
} }
-1
View File
@@ -1,5 +1,4 @@
#pragma once #pragma once
#include <easylogging++.h>
#include <vector> #include <vector>
#include <QString> #include <QString>
+5 -3
View File
@@ -3,6 +3,8 @@
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtDBus/QtDBus> #include <QtDBus/QtDBus>
#include <QtLogging>
#include <QtDebug>
namespace keyboardinput namespace keyboardinput
{ {
@@ -10,7 +12,7 @@ void callMethodForAllMediaPlayerAvailableServices( const QString& method )
{ {
if ( !QDBusConnection::sessionBus().isConnected() ) if ( !QDBusConnection::sessionBus().isConnected() )
{ {
LOG( ERROR ) << "Media Keys: Unable to connect to DBUS session bus."; qCritical() << "Media Keys: Unable to connect to DBUS session bus.";
return; return;
} }
@@ -18,9 +20,9 @@ void callMethodForAllMediaPlayerAvailableServices( const QString& method )
= QDBusConnection::sessionBus().interface()->registeredServiceNames(); = QDBusConnection::sessionBus().interface()->registeredServiceNames();
if ( !names.isValid() ) if ( !names.isValid() )
{ {
LOG( ERROR ) qCritical()
<< "Media Keys: Error getting DBUS registered service names:"; << "Media Keys: Error getting DBUS registered service names:";
LOG( ERROR ) << names.error().message(); qCritical() << names.error().message();
} }
foreach ( QString name, names.value() ) foreach ( QString name, names.value() )
+4 -2
View File
@@ -1,6 +1,8 @@
#include "media_keys.h" #include "media_keys.h"
#include "src/keyboard_input/input_sender.h" #include "src/keyboard_input/input_sender.h"
#include <Windows.h> #include <Windows.h>
#include <QtLogging>
#include <QtDebug>
namespace keyboardinput namespace keyboardinput
{ {
@@ -45,13 +47,13 @@ void sendKeyboardInputRaw( std::vector<INPUT> inputs )
0, 0,
nullptr ) ) nullptr ) )
{ {
LOG( ERROR ) qCritical()
<< "Error calling SendInput(): Could not get error message (" << "Error calling SendInput(): Could not get error message ("
<< errCode << ")"; << errCode << ")";
} }
else else
{ {
LOG( ERROR ) << "Error calling SendInput(): " << err; qCritical() << "Error calling SendInput(): " << err;
} }
} }
} }
+7 -6
View File
@@ -3,7 +3,8 @@
#include <openvr.h> #include <openvr.h>
#include <iostream> #include <iostream>
#include <array> #include <array>
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
namespace input namespace input
{ {
@@ -30,8 +31,8 @@ vr::InputDigitalActionData_t getDigitalActionData( DigitalAction& action )
if ( error != vr::EVRInputError::VRInputError_None ) if ( error != vr::EVRInputError::VRInputError_None )
{ {
LOG( ERROR ) << "Error getting IVRInput Digital Action Data for handle " qCritical() << "Error getting IVRInput Digital Action Data for handle "
<< action.name() << ". SteamVR Error: " << error; << action.name() << ". SteamVR Error: " << error;
} }
return handleData; return handleData;
@@ -60,8 +61,8 @@ vr::InputAnalogActionData_t getAnalogActionData( AnalogAction& action )
if ( error != vr::EVRInputError::VRInputError_None ) if ( error != vr::EVRInputError::VRInputError_None )
{ {
LOG( ERROR ) << "Error getting IVRInput Digital Action Data for handle " qCritical() << "Error getting IVRInput Digital Action Data for handle "
<< action.name() << ". SteamVR Error: " << error; << action.name() << ". SteamVR Error: " << error;
} }
return handleData; return handleData;
@@ -454,7 +455,7 @@ void SteamIVRInput::UpdateStates()
if ( error != vr::EVRInputError::VRInputError_None ) if ( error != vr::EVRInputError::VRInputError_None )
{ {
LOG( ERROR ) qCritical()
<< "Error during IVRInput action state update. OpenVR Error: " << "Error during IVRInput action state update. OpenVR Error: "
<< error; << error;
} }
+4 -3
View File
@@ -1,6 +1,7 @@
#pragma once #pragma once
#include <openvr.h> #include <openvr.h>
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
namespace input namespace input
{ {
@@ -30,8 +31,8 @@ public:
if ( error != vr::EVRInputError::VRInputError_None ) if ( error != vr::EVRInputError::VRInputError_None )
{ {
LOG( ERROR ) << "Error getting handle for '" << actionName qCritical() << "Error getting handle for '" << actionName
<< "'. OpenVR Error: " << error; << "'. OpenVR Error: " << error;
} }
} }
/*! /*!
+4 -3
View File
@@ -1,6 +1,7 @@
#pragma once #pragma once
#include <openvr.h> #include <openvr.h>
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
namespace input namespace input
{ {
@@ -16,8 +17,8 @@ public:
auto error = vr::VRInput()->GetActionSetHandle( setName, &handle ); auto error = vr::VRInput()->GetActionSetHandle( setName, &handle );
if ( error != vr::EVRInputError::VRInputError_None ) if ( error != vr::EVRInputError::VRInputError_None )
{ {
LOG( ERROR ) << "Error getting handle for '" << setName qCritical() << "Error getting handle for '" << setName
<< "'. OpenVR Error: " << error; << "'. OpenVR Error: " << error;
} }
m_activeActionSet.ulActionSet = handle; m_activeActionSet.ulActionSet = handle;
+4 -4
View File
@@ -1,6 +1,7 @@
#pragma once #pragma once
#include <openvr.h> #include <openvr.h>
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
namespace input namespace input
{ {
@@ -17,9 +18,8 @@ public:
if ( error != vr::EVRInputError::VRInputError_None ) if ( error != vr::EVRInputError::VRInputError_None )
{ {
LOG( ERROR ) << "Error getting input handle for '" qCritical() << "Error getting input handle for '" << inputSourceName
<< inputSourceName << "'. OpenVR Input Error: " << error;
<< "'. OpenVR Input Error: " << error;
} }
} }
/*! /*!
+6 -5
View File
@@ -1,6 +1,7 @@
#pragma once #pragma once
#include <openvr.h> #include <openvr.h>
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
#include "../utils/paths.h" #include "../utils/paths.h"
namespace input namespace input
@@ -19,8 +20,8 @@ public:
if ( !actionManifestPath.has_value() ) if ( !actionManifestPath.has_value() )
{ {
LOG( ERROR ) << "Could not find action manifest. Action manifests " qCritical() << "Could not find action manifest. Action manifests "
"not initialized."; "not initialized.";
return; return;
} }
@@ -29,8 +30,8 @@ public:
auto error = vr::VRInput()->SetActionManifestPath( validManifestPath ); auto error = vr::VRInput()->SetActionManifestPath( validManifestPath );
if ( error != vr::EVRInputError::VRInputError_None ) if ( error != vr::EVRInputError::VRInputError_None )
{ {
LOG( ERROR ) << "Error setting action manifest path: " qCritical() << "Error setting action manifest path: "
<< validManifestPath << ". OpenVR Error: " << error; << validManifestPath << ". OpenVR Error: " << error;
} }
} }
+12 -9
View File
@@ -1,4 +1,7 @@
#include "lh_console_util.h" #include "lh_console_util.h"
#include <QtLogging>
#include <QtDebug>
#include <QRegularExpression>
namespace lh_con_util namespace lh_con_util
{ {
@@ -6,12 +9,12 @@ bool LHCUtil::FindAll()
{ {
if ( !FindAllRX() ) if ( !FindAllRX() )
{ {
LOG( ERROR ) << "Find All Recievers Failed"; qCritical() << "Find All Recievers Failed";
return false; return false;
} }
if ( !FindAllTX() ) if ( !FindAllTX() )
{ {
LOG( ERROR ) << "Find All Transmitters Failed"; qCritical() << "Find All Transmitters Failed";
return false; return false;
} }
return true; return true;
@@ -26,7 +29,7 @@ bool LHCUtil::FindAllRX()
QString output = QString( lhProcess->readAllStandardOutput() ); QString output = QString( lhProcess->readAllStandardOutput() );
QStringList outputLines QStringList outputLines
= output.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts ); = output.split( QRegularExpression( "[\r\n]" ), Qt::SkipEmptyParts );
bool RecieverStart = false; bool RecieverStart = false;
for ( auto OutputLine : outputLines ) for ( auto OutputLine : outputLines )
@@ -44,7 +47,7 @@ bool LHCUtil::FindAllRX()
} }
OutputLine.simplified().remove( " " ); OutputLine.simplified().remove( " " );
OutputLine.remove( 0, 1 ); OutputLine.remove( 0, 1 );
// LOG( WARNING ) << OutputLine << std::endl; // qWarning() << OutputLine << std::endl;
RXTX_Pairs_.push_back( RXTX_Pair{ OutputLine, " ", true, false } ); RXTX_Pairs_.push_back( RXTX_Pair{ OutputLine, " ", true, false } );
} }
} }
@@ -53,21 +56,21 @@ bool LHCUtil::FindAllRX()
bool LHCUtil::FindConnectedTX( QString RXSerial ) bool LHCUtil::FindConnectedTX( QString RXSerial )
{ {
LOG( WARNING ) << RXSerial; qWarning() << RXSerial;
QProcess* lhProcess = new QProcess(); QProcess* lhProcess = new QProcess();
lhProcess->start( path_, QStringList() << "/serial" << RXSerial << "exit" ); lhProcess->start( path_, QStringList() << "/serial" << RXSerial << "exit" );
lhProcess->waitForFinished(); lhProcess->waitForFinished();
QString output = QString( lhProcess->readAllStandardOutput() ); QString output = QString( lhProcess->readAllStandardOutput() );
QStringList outputLines QStringList outputLines
= output.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts ); = output.split( QRegularExpression( "[\r\n]" ), Qt::SkipEmptyParts );
// std::vector<std::string> OutputLines // std::vector<std::string> OutputLines
// = exec( ( "\"" + path_ + "\" /serial " + RXSerial + " exit" ).c_str() // = exec( ( "\"" + path_ + "\" /serial " + RXSerial + " exit" ).c_str()
// ); // );
bool lhConFound = false; bool lhConFound = false;
for ( auto outputLine : outputLines ) for ( auto outputLine : outputLines )
{ {
// LOG( WARNING ) << outputLine; // qWarning() << outputLine;
if ( outputLine.contains( "Connected to receiver" ) ) if ( outputLine.contains( "Connected to receiver" ) )
{ {
auto splitList = outputLine.split( ":" ); auto splitList = outputLine.split( ":" );
@@ -84,7 +87,7 @@ bool LHCUtil::FindConnectedTX( QString RXSerial )
rxtx.TX_Serial = TXSerial; rxtx.TX_Serial = TXSerial;
rxtx.Is_Paired = true; rxtx.Is_Paired = true;
rxtx.Is_Init = true; rxtx.Is_Init = true;
LOG( WARNING ) qWarning()
<< "tx serial stored: " << TXSerial.toStdString(); << "tx serial stored: " << TXSerial.toStdString();
return true; return true;
} }
@@ -102,7 +105,7 @@ bool LHCUtil::FindConnectedTX( QString RXSerial )
rxtx.TX_Serial = ""; rxtx.TX_Serial = "";
rxtx.Is_Paired = false; rxtx.Is_Paired = false;
rxtx.Is_Init = true; rxtx.Is_Init = true;
LOG( WARNING ) << "tx oops"; qWarning() << "tx oops";
return true; return true;
} }
} }
-1
View File
@@ -12,7 +12,6 @@
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
#include <QRegularExpression> #include <QRegularExpression>
#include <easylogging++.h>
namespace lh_con_util namespace lh_con_util
{ {
+20 -18
View File
@@ -1,8 +1,10 @@
#include <string> #include <string>
#include <thread>
#include <openvr.h> #include <openvr.h>
#include <QMessageBox> #include <QMessageBox>
#include "openvr_init.h" #include "openvr_init.h"
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
#include "../openvr/ivrinput_manifest.h" #include "../openvr/ivrinput_manifest.h"
namespace openvr_init namespace openvr_init
@@ -29,17 +31,17 @@ bool initializeProperly( const OpenVrInitializationType initType )
// In particular in some setups these errors are thrown while // In particular in some setups these errors are thrown while
// nothing is wrong with their setup presumably this is some sort of // nothing is wrong with their setup presumably this is some sort of
// race condition // race condition
LOG( WARNING ) << "HMD not Found During Startup"; qWarning() << "HMD not Found During Startup";
LOG( WARNING ) << "steamvr error: " qWarning() << "steamvr error: "
+ std::string( + std::string(
vr::VR_GetVRInitErrorAsEnglishDescription( vr::VR_GetVRInitErrorAsEnglishDescription(
initError ) ); initError ) );
return false; return false;
} }
LOG( ERROR ) << "Failed to initialize OpenVR: " qCritical() << "Failed to initialize OpenVR: "
+ std::string( + std::string(
vr::VR_GetVRInitErrorAsEnglishDescription( vr::VR_GetVRInitErrorAsEnglishDescription(
initError ) ); initError ) );
// Going to stop Exiting App, This may lead to crashes if OpenVR // Going to stop Exiting App, This may lead to crashes if OpenVR
// actually fails to start, HOWEVER based on the HMD errors we are // actually fails to start, HOWEVER based on the HMD errors we are
// probably pre-maturely killing ourselves from some sort of OpenVR race // probably pre-maturely killing ourselves from some sort of OpenVR race
@@ -48,7 +50,7 @@ bool initializeProperly( const OpenVrInitializationType initType )
return false; return false;
} }
LOG( INFO ) << "OpenVR initialized successfully."; qInfo() << "OpenVR initialized successfully.";
return true; return true;
} }
@@ -65,9 +67,9 @@ void initializeOpenVR( const OpenVrInitializationType initType, int count )
// as of 5.8.1 Based on some information from valve, if ANY interface // as of 5.8.1 Based on some information from valve, if ANY interface
// fails to load we should have issues. we will re-initialize a few // fails to load we should have issues. we will re-initialize a few
// times if that is the case and hope that fixes things // times if that is the case and hope that fixes things
LOG( WARNING ) << "OpenVR version is invalid: Interface version " qWarning() << "OpenVR version is invalid: Interface version "
<< interfaceAndVersion << " not found. attempt number: " << interfaceAndVersion << " not found. attempt number: "
<< std::to_string( trynumber ); << std::to_string( trynumber );
}; };
// Check whether OpenVR is too outdated // Check whether OpenVR is too outdated
@@ -121,16 +123,16 @@ void initializeOpenVR( const OpenVrInitializationType initType, int count )
} }
if ( !success && count < 3 ) if ( !success && count < 3 )
{ {
LOG( WARNING ) << "An error occured on initialization of " qWarning() << "An error occured on initialization of "
"openvr/steamvr attempting again " "openvr/steamvr attempting again "
<< std::to_string( count + 1 ) << " of 3 Attempts"; << std::to_string( count + 1 ) << " of 3 Attempts";
std::this_thread::sleep_for( std::chrono::seconds( 5 ) ); std::this_thread::sleep_for( std::chrono::seconds( 5 ) );
// 5.8.1 Unknown if VR shutdown needs to be callled if vr init fails // 5.8.1 Unknown if VR shutdown needs to be callled if vr init fails
initializeOpenVR( initType, ( count + 1 ) ); initializeOpenVR( initType, ( count + 1 ) );
} }
if ( count >= 3 ) if ( count >= 3 )
{ {
LOG( ERROR ) << "initialization errors persist proceeding anyways"; qCritical() << "initialization errors persist proceeding anyways";
} }
} }
+9 -8
View File
@@ -1,4 +1,6 @@
#include "ovr_application_wrapper.h" #include "ovr_application_wrapper.h"
#include <QtLogging>
#include <QtDebug>
constexpr uint32_t bufferLen = 4096; constexpr uint32_t bufferLen = 4096;
namespace ovr_application_wrapper namespace ovr_application_wrapper
{ {
@@ -12,9 +14,8 @@ std::string getSceneAppID()
std::string keys = key; std::string keys = key;
if ( error != vr::VRApplicationError_None ) if ( error != vr::VRApplicationError_None )
{ {
LOG( WARNING ) << "Could not Get App ID by PID: " qWarning() << "Could not Get App ID by PID: " + std::to_string( error );
+ std::to_string( error ); qWarning() << "Attempting to find through Enumeration";
LOG( WARNING ) << "Attempting to find through Enumeration";
auto appCount = vr::VRApplications()->GetApplicationCount(); auto appCount = vr::VRApplications()->GetApplicationCount();
const uint32_t bufferMax = vr::k_unMaxApplicationKeyLength; const uint32_t bufferMax = vr::k_unMaxApplicationKeyLength;
char cStringOut[bufferMax]; char cStringOut[bufferMax];
@@ -25,17 +26,17 @@ std::string getSceneAppID()
std::string appID( cStringOut ); std::string appID( cStringOut );
if ( appID.find( "steam.app" ) != std::string::npos ) if ( appID.find( "steam.app" ) != std::string::npos )
{ {
LOG( WARNING ) << "Found App ID through Enumeration (only " qWarning() << "Found App ID through Enumeration (only "
"steam apps caught): " "steam apps caught): "
<< appID; << appID;
if ( error2 == vr::VRApplicationError_None ) if ( error2 == vr::VRApplicationError_None )
{ {
return appID; return appID;
} }
LOG( WARNING ) << "Error getting app id via Enum: " << error2; qWarning() << "Error getting app id via Enum: " << error2;
} }
} }
LOG( ERROR ) << "Unable to Find App ID by PID or by Enumeration"; qCritical() << "Unable to Find App ID by PID or by Enumeration";
return "error"; return "error";
} }
return keys; return keys;
-1
View File
@@ -3,7 +3,6 @@
#include <openvr.h> #include <openvr.h>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <easylogging++.h>
#include <utility> #include <utility>
#include <map> #include <map>
+35 -34
View File
@@ -1,4 +1,6 @@
#include "ovr_overlay_wrapper.h" #include "ovr_overlay_wrapper.h"
#include <QtLogging>
#include <QtDebug>
namespace ovr_overlay_wrapper namespace ovr_overlay_wrapper
{ {
@@ -11,10 +13,9 @@ OverlayError createOverlay( const std::string overlayKey,
overlayKey.c_str(), overlayName.c_str(), overlayHandle ); overlayKey.c_str(), overlayName.c_str(), overlayHandle );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Could not create overlay: " << overlayName qCritical() << "Could not create overlay: " << overlayName << "because "
<< "because " << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) << " " << customErrorMsg;
<< " " << customErrorMsg;
return OverlayError::UndefinedError; return OverlayError::UndefinedError;
} }
return OverlayError::NoError; return OverlayError::NoError;
@@ -30,10 +31,10 @@ OverlayError setOverlayColor( vr::VROverlayHandle_t overlayHandle,
= vr::VROverlay()->SetOverlayColor( overlayHandle, red, green, blue ); = vr::VROverlay()->SetOverlayColor( overlayHandle, red, green, blue );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Error setting Overlay Color For " qCritical() << "Error setting Overlay Color For "
<< getOverlayKey( overlayHandle ) << " with error: " << getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg; << " " << customErrorMsg;
return OverlayError::UndefinedError; return OverlayError::UndefinedError;
} }
return OverlayError::NoError; return OverlayError::NoError;
@@ -47,10 +48,10 @@ OverlayError setOverlayAlpha( vr::VROverlayHandle_t overlayHandle,
= vr::VROverlay()->SetOverlayAlpha( overlayHandle, alpha ); = vr::VROverlay()->SetOverlayAlpha( overlayHandle, alpha );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Error setting Overlay Alpha For " qCritical() << "Error setting Overlay Alpha For "
<< getOverlayKey( overlayHandle ) << " with error: " << getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg; << " " << customErrorMsg;
return OverlayError::UndefinedError; return OverlayError::UndefinedError;
} }
return OverlayError::NoError; return OverlayError::NoError;
@@ -64,10 +65,10 @@ OverlayError setOverlayWidthInMeters( vr::VROverlayHandle_t overlayHandle,
overlayHandle, widthInMeters ); overlayHandle, widthInMeters );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Error setting overlay width For " qCritical() << "Error setting overlay width For "
<< getOverlayKey( overlayHandle ) << " with error: " << getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg; << " " << customErrorMsg;
return OverlayError::UndefinedError; return OverlayError::UndefinedError;
} }
return OverlayError::NoError; return OverlayError::NoError;
@@ -81,18 +82,18 @@ OverlayError setOverlayFromFile( vr::VROverlayHandle_t overlayHandle,
const auto overlayPath = paths::binaryDirectoryFindFile( fileName ); const auto overlayPath = paths::binaryDirectoryFindFile( fileName );
if ( !overlayPath.has_value() ) if ( !overlayPath.has_value() )
{ {
LOG( ERROR ) << "File not Found: " << fileName << customErrorMsg; qCritical() << "File not Found: " << fileName << customErrorMsg;
return OverlayError::UndefinedError; return OverlayError::UndefinedError;
} }
vr::VROverlayError oError = vr::VROverlay()->SetOverlayFromFile( vr::VROverlayError oError = vr::VROverlay()->SetOverlayFromFile(
overlayHandle, overlayPath->c_str() ); overlayHandle, overlayPath->c_str() );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Error setting Overlay from file For " qCritical() << "Error setting Overlay from file For "
<< getOverlayKey( overlayHandle ) << " with error: " << getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( << vr::VROverlay()->GetOverlayErrorNameFromEnum(
oError ) oError )
<< " " << customErrorMsg; << " " << customErrorMsg;
return OverlayError::UndefinedError; return OverlayError::UndefinedError;
} }
return OverlayError::NoError; return OverlayError::NoError;
@@ -105,10 +106,10 @@ OverlayError showOverlay( vr::VROverlayHandle_t overlayHandle,
vr::VROverlayError oError = vr::VROverlay()->ShowOverlay( overlayHandle ); vr::VROverlayError oError = vr::VROverlay()->ShowOverlay( overlayHandle );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Error showing overlay For " qCritical() << "Error showing overlay For "
<< getOverlayKey( overlayHandle ) << " with error: " << getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg; << " " << customErrorMsg;
return OverlayError::UndefinedError; return OverlayError::UndefinedError;
} }
return OverlayError::NoError; return OverlayError::NoError;
@@ -120,10 +121,10 @@ OverlayError hideOverlay( vr::VROverlayHandle_t overlayHandle,
vr::VROverlayError oError = vr::VROverlay()->HideOverlay( overlayHandle ); vr::VROverlayError oError = vr::VROverlay()->HideOverlay( overlayHandle );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Error hiding overlay For " qCritical() << "Error hiding overlay For "
<< getOverlayKey( overlayHandle ) << " with error: " << getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg; << " " << customErrorMsg;
return OverlayError::UndefinedError; return OverlayError::UndefinedError;
} }
return OverlayError::NoError; return OverlayError::NoError;
@@ -139,10 +140,10 @@ OverlayError setOverlayTransformAbsolute(
overlayHandle, trackingOrigin, trackingOriginToOverlayTransform ); overlayHandle, trackingOrigin, trackingOriginToOverlayTransform );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Error setting Overlay Position For " qCritical() << "Error setting Overlay Position For "
<< getOverlayKey( overlayHandle ) << " with error: " << getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg; << " " << customErrorMsg;
return OverlayError::UndefinedError; return OverlayError::UndefinedError;
} }
return OverlayError::NoError; return OverlayError::NoError;
-1
View File
@@ -3,7 +3,6 @@
#include <openvr.h> #include <openvr.h>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <easylogging++.h>
#include <utility> #include <utility>
#include <string> #include <string>
#include "../utils/paths.h" #include "../utils/paths.h"
+5 -3
View File
@@ -1,4 +1,6 @@
#include "ovr_settings_wrapper.h" #include "ovr_settings_wrapper.h"
#include <QtLogging>
#include <QtDebug>
namespace ovr_settings_wrapper namespace ovr_settings_wrapper
{ {
@@ -19,9 +21,9 @@ SettingsError handleErrors( std::string settingsKey,
{ {
return SettingsError::UndefinedError; return SettingsError::UndefinedError;
} }
LOG( ERROR ) << "Could not access \"" << settingsKey << "\" setting: " qCritical() << "Could not access \"" << settingsKey << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( error ) << vr::VRSettings()->GetSettingsErrorNameFromEnum( error )
<< " " << customErrorMsg; << " " << customErrorMsg;
if ( error if ( error
== vr::EVRSettingsError::VRSettingsError_UnsetSettingHasNoDefault ) == vr::EVRSettingsError::VRSettingsError_UnsetSettingHasNoDefault )
{ {
-1
View File
@@ -3,7 +3,6 @@
#include <openvr.h> #include <openvr.h>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <easylogging++.h>
#include <utility> #include <utility>
/* Wrapper For OpenVR's IVR settings class, allows us to do our error logging /* Wrapper For OpenVR's IVR settings class, allows us to do our error logging
+15 -12
View File
@@ -1,4 +1,7 @@
#include "ovr_system_wrapper.h" #include "ovr_system_wrapper.h"
#include <QtLogging>
#include <QtDebug>
#include <vector>
namespace ovr_system_wrapper namespace ovr_system_wrapper
{ {
@@ -8,11 +11,11 @@ SystemError handleTrackedPropertyErrors( vr::TrackedDeviceProperty tdp,
{ {
if ( error != vr::TrackedProp_Success ) if ( error != vr::TrackedProp_Success )
{ {
LOG( ERROR ) << "Could not get Property with error \"" qCritical() << "Could not get Property with error \""
<< vr::VRSystem()->GetPropErrorNameFromEnum( error ) << vr::VRSystem()->GetPropErrorNameFromEnum( error )
<< "\" property: " << "\" property: "
<< "todo" << "todo"
<< " " << customErrorMsg; << " " << customErrorMsg;
if ( tdp == vr::Prop_TrackedDeviceProperty_Max ) if ( tdp == vr::Prop_TrackedDeviceProperty_Max )
{ {
// Just for Error OPPS todo // Just for Error OPPS todo
@@ -295,7 +298,7 @@ std::string getControllerName()
} }
if ( !isLeftCon && !isRightCon && hasHMD ) if ( !isLeftCon && !isRightCon && hasHMD )
{ {
LOG( WARNING ) << "WARNING: No Controllers assuming based on HMD"; qWarning() << "WARNING: No Controllers assuming based on HMD";
auto hmdName auto hmdName
= getStringTrackedProperty( hmdIdx, vr::Prop_ControllerType_String ) = getStringTrackedProperty( hmdIdx, vr::Prop_ControllerType_String )
.second; .second;
@@ -309,27 +312,27 @@ std::string getControllerName()
} }
if ( hmdName == "vive_pro" ) if ( hmdName == "vive_pro" )
{ {
LOG( WARNING ) qWarning()
<< "Vive Pro Detected, Assuming Knuckles this may be wrong"; << "Vive Pro Detected, Assuming Knuckles this may be wrong";
return "knuckles"; return "knuckles";
} }
if ( hmdName == "holographic_hmd" ) if ( hmdName == "holographic_hmd" )
{ {
LOG( WARNING ) << "WMR detected, Assuming HP CONTROLLERS"; qWarning() << "WMR detected, Assuming HP CONTROLLERS";
return "hpmotioncontroller"; return "hpmotioncontroller";
} }
if ( hmdName == "rift" ) if ( hmdName == "rift" )
{ {
return "oculus_touch"; return "oculus_touch";
} }
LOG( WARNING ) << "Headset Not recognized Assuming touch controllers " qWarning() << "Headset Not recognized Assuming touch controllers "
+ hmdName; + hmdName;
return "oculus_touch"; return "oculus_touch";
} }
if ( right != left ) if ( right != left )
{ {
LOG( WARNING ) << "WARNING: Left and Right Controllers are Different, " qWarning() << "WARNING: Left and Right Controllers are Different, "
"Prioritizing right"; "Prioritizing right";
} }
if ( rightIdx == 999 ) if ( rightIdx == 999 )
{ {
+1 -1
View File
@@ -3,9 +3,9 @@
#include <openvr.h> #include <openvr.h>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <easylogging++.h>
#include <utility> #include <utility>
#include <map> #include <map>
#include <vector>
/* Wrapper For OpenVR's IVR settings class, allows us to do our error logging /* Wrapper For OpenVR's IVR settings class, allows us to do our error logging
* while also minimizing code * while also minimizing code
+128 -139
View File
@@ -15,13 +15,19 @@
#include <QCursor> #include <QCursor>
#include <QProcess> #include <QProcess>
#include <QMessageBox> #include <QMessageBox>
#include <QtLogging>
#include <QtDebug>
#include <iostream> #include <iostream>
#include <cmath> #include <cmath>
#include <openvr.h> #include <openvr.h>
#include <easylogging++.h>
#include "utils/Matrix.h" #include "utils/Matrix.h"
#include "keyboard_input/input_sender.h" #include "keyboard_input/input_sender.h"
#include "settings/settings.h" #include "settings/settings.h"
#include <qapplication.h>
#include <qlogging.h>
#include <qnamespace.h>
#include <rhi/qrhi.h>
#include <stdexcept>
// application namespace // application namespace
namespace advsettings namespace advsettings
@@ -60,61 +66,23 @@ OverlayController::OverlayController( bool desktopMode,
// Throw Error If over 16k characters in path string // Throw Error If over 16k characters in path string
if ( !pathIsGood ) if ( !pathIsGood )
{ {
LOG( ERROR ) << "Error Finding VR Runtime Path, Attempting Recovery: "; qCritical() << "Error Finding VR Runtime Path, Attempting Recovery: ";
uint32_t maxLengthRe = requiredLength; uint32_t maxLengthRe = requiredLength;
LOG( INFO ) << "Open VR reporting Required path length of: " qInfo() << "Open VR reporting Required path length of: " << maxLengthRe;
<< maxLengthRe;
} }
m_runtimePathUrl = QUrl::fromLocalFile( tempRuntimePath ); m_runtimePathUrl = QUrl::fromLocalFile( tempRuntimePath );
LOG( INFO ) << "VR Runtime Path: " << m_runtimePathUrl.toLocalFile(); qInfo() << "VR Runtime Path: " << m_runtimePathUrl.toLocalFile();
const double initVol = soundVolume(); const double initVol = soundVolume();
constexpr auto clickSoundURL = "res/sounds/click.wav"; m_activationSoundEffect.setSource( QUrl( "qrc:/sounds/click.wav" ) );
const auto activationSoundFile m_activationSoundEffect.setVolume( initVol );
= paths::binaryDirectoryFindFile( clickSoundURL );
if ( activationSoundFile.has_value() ) m_focusChangedSoundEffect.setSource( QUrl( "qrc:/sounds/focus.wav" ) );
{ m_focusChangedSoundEffect.setVolume( initVol );
m_activationSoundEffect.setSource( QUrl::fromLocalFile(
QString::fromStdString( ( *activationSoundFile ) ) ) );
m_activationSoundEffect.setVolume( initVol );
}
else
{
LOG( ERROR ) << "Could not find activation sound file "
<< clickSoundURL;
}
constexpr auto focusChangedSoundURL = "res/sounds/focus.wav";
const auto focusChangedSoundFile
= paths::binaryDirectoryFindFile( focusChangedSoundURL );
if ( focusChangedSoundFile.has_value() ) m_alarm01SoundEffect.setSource( QUrl( "qrc:/sounds/alarm01.wav" ) );
{ m_alarm01SoundEffect.setVolume( 1.0 );
m_focusChangedSoundEffect.setSource( QUrl::fromLocalFile(
QString::fromStdString( ( *focusChangedSoundFile ) ) ) );
m_focusChangedSoundEffect.setVolume( initVol );
}
else
{
LOG( ERROR ) << "Could not find focus Changed sound file "
<< focusChangedSoundURL;
}
constexpr auto alarmFileName = "res/sounds/alarm01.wav";
const auto alarm01SoundFile
= paths::binaryDirectoryFindFile( alarmFileName );
if ( alarm01SoundFile.has_value() )
{
m_alarm01SoundEffect.setSource( QUrl::fromLocalFile(
QString::fromStdString( ( *alarm01SoundFile ) ) ) );
m_alarm01SoundEffect.setVolume( 1.0 );
}
else
{
LOG( ERROR ) << "Could not find alarm01 sound file " << alarmFileName;
}
// If we have desktop mode flag ignore waht toggle says otherwise we use // If we have desktop mode flag ignore waht toggle says otherwise we use
// toggle // toggle
@@ -123,28 +91,6 @@ OverlayController::OverlayController( bool desktopMode,
m_desktopMode = desktopModeToggle(); m_desktopMode = desktopModeToggle();
} }
QSurfaceFormat format;
// Qt's QOpenGLPaintDevice is not compatible with OpenGL versions >= 3.0
// NVIDIA does not care, but unfortunately AMD does
// Are subtle changes to the semantics of OpenGL functions actually covered
// by the compatibility profile, and this is an AMD bug?
format.setVersion( 2, 1 );
// format.setProfile( QSurfaceFormat::CompatibilityProfile );
format.setDepthBufferSize( 16 );
format.setStencilBufferSize( 8 );
format.setSamples( 16 );
m_openGLContext.setFormat( format );
if ( !m_openGLContext.create() )
{
throw std::runtime_error( "Could not create OpenGL context" );
}
// create an offscreen surface to attach the context and FBO to
m_offscreenSurface.setFormat( m_openGLContext.format() );
m_offscreenSurface.create();
m_openGLContext.makeCurrent( &m_offscreenSurface );
if ( !vr::VROverlay() ) if ( !vr::VROverlay() )
{ {
QMessageBox::critical( QMessageBox::critical(
@@ -344,11 +290,11 @@ OverlayController::OverlayController( bool desktopMode,
} }
else else
{ {
LOG( INFO ) << "Version Check: Feature disabled. Not checking version."; qInfo() << "Version Check: Feature disabled. Not checking version.";
} }
LOG( INFO ) << "OPENSSL VERSION: " qInfo() << "OPENSSL VERSION: "
<< QSslSocket::sslLibraryBuildVersionString(); << QSslSocket::sslLibraryBuildVersionString();
} }
OverlayController::~OverlayController() OverlayController::~OverlayController()
@@ -373,7 +319,7 @@ void OverlayController::exitApp()
Shutdown(); Shutdown();
QApplication::exit(); QApplication::exit();
LOG( INFO ) << "All systems exited."; qInfo() << "All systems exited.";
exit( EXIT_SUCCESS ); exit( EXIT_SUCCESS );
// Does not fallthrough // Does not fallthrough
} }
@@ -403,7 +349,9 @@ void OverlayController::Shutdown()
m_pRenderTimer->stop(); m_pRenderTimer->stop();
m_pRenderTimer.reset(); m_pRenderTimer.reset();
} }
m_pFbo.reset(); m_render_pass_descriptor.reset();
m_render_target.reset();
m_pFBTexture.reset();
} }
void OverlayController::SetWidget( QQuickItem* quickItem, void OverlayController::SetWidget( QQuickItem* quickItem,
@@ -449,14 +397,15 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
} }
else else
{ {
LOG( ERROR ) << "Could not find thumbnail icon \"" qCritical() << "Could not find thumbnail icon \""
<< thumbiconFilename << "\""; << thumbiconFilename << "\"";
} }
// Too many render calls in too short time overwhelm Qt and an // Too many render calls in too short time overwhelm Qt and an
// assertion gets thrown. Therefore we use an timer to delay render // assertion gets thrown. Therefore we use an timer to delay render
// calls // calls
m_pRenderTimer.reset( new QTimer() ); m_pRenderTimer.reset( new QTimer() );
m_pRenderTimer->moveToThread( qApp->thread() );
m_pRenderTimer->setSingleShot( true ); m_pRenderTimer->setSingleShot( true );
m_pRenderTimer->setInterval( 5 ); m_pRenderTimer->setInterval( 5 );
connect( m_pRenderTimer.get(), connect( m_pRenderTimer.get(),
@@ -464,22 +413,38 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
this, this,
SLOT( renderOverlay() ) ); SLOT( renderOverlay() ) );
QOpenGLFramebufferObjectFormat fboFormat; if ( !m_renderControl.initialize() )
fboFormat.setAttachment( throw std::runtime_error( "could not initialize m_renderControl" );
QOpenGLFramebufferObject::CombinedDepthStencil );
fboFormat.setTextureTarget( GL_TEXTURE_2D );
m_pFbo.reset( new QOpenGLFramebufferObject(
static_cast<int>( quickItem->width() ),
static_cast<int>( quickItem->height() ),
fboFormat ) );
m_window.setRenderTarget( m_pFbo.get() ); QRhi* rhi = m_renderControl.rhi();
m_pFBTexture.reset( rhi->newTexture(
QRhiTexture::RGBA8,
quickItem->size().toSize(),
1,
QRhiTexture::RenderTarget | QRhiTexture::UsedAsTransferSource ) );
if ( !m_pFBTexture->create() )
throw std::runtime_error( "RhiTexture not created" );
m_render_target.reset(
rhi->newTextureRenderTarget( { m_pFBTexture.get() } ) );
m_render_pass_descriptor.reset(
m_render_target->newCompatibleRenderPassDescriptor() );
m_render_target->setRenderPassDescriptor(
m_render_pass_descriptor.get() );
if ( !m_render_target->create() )
throw std::runtime_error( "failed to create render target" );
auto qqrt
= QQuickRenderTarget::fromRhiRenderTarget( m_render_target.get() );
m_window.setRenderTarget( qqrt );
quickItem->setParentItem( m_window.contentItem() ); quickItem->setParentItem( m_window.contentItem() );
m_window.setGeometry( 0, m_window.setGeometry( 0,
0, 0,
static_cast<int>( quickItem->width() ), static_cast<int>( quickItem->width() ),
static_cast<int>( quickItem->height() ) ); static_cast<int>( quickItem->height() ) );
m_renderControl.initialize( &m_openGLContext ); m_renderControl.initialize();
vr::HmdVector2_t vecWindowSize vr::HmdVector2_t vecWindowSize
= { static_cast<float>( quickItem->width() ), = { static_cast<float>( quickItem->width() ),
@@ -510,7 +475,7 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
m_steamVRTabController.initStage2( this ); m_steamVRTabController.initStage2( this );
m_chaperoneTabController.initStage2( this ); m_chaperoneTabController.initStage2( this );
m_fixFloorTabController.initStage2( this ); m_fixFloorTabController.initStage2( this );
m_audioTabController.initStage2(); m_audioTabController.initStage2( this );
m_statisticsTabController.initStage2( this ); m_statisticsTabController.initStage2( this );
m_settingsTabController.initStage2( this ); m_settingsTabController.initStage2( this );
m_utilitiesTabController.initStage2( this ); m_utilitiesTabController.initStage2( this );
@@ -526,7 +491,7 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
autoApplyChaperoneName() ); autoApplyChaperoneName() );
if ( chapindex.first ) if ( chapindex.first )
{ {
LOG( INFO ) << "Auto Applying Chaperone"; qInfo() << "Auto Applying Chaperone";
m_chaperoneTabController.applyChaperoneProfile( chapindex.second ); m_chaperoneTabController.applyChaperoneProfile( chapindex.second );
// This should be the way to stop room-setup from starting... as it // This should be the way to stop room-setup from starting... as it
// sends steamvr a signal that it is completed // sends steamvr a signal that it is completed
@@ -534,7 +499,7 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
vr::EChaperoneConfigFile_Live ); vr::EChaperoneConfigFile_Live );
return; return;
} }
LOG( WARNING ) << "Profile Not Found for Auto Apply Chaperone!"; qWarning() << "Profile Not Found for Auto Apply Chaperone!";
} }
} }
@@ -546,6 +511,42 @@ void OverlayController::OnRenderRequest()
} }
} }
vr::ETextureType OverlayController::vrTextureTypeFromRhiBackend()
{
if ( !m_cached_vr_texture_type.has_value() )
{
QRhi* rhi = m_renderControl.rhi();
switch ( rhi->backend() )
{
case QRhi::Vulkan:
m_cached_vr_texture_type = vr::TextureType_Vulkan;
break;
case QRhi::D3D12:
m_cached_vr_texture_type = vr::TextureType_DirectX12;
break;
case QRhi::D3D11:
m_cached_vr_texture_type = vr::TextureType_DirectX;
break;
case QRhi::OpenGLES2:
m_cached_vr_texture_type = vr::TextureType_OpenGL;
break;
case QRhi::Metal:
m_cached_vr_texture_type = vr::TextureType_Metal;
break;
default:
qFatal() << "unknown RHI backend encountered:" << rhi->backend();
throw std::runtime_error( "unsupported RHI backend encountered" );
}
}
return m_cached_vr_texture_type.value();
}
vr::Texture_t OverlayController::vrTextureFromRhiTexture( QRhiTexture& tex )
{
return { reinterpret_cast<void*>( tex.nativeTexture().object ),
vrTextureTypeFromRhiBackend(),
vr::ColorSpace_Auto };
}
void OverlayController::renderOverlay() void OverlayController::renderOverlay()
{ {
if ( !m_desktopMode ) if ( !m_desktopMode )
@@ -557,28 +558,18 @@ void OverlayController::renderOverlay()
m_ulOverlayThumbnailHandle ) ) ) m_ulOverlayThumbnailHandle ) ) )
return; return;
m_renderControl.polishItems(); m_renderControl.polishItems();
m_renderControl.beginFrame();
m_renderControl.sync(); m_renderControl.sync();
m_renderControl.render(); m_renderControl.render();
m_renderControl.endFrame();
GLuint unTexture = m_pFbo->texture(); auto tex = vrTextureFromRhiTexture( *m_pFBTexture );
if ( unTexture != 0 ) vr::VROverlay()->SetOverlayTexture( m_ulOverlayHandle, &tex );
{
#if defined _WIN64 || defined _LP64 /*
// To avoid any compiler warning because of cast to a larger
// pointer type (warning C4312 on VC)
vr::Texture_t texture = { reinterpret_cast<void*>(
static_cast<uint64_t>( unTexture ) ),
vr::TextureType_OpenGL,
vr::ColorSpace_Auto };
#else
vr::Texture_t texture = { reinterpret_cast<void*>( unTexture ),
vr::TextureType_OpenGL,
vr::ColorSpace_Auto };
#endif
vr::VROverlay()->SetOverlayTexture( m_ulOverlayHandle, &texture );
}
m_openGLContext.functions()->glFlush(); // We need to flush otherwise m_openGLContext.functions()->glFlush(); // We need to flush otherwise
// the texture may be empty.*/ // the texture may be empty.
*/
} }
} }
@@ -596,14 +587,14 @@ bool OverlayController::pollNextEvent( vr::VROverlayHandle_t ulOverlayHandle,
} }
} }
QPoint OverlayController::getMousePositionForEvent( vr::VREvent_Mouse_t mouse ) QPointF OverlayController::getMousePositionForEvent( vr::VREvent_Mouse_t mouse )
{ {
float y = mouse.y; float y = mouse.y;
#ifdef __linux__ #ifdef __linux__
float h = static_cast<float>( m_window.height() ); float h = static_cast<float>( m_window.height() );
y = h - y; y = h - y;
#endif #endif
return QPoint( static_cast<int>( mouse.x ), static_cast<int>( y ) ); return { mouse.x, y };
} }
void OverlayController::processMediaKeyBindings() void OverlayController::processMediaKeyBindings()
@@ -988,7 +979,7 @@ QString OverlayController::versionCheckText() const
void OverlayController::setVersionCheckText( QString value, bool notify ) void OverlayController::setVersionCheckText( QString value, bool notify )
{ {
m_versionCheckText = value; m_versionCheckText = value;
LOG( INFO ) << "m_versionCheckText = " << m_versionCheckText; qInfo() << "m_versionCheckText = " << m_versionCheckText;
if ( notify ) if ( notify )
{ {
emit versionCheckTextChanged( m_versionCheckText ); emit versionCheckTextChanged( m_versionCheckText );
@@ -1109,7 +1100,7 @@ void OverlayController::mainEventLoop()
{ {
case vr::VREvent_MouseMove: case vr::VREvent_MouseMove:
{ {
QPoint ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse ); QPointF ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse );
if ( ptNewMouse != m_ptLastMouse ) if ( ptNewMouse != m_ptLastMouse )
{ {
QMouseEvent mouseEvent( QEvent::MouseMove, QMouseEvent mouseEvent( QEvent::MouseMove,
@@ -1117,7 +1108,7 @@ void OverlayController::mainEventLoop()
m_window.mapToGlobal( ptNewMouse ), m_window.mapToGlobal( ptNewMouse ),
Qt::NoButton, Qt::NoButton,
m_lastMouseButtons, m_lastMouseButtons,
nullptr ); Qt::NoModifier );
m_ptLastMouse = ptNewMouse; m_ptLastMouse = ptNewMouse;
QCoreApplication::sendEvent( &m_window, &mouseEvent ); QCoreApplication::sendEvent( &m_window, &mouseEvent );
OnRenderRequest(); OnRenderRequest();
@@ -1127,7 +1118,7 @@ void OverlayController::mainEventLoop()
case vr::VREvent_MouseButtonDown: case vr::VREvent_MouseButtonDown:
{ {
QPoint ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse ); QPointF ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse );
Qt::MouseButton button Qt::MouseButton button
= vrEvent.data.mouse.button == vr::VRMouseButton_Right = vrEvent.data.mouse.button == vr::VRMouseButton_Right
? Qt::RightButton ? Qt::RightButton
@@ -1138,14 +1129,14 @@ void OverlayController::mainEventLoop()
m_window.mapToGlobal( ptNewMouse ), m_window.mapToGlobal( ptNewMouse ),
button, button,
m_lastMouseButtons, m_lastMouseButtons,
nullptr ); Qt::NoModifier );
QCoreApplication::sendEvent( &m_window, &mouseEvent ); QCoreApplication::sendEvent( &m_window, &mouseEvent );
} }
break; break;
case vr::VREvent_MouseButtonUp: case vr::VREvent_MouseButtonUp:
{ {
QPoint ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse ); QPointF ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse );
Qt::MouseButton button Qt::MouseButton button
= vrEvent.data.mouse.button == vr::VRMouseButton_Right = vrEvent.data.mouse.button == vr::VRMouseButton_Right
? Qt::RightButton ? Qt::RightButton
@@ -1156,7 +1147,7 @@ void OverlayController::mainEventLoop()
m_window.mapToGlobal( ptNewMouse ), m_window.mapToGlobal( ptNewMouse ),
button, button,
m_lastMouseButtons, m_lastMouseButtons,
nullptr ); Qt::NoModifier );
QCoreApplication::sendEvent( &m_window, &mouseEvent ); QCoreApplication::sendEvent( &m_window, &mouseEvent );
} }
break; break;
@@ -1172,10 +1163,10 @@ void OverlayController::mainEventLoop()
* ( 360.0f * 8.0f ) ), * ( 360.0f * 8.0f ) ),
static_cast<int>( vrEvent.data.scroll.ydelta static_cast<int>( vrEvent.data.scroll.ydelta
* ( 360.0f * 8.0f ) ) ), * ( 360.0f * 8.0f ) ) ),
0,
Qt::Vertical,
m_lastMouseButtons, m_lastMouseButtons,
nullptr ); Qt::KeyboardModifiers::fromInt( 0 ),
Qt::ScrollPhase::NoScrollPhase,
false );
QCoreApplication::sendEvent( &m_window, &wheelEvent ); QCoreApplication::sendEvent( &m_window, &wheelEvent );
} }
break; break;
@@ -1188,7 +1179,7 @@ void OverlayController::mainEventLoop()
case vr::VREvent_Quit: case vr::VREvent_Quit:
{ {
LOG( INFO ) << "Received quit request."; qInfo() << "Received quit request.";
vr::VRSystem()->AcknowledgeQuit_Exiting(); // Let us buy some vr::VRSystem()->AcknowledgeQuit_Exiting(); // Let us buy some
// time just in case // time just in case
@@ -1200,14 +1191,14 @@ void OverlayController::mainEventLoop()
case vr::VREvent_DashboardActivated: case vr::VREvent_DashboardActivated:
{ {
LOG( DEBUG ) << "Dashboard activated"; qDebug() << "Dashboard activated";
m_dashboardVisible = true; m_dashboardVisible = true;
} }
break; break;
case vr::VREvent_DashboardDeactivated: case vr::VREvent_DashboardDeactivated:
{ {
LOG( DEBUG ) << "Dashboard deactivated"; qDebug() << "Dashboard deactivated";
m_dashboardVisible = false; m_dashboardVisible = false;
settings::saveChangedSettings(); settings::saveChangedSettings();
} }
@@ -1243,9 +1234,8 @@ void OverlayController::mainEventLoop()
= vrEvent.data.chaperone.m_nPreviousUniverse; = vrEvent.data.chaperone.m_nPreviousUniverse;
uint64_t currentUniverseId uint64_t currentUniverseId
= vrEvent.data.chaperone.m_nCurrentUniverse; = vrEvent.data.chaperone.m_nCurrentUniverse;
LOG( INFO ) qInfo() << "(VREvent) ChaperoneUniverseHasChanged... Previous : "
<< "(VREvent) ChaperoneUniverseHasChanged... Previous : " << previousUniverseId << " Current:" << currentUniverseId;
<< previousUniverseId << " Current:" << currentUniverseId;
if ( !chaperoneDataAlreadyUpdated ) if ( !chaperoneDataAlreadyUpdated )
{ {
m_chaperoneUtils.loadChaperoneData(); m_chaperoneUtils.loadChaperoneData();
@@ -1260,7 +1250,7 @@ void OverlayController::mainEventLoop()
break; break;
case vr::VREvent_Input_ActionManifestReloaded: case vr::VREvent_Input_ActionManifestReloaded:
{ {
// LOG( WARNING ) << "Action Manifest Reloaded"; // qWarning() << "Action Manifest Reloaded";
if ( m_steamVRTabController.perAppBindEnabled() ) if ( m_steamVRTabController.perAppBindEnabled() )
{ {
m_steamVRTabController.applyAllCustomBindings(); m_steamVRTabController.applyAllCustomBindings();
@@ -1274,7 +1264,7 @@ void OverlayController::mainEventLoop()
if ( m_incomingReset ) if ( m_incomingReset )
{ {
m_incomingReset = false; m_incomingReset = false;
LOG( INFO ) << "Reset zero event recorded"; qInfo() << "Reset zero event recorded";
m_moveCenterTabController.incomingZeroReset(); m_moveCenterTabController.incomingZeroReset();
} }
@@ -1641,7 +1631,7 @@ void OverlayController::OnNetworkReply( QNetworkReply* reply )
if ( reply->error() == QNetworkReply::NoError ) if ( reply->error() == QNetworkReply::NoError )
{ {
QByteArray replyByteData = reply->readAll(); QByteArray replyByteData = reply->readAll();
LOG( INFO ) << "Version Check: Recieved Data: " << replyByteData; qInfo() << "Version Check: Recieved Data: " << replyByteData;
QJsonParseError parseError; QJsonParseError parseError;
m_remoteVersionJsonDocument m_remoteVersionJsonDocument
= QJsonDocument::fromJson( replyByteData, &parseError ); = QJsonDocument::fromJson( replyByteData, &parseError );
@@ -1684,10 +1674,9 @@ void OverlayController::OnNetworkReply( QNetworkReply* reply )
+ QString::number( m_remoteVersionPatch ) + QString::number( m_remoteVersionPatch )
+ ") available." ); + ") available." );
} }
LOG( INFO ) qInfo() << "Version Check: Newer version ("
<< "Version Check: Newer version (" << m_remoteVersionMajor << m_remoteVersionMajor << "." << m_remoteVersionMinor
<< "." << m_remoteVersionMinor << "." << "." << m_remoteVersionPatch << ") available.";
<< m_remoteVersionPatch << ") available.";
} }
else else
{ {
@@ -1696,22 +1685,22 @@ void OverlayController::OnNetworkReply( QNetworkReply* reply )
setVersionCheckText( m_optionalMessage ); setVersionCheckText( m_optionalMessage );
} }
setNewVersionDetected( false ); setNewVersionDetected( false );
LOG( INFO ) << "Version Check: Installed version is latest " qInfo() << "Version Check: Installed version is latest "
"release."; "release.";
} }
} }
else else
{ {
LOG( ERROR ) qCritical()
<< "Version Check: Error parsing json. QJsonParseError = " << "Version Check: Error parsing json. QJsonParseError = "
<< parseError.error; << parseError.error;
} }
} }
else else
{ {
LOG( ERROR ) << "Version Check: Error connecting to network. " qCritical() << "Version Check: Error connecting to network. "
"QNetworkReply::NetworkError = " "QNetworkReply::NetworkError = "
<< reply->error(); << reply->error();
} }
reply->deleteLater(); reply->deleteLater();
} }
+22 -8
View File
@@ -1,10 +1,10 @@
#pragma once #pragma once
#include <algorithm>
#include <openvr.h> #include <openvr.h>
#include <QtCore/QtCore> #include <QtCore/QtCore>
// because of incompatibilities with QtOpenGL and GLEW we need to cherry pick // because of incompatibilities with QtOpenGL and GLEW we need to cherry pick
// includes // includes
#include <QVector2D>
#include <QMatrix4x4> #include <QMatrix4x4>
#include <QVector> #include <QVector>
#include <QVector2D> #include <QVector2D>
@@ -22,8 +22,10 @@
#include <QNetworkAccessManager> #include <QNetworkAccessManager>
#include <QNetworkReply> #include <QNetworkReply>
#include <QNetworkRequest> #include <QNetworkRequest>
#include <QQuickRenderTarget>
#include <memory> #include <memory>
#include <easylogging++.h> #include <optional>
#include <rhi/qrhi.h>
#include "openvr/openvr_init.h" #include "openvr/openvr_init.h"
@@ -106,18 +108,24 @@ private:
vr::VROverlayHandle_t m_ulOverlayThumbnailHandle vr::VROverlayHandle_t m_ulOverlayThumbnailHandle
= vr::k_ulOverlayHandleInvalid; = vr::k_ulOverlayHandleInvalid;
QQuickRenderControl m_renderControl; std::optional<vr::ETextureType> m_cached_vr_texture_type;
QQuickWindow m_window{ &m_renderControl }; std::unique_ptr<QRhiTexture> m_pFBTexture;
std::unique_ptr<QRhiTextureRenderTarget> m_render_target;
std::unique_ptr<QRhiRenderPassDescriptor> m_render_pass_descriptor;
/*
std::unique_ptr<QOpenGLFramebufferObject> m_pFbo; std::unique_ptr<QOpenGLFramebufferObject> m_pFbo;
QQuickRenderTarget m_pRenderTarget;
QOpenGLContext m_openGLContext; QOpenGLContext m_openGLContext;
QOffscreenSurface m_offscreenSurface; QOffscreenSurface m_offscreenSurface;
*/
QTimer m_pumpEventsTimer; QTimer m_pumpEventsTimer;
std::unique_ptr<QTimer> m_pRenderTimer; std::unique_ptr<QTimer> m_pRenderTimer;
bool m_dashboardVisible = false; bool m_dashboardVisible = false;
QPoint m_ptLastMouse; QPointF m_ptLastMouse;
Qt::MouseButtons m_lastMouseButtons = nullptr; Qt::MouseButtons m_lastMouseButtons;
bool m_desktopMode; bool m_desktopMode;
bool m_noSound; bool m_noSound;
@@ -154,7 +162,11 @@ private:
QJsonDocument m_remoteVersionJsonDocument = QJsonDocument(); QJsonDocument m_remoteVersionJsonDocument = QJsonDocument();
QJsonObject m_remoteVersionJsonObject; QJsonObject m_remoteVersionJsonObject;
public: // I know it's an ugly hack to make them public to enable external public:
QQuickRenderControl m_renderControl;
QQuickWindow m_window{ &m_renderControl };
// I know it's an ugly hack to make them public to enable external
// access, but I am too lazy to implement getters. // access, but I am too lazy to implement getters.
SteamVRTabController m_steamVRTabController; SteamVRTabController m_steamVRTabController;
ChaperoneTabController m_chaperoneTabController; ChaperoneTabController m_chaperoneTabController;
@@ -169,7 +181,7 @@ public: // I know it's an ugly hack to make them public to enable external
bool m_incomingReset = false; bool m_incomingReset = false;
private: private:
QPoint getMousePositionForEvent( vr::VREvent_Mouse_t mouse ); QPointF getMousePositionForEvent( vr::VREvent_Mouse_t mouse );
void processInputBindings(); void processInputBindings();
void processMediaKeyBindings(); void processMediaKeyBindings();
void processMotionBindings(); void processMotionBindings();
@@ -184,6 +196,8 @@ private:
bool m_keyPressTwoState = false; bool m_keyPressTwoState = false;
public: public:
vr::ETextureType vrTextureTypeFromRhiBackend();
vr::Texture_t vrTextureFromRhiTexture( QRhiTexture& tex );
OverlayController( bool desktopMode, bool noSound, QQmlEngine& qmlEngine ); OverlayController( bool desktopMode, bool noSound, QQmlEngine& qmlEngine );
virtual ~OverlayController(); virtual ~OverlayController();
+10 -10
View File
@@ -1,7 +1,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs
import ovras.advsettings 1.0 import ovras.advsettings 1.0
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
import "common" import "common"
@@ -415,43 +415,43 @@ MyStackViewPage {
Connections { Connections {
target: ChaperoneTabController target: ChaperoneTabController
onChaperoneSwitchToBeginnerEnabledChanged: { function onChaperoneSwitchToBeginnerEnabledChanged() {
switchBeginnerToggle.checked = ChaperoneTabController.chaperoneSwitchToBeginnerEnabled switchBeginnerToggle.checked = ChaperoneTabController.chaperoneSwitchToBeginnerEnabled
} }
onChaperoneSwitchToBeginnerDistanceChanged: { function onChaperoneSwitchToBeginnerDistanceChanged() {
var d = ChaperoneTabController.chaperoneSwitchToBeginnerDistance.toFixed(2) var d = ChaperoneTabController.chaperoneSwitchToBeginnerDistance.toFixed(2)
if (d <= switchBeginnerDistanceSlider.to && Math.abs(switchBeginnerDistanceSlider.value - d) > 0.0008) { if (d <= switchBeginnerDistanceSlider.to && Math.abs(switchBeginnerDistanceSlider.value - d) > 0.0008) {
switchBeginnerDistanceSlider.value = d switchBeginnerDistanceSlider.value = d
} }
switchBeginnerDistanceText.text = d switchBeginnerDistanceText.text = d
} }
onChaperoneHapticFeedbackEnabledChanged: { function onChaperoneHapticFeedbackEnabledChanged() {
hapticFeedbackToggle.checked = ChaperoneTabController.chaperoneHapticFeedbackEnabled hapticFeedbackToggle.checked = ChaperoneTabController.chaperoneHapticFeedbackEnabled
} }
onChaperoneHapticFeedbackDistanceChanged: { function onChaperoneHapticFeedbackDistanceChanged() {
var d = ChaperoneTabController.chaperoneHapticFeedbackDistance.toFixed(2) var d = ChaperoneTabController.chaperoneHapticFeedbackDistance.toFixed(2)
if (d <= hapticFeedbackDistanceSlider.to && Math.abs(hapticFeedbackDistanceSlider.value - d) > 0.0008) { if (d <= hapticFeedbackDistanceSlider.to && Math.abs(hapticFeedbackDistanceSlider.value - d) > 0.0008) {
hapticFeedbackDistanceSlider.value = d hapticFeedbackDistanceSlider.value = d
} }
hapticFeedbackDistanceText.text = d hapticFeedbackDistanceText.text = d
} }
onChaperoneAlarmSoundEnabledChanged: { function onChaperoneAlarmSoundEnabledChanged() {
audioWarningToggle.checked = ChaperoneTabController.chaperoneAlarmSoundEnabled audioWarningToggle.checked = ChaperoneTabController.chaperoneAlarmSoundEnabled
} }
onChaperoneAlarmSoundLoopingChanged: { function onChaperoneAlarmSoundLoopingChanged() {
audioWarningLoopingToggle.checked = ChaperoneTabController.chaperoneAlarmSoundLooping audioWarningLoopingToggle.checked = ChaperoneTabController.chaperoneAlarmSoundLooping
} }
onChaperoneAlarmSoundDistanceChanged: { function onChaperoneAlarmSoundDistanceChanged() {
var d = ChaperoneTabController.chaperoneAlarmSoundDistance.toFixed(2) var d = ChaperoneTabController.chaperoneAlarmSoundDistance.toFixed(2)
if (d <= audioWarningDistanceSlider.to && Math.abs(audioWarningDistanceSlider.value - d) > 0.0008) { if (d <= audioWarningDistanceSlider.to && Math.abs(audioWarningDistanceSlider.value - d) > 0.0008) {
audioWarningDistanceSlider.value = d audioWarningDistanceSlider.value = d
} }
audioWarningDistanceText.text = d audioWarningDistanceText.text = d
} }
onChaperoneShowDashboardEnabledChanged: { function onChaperoneShowDashboardEnabledChanged() {
openDashboardToggle.checked = ChaperoneTabController.chaperoneShowDashboardEnabled openDashboardToggle.checked = ChaperoneTabController.chaperoneShowDashboardEnabled
} }
onChaperoneShowDashboardDistanceChanged: { function onChaperoneShowDashboardDistanceChanged() {
var d = ChaperoneTabController.chaperoneShowDashboardDistance.toFixed(2) var d = ChaperoneTabController.chaperoneShowDashboardDistance.toFixed(2)
if (d <= openDashboardDistanceSlider.to && Math.abs(openDashboardDistanceSlider.value - d) > 0.0008) { if (d <= openDashboardDistanceSlider.to && Math.abs(openDashboardDistanceSlider.value - d) > 0.0008) {
openDashboardDistanceSlider.value = d openDashboardDistanceSlider.value = d
+5 -5
View File
@@ -140,7 +140,7 @@ MyStackViewPage {
Connections { Connections {
target: FixFloorTabController target: FixFloorTabController
onStatusMessageSignal: { function onStatusMessageSignal() {
if (statusMessageTimer.running) { if (statusMessageTimer.running) {
statusMessageTimer.stop() statusMessageTimer.stop()
} }
@@ -148,15 +148,15 @@ MyStackViewPage {
statusMessageTimer.interval = FixFloorTabController.currentStatusMessageTimeout() * 1000 statusMessageTimer.interval = FixFloorTabController.currentStatusMessageTimeout() * 1000
statusMessageTimer.start() statusMessageTimer.start()
} }
onMeasureStartSignal: { function onMeasureStartSignal() {
fixButton.enabled = false fixButton.enabled = false
undoFixButton.enabled = false undoFixButton.enabled = false
} }
onMeasureEndSignal: { function onMeasureEndSignal() {
fixButton.enabled = true fixButton.enabled = true
// undoFixButton.enabled = FixFloorTabController.canUndo // undoFixButton.enabled = FixFloorTabController.canUndo
} }
onCanUndoChanged: { function onCanUndoChanged() {
//undoFixButton.enabled = FixFloorTabController.canUndo //undoFixButton.enabled = FixFloorTabController.canUndo
// revert below to this -^ // revert below to this -^
undoFixButton.enabled = false undoFixButton.enabled = false
@@ -165,7 +165,7 @@ MyStackViewPage {
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onTrackingUniverseChanged: { function onTrackingUniverseChanged() {
if (MoveCenterTabController.trackingUniverse === 0) { if (MoveCenterTabController.trackingUniverse === 0) {
fixButton.enabled = false fixButton.enabled = false
recenterButton.enabled = false recenterButton.enabled = false
+10 -10
View File
@@ -524,33 +524,33 @@ MyStackViewPage {
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onOffsetXChanged: { function onOffsetXChanged() {
spaceMoveXText.text = MoveCenterTabController.offsetX.toFixed(2) spaceMoveXText.text = MoveCenterTabController.offsetX.toFixed(2)
} }
onOffsetYChanged: { function onOffsetYChanged() {
spaceMoveYText.text = MoveCenterTabController.offsetY.toFixed(2) spaceMoveYText.text = MoveCenterTabController.offsetY.toFixed(2)
} }
onOffsetZChanged: { function onOffsetZChanged() {
spaceMoveZText.text = MoveCenterTabController.offsetZ.toFixed(2) spaceMoveZText.text = MoveCenterTabController.offsetZ.toFixed(2)
} }
onRotationChanged: { function onRotationChanged() {
spaceRotationSlider.value = ( MoveCenterTabController.rotation / 100 ) spaceRotationSlider.value = ( MoveCenterTabController.rotation / 100 )
} }
onTempRotationChanged: { function onTempRotationChanged() {
var intTempRotation = MoveCenterTabController.tempRotation var intTempRotation = MoveCenterTabController.tempRotation
spaceRotationSlider.value = ( intTempRotation / 100 ) spaceRotationSlider.value = ( intTempRotation / 100 )
spaceRotationText.text = ( intTempRotation / 100 ) + "°" spaceRotationText.text = ( intTempRotation / 100 ) + "°"
} }
onLockXToggleChanged: { function onLockXToggleChanged() {
lockXToggle.checked = MoveCenterTabController.lockXToggle lockXToggle.checked = MoveCenterTabController.lockXToggle
} }
onLockYToggleChanged: { function onLockYToggleChanged() {
lockYToggle.checked = MoveCenterTabController.lockYToggle lockYToggle.checked = MoveCenterTabController.lockYToggle
} }
onLockZToggleChanged: { function onLockZToggleChanged() {
lockZToggle.checked = MoveCenterTabController.lockZToggle lockZToggle.checked = MoveCenterTabController.lockZToggle
} }
onTrackingUniverseChanged: { function onTrackingUniverseChanged() {
if (MoveCenterTabController.trackingUniverse === 0) { if (MoveCenterTabController.trackingUniverse === 0) {
spaceModeText.text = "Sitting" spaceModeText.text = "Sitting"
spaceSeatedRecenter.visible = true spaceSeatedRecenter.visible = true
@@ -560,7 +560,7 @@ MyStackViewPage {
spaceModeText.text = "Unknown(" + MoveCenterTabController.trackingUniverse + ")" spaceModeText.text = "Unknown(" + MoveCenterTabController.trackingUniverse + ")"
} }
} }
onOffsetProfilesUpdated: { function onOffsetProfilesUpdated() {
reloadOffsetProfiles() reloadOffsetProfiles()
} }
} }
+9 -9
View File
@@ -473,7 +473,7 @@ MyStackViewPage {
Connections { Connections {
target: OverlayController target: OverlayController
onNewVersionDetectedChanged: { function onNewVersionDetectedChanged() {
if (OverlayController.newVersionDetected) if (OverlayController.newVersionDetected)
{ {
summaryVersionCheckTextRect.color = "#ff0000" summaryVersionCheckTextRect.color = "#ff0000"
@@ -481,10 +481,10 @@ MyStackViewPage {
summaryVersionCheckTextRect.color = "#2a2e35" summaryVersionCheckTextRect.color = "#2a2e35"
} }
} }
onVersionCheckTextChanged: { function onVersionCheckTextChanged() {
summaryVersionCheckText.text = OverlayController.versionCheckText summaryVersionCheckText.text = OverlayController.versionCheckText
} }
onDisableVersionCheckChanged: { function onDisableVersionCheckChanged() {
if (OverlayController.disableVersionCheck) if (OverlayController.disableVersionCheck)
{ {
summaryVersionCheckText.visible = false summaryVersionCheckText.visible = false
@@ -503,34 +503,34 @@ MyStackViewPage {
Connections { Connections {
target: ChaperoneTabController target: ChaperoneTabController
onChaperoneProfilesUpdated: { function onChaperoneProfilesUpdated() {
reloadChaperoneProfiles() reloadChaperoneProfiles()
} }
} }
Connections { Connections {
target: VideoTabController target: VideoTabController
onVideoProfilesUpdated: { function onVideoProfilesUpdated() {
reloadVideoProfiles() reloadVideoProfiles()
} }
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onMicVolumeChanged: { function onMicVolumeChanged() {
summaryMicVolumeSlider.value = AudioTabController.micVolume summaryMicVolumeSlider.value = AudioTabController.micVolume
} }
onMicMutedChanged: { function onMicMutedChanged() {
summaryMicMuteToggle.checked = AudioTabController.micMuted summaryMicMuteToggle.checked = AudioTabController.micMuted
} }
onPttEnabledChanged: { function onPttEnabledChanged() {
summaryPttToggle.checked = AudioTabController.pttEnabled summaryPttToggle.checked = AudioTabController.pttEnabled
} }
} }
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onTrackingUniverseChanged: { function onTrackingUniverseChanged() {
if (MoveCenterTabController.trackingUniverse === 0) { if (MoveCenterTabController.trackingUniverse === 0) {
summaryPlaySpaceModeText.text = "Sitting" summaryPlaySpaceModeText.text = "Sitting"
} else if (MoveCenterTabController.trackingUniverse === 1) { } else if (MoveCenterTabController.trackingUniverse === 1) {
+15 -15
View File
@@ -338,66 +338,66 @@ MyStackViewPage {
Connections { Connections {
target: SettingsTabController target: SettingsTabController
onAutoStartEnabledChanged: { function onAutoStartEnabledChanged() {
settingsAutoStartToggle.checked = SettingsTabController.autoStartEnabled settingsAutoStartToggle.checked = SettingsTabController.autoStartEnabled
} }
onNativeChaperoneToggleChanged:{ function onNativeChaperoneToggleChanged(){
nativeChaperoneToggleButton.checked = SettingsTabController.nativeChaperoneToggle nativeChaperoneToggleButton.checked = SettingsTabController.nativeChaperoneToggle
} }
onOculusSdkToggleChanged:{ function onOculusSdkToggleChanged(){
oculusSdkToggleButton.checked = SettingsTabController.oculusSdkToggle oculusSdkToggleButton.checked = SettingsTabController.oculusSdkToggle
} }
} }
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onUniverseCenteredRotationChanged: { function onUniverseCenteredRotationChanged() {
universeCenteredRotationToggle.checked = MoveCenterTabController.universeCenteredRotation universeCenteredRotationToggle.checked = MoveCenterTabController.universeCenteredRotation
} }
} }
Connections { Connections {
target: OverlayController target: OverlayController
onVsyncDisabledChanged: { function onVsyncDisabledChanged() {
vsyncDisabledToggle.checked = OverlayController.vsyncDisabled vsyncDisabledToggle.checked = OverlayController.vsyncDisabled
customTickRateText.visible = vsyncDisabledToggle.checked customTickRateText.visible = vsyncDisabledToggle.checked
customTickRateLabel.visible = vsyncDisabledToggle.checked customTickRateLabel.visible = vsyncDisabledToggle.checked
customTickRateMsLabel.visible = vsyncDisabledToggle.checked customTickRateMsLabel.visible = vsyncDisabledToggle.checked
} }
onCrashRecoveryDisabledChanged: { function onCrashRecoveryDisabledChanged() {
disableCrashRecoveryToggle.checked = !OverlayController.crashRecoveryDisabled disableCrashRecoveryToggle.checked = !OverlayController.crashRecoveryDisabled
} }
onCustomTickRateMsChanged: { function onCustomTickRateMsChanged() {
customTickRateText.text = OverlayController.customTickRateMs customTickRateText.text = OverlayController.customTickRateMs
} }
onEnableDebugChanged: { function onEnableDebugChanged() {
debugStateRow.visible = OverlayController.enableDebug debugStateRow.visible = OverlayController.enableDebug
} }
onDebugStateChanged: { function onDebugStateChanged() {
debugStateText.text = OverlayController.debugState debugStateText.text = OverlayController.debugState
} }
onDisableVersionCheckChanged: { function onDisableVersionCheckChanged() {
disableVersionCheckToggle.checked = OverlayController.disableVersionCheck disableVersionCheckToggle.checked = OverlayController.disableVersionCheck
} }
onExclusiveInputEnabledChanged:{ function onExclusiveInputEnabledChanged(){
exclusiveInputToggleButton.checked = OverlayController.exclusiveInputEnabled exclusiveInputToggleButton.checked = OverlayController.exclusiveInputEnabled
} }
onAutoApplyChaperoneEnabledChanged: { function onAutoApplyChaperoneEnabledChanged() {
autoApplyChaperoneToggleButton.checked = OverlayController.autoApplyChaperoneEnabled autoApplyChaperoneToggleButton.checked = OverlayController.autoApplyChaperoneEnabled
} }
onSoundVolumeChanged:{ function onSoundVolumeChanged(){
volumeSlider.value = OverlayController.soundVolume volumeSlider.value = OverlayController.soundVolume
} }
onDesktopModeToggleChanged:{ function onDesktopModeToggleChanged(){
desktopModeToggleButton.checked = OverlayController.desktopModeToggle desktopModeToggleButton.checked = OverlayController.desktopModeToggle
} }
} }
Connections{ Connections{
target: ChaperoneTabController target: ChaperoneTabController
onChaperoneProfilesUpdated: { function onChaperoneProfilesUpdated() {
reloadChaperoneProfiles() reloadChaperoneProfiles()
} }
} }
@@ -44,14 +44,14 @@ RowLayout {
Connections { Connections {
target: AudioTabController target: AudioTabController
onPlaybackDeviceIndexChanged: { function onPlaybackDeviceIndexChanged() {
setShownAudioDevice(index) setShownAudioDevice(index)
} }
onPlaybackDeviceListChanged: { function onPlaybackDeviceListChanged() {
audioPlaybackNameCombo.devices = getAudioDeviceList() audioPlaybackNameCombo.devices = getAudioDeviceList()
setShownAudioDevice(AudioTabController.playbackDeviceIndex) setShownAudioDevice(AudioTabController.playbackDeviceIndex)
} }
onPlaybackOverrideChanged: { function onPlaybackOverrideChanged() {
playbackOverrideToggle.value = AudioTabController.playbackOverride playbackOverrideToggle.value = AudioTabController.playbackOverride
} }
} }
@@ -63,14 +63,14 @@ RowLayout {
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onMicDeviceIndexChanged: { function onMicDeviceIndexChanged() {
setShownAudioDevice(index) setShownAudioDevice(index)
} }
onRecordingDeviceListChanged: { function onRecordingDeviceListChanged() {
devices = getAudioDeviceList() devices = getAudioDeviceList()
setShownAudioDevice(AudioTabController.micDeviceIndex) setShownAudioDevice(AudioTabController.micDeviceIndex)
} }
onRecordingOverrideChanged: { function onRecordingOverrideChanged() {
recordingOverrideToggle.value = AudioTabController.recordingOverride recordingOverrideToggle.value = AudioTabController.recordingOverride
} }
} }
@@ -89,7 +89,7 @@ ColumnLayout {
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onMicDeviceIndexChanged: { function onMicDeviceIndexChanged() {
if (index < 0) { if (index < 0) {
audioMicVolumeMinusButton.enabled = false audioMicVolumeMinusButton.enabled = false
audioMicVolumeSlider.enabled = false audioMicVolumeSlider.enabled = false
@@ -102,16 +102,16 @@ ColumnLayout {
audioMicMuteToggle.enabled = true audioMicMuteToggle.enabled = true
} }
} }
onMicVolumeChanged: { function onMicVolumeChanged() {
audioMicVolumeSlider.value = AudioTabController.micVolume audioMicVolumeSlider.value = AudioTabController.micVolume
} }
onMicMutedChanged: { function onMicMutedChanged() {
audioMicMuteToggle.checked = AudioTabController.micMuted audioMicMuteToggle.checked = AudioTabController.micMuted
} }
onPlaybackDeviceListChanged: { function onPlaybackDeviceListChanged() {
} }
onRecordingDeviceListChanged: { function onRecordingDeviceListChanged() {
if (AudioTabController.micDeviceIndex < 0) { if (AudioTabController.micDeviceIndex < 0) {
audioMicVolumeMinusButton.enabled = false audioMicVolumeMinusButton.enabled = false
audioMicVolumeSlider.enabled = false audioMicVolumeSlider.enabled = false
@@ -41,10 +41,10 @@ RowLayout {
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onMirrorDeviceIndexChanged: { function onMirrorDeviceIndexChanged() {
setShownAudioDevice(index) setShownAudioDevice(index)
} }
onPlaybackDeviceListChanged: { function onPlaybackDeviceListChanged() {
audioMirrorNameCombo.devices = getAudioDeviceList() audioMirrorNameCombo.devices = getAudioDeviceList()
setShownAudioDevice(AudioTabController.mirrorDeviceIndex) setShownAudioDevice(AudioTabController.mirrorDeviceIndex)
} }
@@ -89,7 +89,7 @@ ColumnLayout {
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onMirrorDeviceIndexChanged: { function onMirrorDeviceIndexChanged() {
if (index < 0) { if (index < 0) {
audioMirrorNameCombo.deviceIndex = 0 audioMirrorNameCombo.deviceIndex = 0
audioMirrorVolumeMinusButton.enabled = false audioMirrorVolumeMinusButton.enabled = false
@@ -104,13 +104,13 @@ ColumnLayout {
audioMirrorNameCombo.deviceIndex = index + 1 audioMirrorNameCombo.deviceIndex = index + 1
} }
} }
onMirrorVolumeChanged: { function onMirrorVolumeChanged() {
audioMirrorVolumeSlider.value = AudioTabController.mirrorVolume audioMirrorVolumeSlider.value = AudioTabController.mirrorVolume
} }
onMirrorMutedChanged: { function onMirrorMutedChanged() {
audioMirrorMuteToggle.checked = AudioTabController.mirrorMuted audioMirrorMuteToggle.checked = AudioTabController.mirrorMuted
} }
onPlaybackDeviceListChanged: { function onPlaybackDeviceListChanged() {
if (AudioTabController.mirrorDeviceIndex < 0) { if (AudioTabController.mirrorDeviceIndex < 0) {
audioMirrorVolumeMinusButton.enabled = false audioMirrorVolumeMinusButton.enabled = false
audioMirrorVolumeSlider.enabled = false audioMirrorVolumeSlider.enabled = false
@@ -98,13 +98,13 @@ ColumnLayout {
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onAudioProfilesUpdated: { function onAudioProfilesUpdated() {
reloadAudioProfiles() reloadAudioProfiles()
} }
onAudioProfileAdded: { function onAudioProfileAdded() {
audioProfileComboBox.currentIndex = AudioTabController.getAudioProfileCount() audioProfileComboBox.currentIndex = AudioTabController.getAudioProfileCount()
} }
onDefaultProfileDisplay: { function onDefaultProfileDisplay() {
audioProfileComboBox.currentIndex = AudioTabController.getDefaultAudioProfileIndex( audioProfileComboBox.currentIndex = AudioTabController.getDefaultAudioProfileIndex(
) + 1 ) + 1
} }
@@ -21,7 +21,7 @@ MyToggleButton {
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onMicProximitySensorCanMuteChanged: { function onMicProximitySensorCanMuteChanged() {
audioMuteProximitySensorToggle.checked = AudioTabController.micProximitySensorCanMute audioMuteProximitySensorToggle.checked = AudioTabController.micProximitySensorCanMute
} }
} }
@@ -39,13 +39,13 @@ ColumnLayout {
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onPttEnabledChanged: { function onPttEnabledChanged() {
audioPttEnabledToggle.checked = AudioTabController.pttEnabled audioPttEnabledToggle.checked = AudioTabController.pttEnabled
} }
onMicReversePttChanged: { function onMicReversePttChanged() {
audioPttReverseToggle.checked = AudioTabController.micReversePtt audioPttReverseToggle.checked = AudioTabController.micReversePtt
} }
onPttShowNotificationChanged: { function onPttShowNotificationChanged() {
audioPttShowNotificationToggle.checked = AudioTabController.pttShowNotification audioPttShowNotificationToggle.checked = AudioTabController.pttShowNotification
} }
} }
+9 -9
View File
@@ -1,7 +1,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs
import ovras.advsettings 1.0 import ovras.advsettings 1.0
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
import "../common" import "../common"
@@ -586,26 +586,26 @@ MyStackViewPage {
Connections { Connections {
target: ChaperoneTabController target: ChaperoneTabController
onBoundsVisibilityChanged: { function onBoundsVisibilityChanged() {
if (Math.abs(chaperoneVisibilitySlider.value - ChaperoneTabController.boundsVisibility) > 0.008) { if (Math.abs(chaperoneVisibilitySlider.value - ChaperoneTabController.boundsVisibility) > 0.008) {
chaperoneVisibilitySlider.value = ChaperoneTabController.boundsVisibility chaperoneVisibilitySlider.value = ChaperoneTabController.boundsVisibility
} }
} }
onFadeDistanceChanged: { function onFadeDistanceChanged() {
var d = ChaperoneTabController.fadeDistance.toFixed(1) var d = ChaperoneTabController.fadeDistance.toFixed(1)
if (d <= chaperoneFadeDistanceSlider.to && Math.abs(chaperoneFadeDistanceSlider.value - d) > 0.008) { if (d <= chaperoneFadeDistanceSlider.to && Math.abs(chaperoneFadeDistanceSlider.value - d) > 0.008) {
chaperoneFadeDistanceSlider.value = d chaperoneFadeDistanceSlider.value = d
} }
chaperoneFadeDistanceText.text = d chaperoneFadeDistanceText.text = d
} }
onHeightChanged: { function onHeightChanged() {
var h = ChaperoneTabController.height.toFixed(2) var h = ChaperoneTabController.height.toFixed(2)
if (h <= chaperoneHeightSlider.to && Math.abs(chaperoneHeightSlider.value - h) > 0.008) { if (h <= chaperoneHeightSlider.to && Math.abs(chaperoneHeightSlider.value - h) > 0.008) {
chaperoneHeightSlider.value = h chaperoneHeightSlider.value = h
} }
chaperoneHeightText.text = h chaperoneHeightText.text = h
} }
onChaperoneDimHeightChanged: { function onChaperoneDimHeightChanged() {
var dim = ChaperoneTabController.chaperoneDimHeight var dim = ChaperoneTabController.chaperoneDimHeight
if(dim > 0.0){ if(dim > 0.0){
chaperoneDisableChaperone.enabled = false; chaperoneDisableChaperone.enabled = false;
@@ -625,16 +625,16 @@ MyStackViewPage {
chaperoneFadeDistanceText.enabled = true; chaperoneFadeDistanceText.enabled = true;
} }
} }
onCenterMarkerNewChanged: { function onCenterMarkerNewChanged() {
chaperoneCenterMarkerToggle.checked = ChaperoneTabController.centerMarkerNew chaperoneCenterMarkerToggle.checked = ChaperoneTabController.centerMarkerNew
} }
onPlaySpaceMarkerChanged: { function onPlaySpaceMarkerChanged() {
chaperonePlaySpaceToggle.checked = ChaperoneTabController.playSpaceMarker chaperonePlaySpaceToggle.checked = ChaperoneTabController.playSpaceMarker
} }
onForceBoundsChanged: { function onForceBoundsChanged() {
chaperoneForceBoundsToggle.checked = ChaperoneTabController.forceBounds chaperoneForceBoundsToggle.checked = ChaperoneTabController.forceBounds
} }
onChaperoneProfilesUpdated: { function onChaperoneProfilesUpdated() {
reloadChaperoneProfiles() reloadChaperoneProfiles()
} }
} }
@@ -1,7 +1,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs
import ovras.advsettings 1.0 import ovras.advsettings 1.0
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
import "../../common" import "../../common"
@@ -113,7 +113,7 @@ MyStackViewPage {
Connections { Connections {
target: ChaperoneTabController target: ChaperoneTabController
onChaperoneDimHeightChanged: { function onChaperoneDimHeightChanged() {
var d = ChaperoneTabController.chaperoneDimHeight.toFixed(2) var d = ChaperoneTabController.chaperoneDimHeight.toFixed(2)
if (d <= dimHeightSlider.to && Math.abs(dimHeightSlider.value - d) > 0.0008) { if (d <= dimHeightSlider.to && Math.abs(dimHeightSlider.value - d) > 0.0008) {
dimHeightSlider.value = d dimHeightSlider.value = d
@@ -180,17 +180,17 @@ GroupBox {
Connections { Connections {
target: ChaperoneTabController target: ChaperoneTabController
onChaperoneColorRChanged:{ function onChaperoneColorRChanged(){
var redValue = ChaperoneTabController.chaperoneColorR var redValue = ChaperoneTabController.chaperoneColorR
colorRedText.text = redValue colorRedText.text = redValue
chaperoneColorRedSlider.value = redValue chaperoneColorRedSlider.value = redValue
} }
onChaperoneColorGChanged:{ function onChaperoneColorGChanged(){
var greenValue = ChaperoneTabController.chaperoneColorG var greenValue = ChaperoneTabController.chaperoneColorG
colorGreenText.text = greenValue colorGreenText.text = greenValue
chaperoneColorGreenSlider.value = greenValue chaperoneColorGreenSlider.value = greenValue
} }
onChaperoneColorBChanged:{ function onChaperoneColorBChanged(){
var blueValue = ChaperoneTabController.chaperoneColorB var blueValue = ChaperoneTabController.chaperoneColorB
colorBlueText.text = blueValue colorBlueText.text = blueValue
chaperoneColorBlueSlider.value = blueValue chaperoneColorBlueSlider.value = blueValue
@@ -70,10 +70,10 @@ GroupBox {
Connections { Connections {
target: ChaperoneTabController target: ChaperoneTabController
onChaperoneFloorToggleChanged:{ function onChaperoneFloorToggleChanged(){
chaperoneFloorToggleBtn.checked = ChaperoneTabController.chaperoneFloorToggle chaperoneFloorToggleBtn.checked = ChaperoneTabController.chaperoneFloorToggle
} }
onCenterMarkerChanged:{ function onCenterMarkerChanged(){
legacyCenterMarkerbtn.checked = ChaperoneTabController.centerMarker legacyCenterMarkerbtn.checked = ChaperoneTabController.centerMarker
} }
} }
@@ -112,7 +112,7 @@ GroupBox {
Connections { Connections {
target: ChaperoneTabController target: ChaperoneTabController
onCollisionBoundStyleChanged:{ function onCollisionBoundStyleChanged(){
var collisiontype = ChaperoneTabController.collisionBoundStyle var collisiontype = ChaperoneTabController.collisionBoundStyle
switch(collisiontype){ switch(collisiontype){
case 0: denseRadio.checked = true; break; case 0: denseRadio.checked = true; break;
+1 -1
View File
@@ -39,7 +39,7 @@ TextField {
} }
Connections { Connections {
target: OverlayController target: OverlayController
onKeyBoardInputSignal: { function onKeyBoardInputSignal() {
if (userValue == keyBoardUID) { if (userValue == keyBoardUID) {
if (myTextField.text !== input) { if (myTextField.text !== input) {
myTextField.onInputEvent(input) myTextField.onInputEvent(input)
@@ -218,19 +218,19 @@ GroupBox {
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onGravityActiveChanged: { function onGravityActiveChanged() {
gravityToggleButton.checked = MoveCenterTabController.gravityActive gravityToggleButton.checked = MoveCenterTabController.gravityActive
} }
onGravityStrengthChanged: { function onGravityStrengthChanged() {
gravityStrengthText.text = MoveCenterTabController.gravityStrength.toFixed(2) gravityStrengthText.text = MoveCenterTabController.gravityStrength.toFixed(2)
} }
onMomentumSaveChanged: { function onMomentumSaveChanged() {
momentumToggleButton.checked = MoveCenterTabController.momentumSave momentumToggleButton.checked = MoveCenterTabController.momentumSave
} }
onFlingStrengthChanged: { function onFlingStrengthChanged() {
flingStrengthText.text = MoveCenterTabController.flingStrength.toFixed(2) flingStrengthText.text = MoveCenterTabController.flingStrength.toFixed(2)
} }
onFrictionPercentChanged: { function onFrictionPercentChanged() {
frictionPercentText.text = MoveCenterTabController.frictionPercent + "%" frictionPercentText.text = MoveCenterTabController.frictionPercent + "%"
} }
} }
@@ -88,10 +88,10 @@ GroupBox {
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onHeightToggleChanged: { function onHeightToggleChanged() {
heightToggleButton.checked = MoveCenterTabController.heightToggle heightToggleButton.checked = MoveCenterTabController.heightToggle
} }
onHeightToggleOffsetChanged: { function onHeightToggleOffsetChanged() {
heightToggleOffsetText.text = MoveCenterTabController.heightToggleOffset.toFixed(2) heightToggleOffsetText.text = MoveCenterTabController.heightToggleOffset.toFixed(2)
} }
} }
@@ -156,19 +156,19 @@ GroupBox {
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onMoveShortcutLeftChanged: { function onMoveShortcutLeftChanged() {
moveShortcutLeft.checked = MoveCenterTabController.moveShortcutLeft moveShortcutLeft.checked = MoveCenterTabController.moveShortcutLeft
} }
onMoveShortcutRightChanged: { function onMoveShortcutRightChanged() {
moveShortcutRight.checked = MoveCenterTabController.moveShortcutRight moveShortcutRight.checked = MoveCenterTabController.moveShortcutRight
} }
onDragComfortFactorChanged: { function onDragComfortFactorChanged() {
dragComfortSlider.value = MoveCenterTabController.dragComfortFactor dragComfortSlider.value = MoveCenterTabController.dragComfortFactor
} }
onDragBoundsChanged: { function onDragBoundsChanged() {
dragBounds.checked = MoveCenterTabController.dragBounds dragBounds.checked = MoveCenterTabController.dragBounds
} }
onDragMultChanged: { function onDragMultChanged() {
dragMultText.text = MoveCenterTabController.dragMult.toFixed(2) dragMultText.text = MoveCenterTabController.dragMult.toFixed(2)
} }
} }
@@ -312,23 +312,23 @@ GroupBox {
Connections { Connections {
target: RotationTabController target: RotationTabController
onAutoTurnEnabledChanged: { function onAutoTurnEnabledChanged() {
autoTurn.checked = RotationTabController.autoTurnEnabled autoTurn.checked = RotationTabController.autoTurnEnabled
} }
onAutoTurnActivationDistanceChanged: { function onAutoTurnActivationDistanceChanged() {
activationSlider.value = RotationTabController.autoTurnActivationDistance.toFixed(2) activationSlider.value = RotationTabController.autoTurnActivationDistance.toFixed(2)
} }
onAutoTurnDeactivationDistanceChanged:{ function onAutoTurnDeactivationDistanceChanged(){
deactivationSlider.value = RotationTabController.autoTurnDeactivationDistance.toFixed(2) deactivationSlider.value = RotationTabController.autoTurnDeactivationDistance.toFixed(2)
} }
onAutoTurnUseCornerAngleChanged:{ function onAutoTurnUseCornerAngleChanged(){
cornerAngle.checked = RotationTabController.autoTurnUseCornerAngle cornerAngle.checked = RotationTabController.autoTurnUseCornerAngle
} }
onAutoTurnSpeedChanged:{ function onAutoTurnSpeedChanged(){
var val = RotationTabController.autoTurnSpeed var val = RotationTabController.autoTurnSpeed
speedSlider.value = ((val/100).toFixed()) speedSlider.value = ((val/100).toFixed())
} }
onAutoTurnModeChanged:{ function onAutoTurnModeChanged(){
if(RotationTabController.autoTurnMode === 1){ if(RotationTabController.autoTurnMode === 1){
autoTurnModeToggle.checked = true; autoTurnModeToggle.checked = true;
@@ -338,13 +338,13 @@ GroupBox {
autoTurnModeToggle.checked = false; autoTurnModeToggle.checked = false;
} }
} }
onMinCordTangleChanged:{ function onMinCordTangleChanged(){
detangleAngleStartText.text = parseInt(RotationTabController.minCordTangle*(180/Math.PI))+ "°" detangleAngleStartText.text = parseInt(RotationTabController.minCordTangle*(180/Math.PI))+ "°"
} }
onCordDetangleAngleChanged:{ function onCordDetangleAngleChanged(){
detangleAngleAssistText.text = parseInt(RotationTabController.cordDetangleAngle*(180/Math.PI))+ "°" detangleAngleAssistText.text = parseInt(RotationTabController.cordDetangleAngle*(180/Math.PI))+ "°"
} }
onAutoTurnShowNotificationChanged:{ function onAutoTurnShowNotificationChanged(){
autoTurnNotificationToggle.checked = RotationTabController.autoTurnShowNotification autoTurnNotificationToggle.checked = RotationTabController.autoTurnShowNotification
} }
} }
@@ -115,10 +115,10 @@ GroupBox {
Connections { Connections {
target: RotationTabController target: RotationTabController
onVestibularMotionEnabledChanged:{ function onVestibularMotionEnabledChanged(){
redirectedModeToggle.checked = RotationTabController.vestibularMotionEnabled redirectedModeToggle.checked = RotationTabController.vestibularMotionEnabled
} }
onVestibularMotionRadiusChanged:{ function onVestibularMotionRadiusChanged(){
redirectedWalkingRadiusText.text = ((RotationTabController.vestibularMotionRadius).toFixed(2)) redirectedWalkingRadiusText.text = ((RotationTabController.vestibularMotionRadius).toFixed(2))
} }
} }
@@ -103,10 +103,10 @@ GroupBox {
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onSnapTurnAngleChanged: { function onSnapTurnAngleChanged() {
snapTurnAngleText.text = ( Math.round( MoveCenterTabController.snapTurnAngle / 100 ) ) + "°" snapTurnAngleText.text = ( Math.round( MoveCenterTabController.snapTurnAngle / 100 ) ) + "°"
} }
onSmoothTurnRateChanged: { function onSmoothTurnRateChanged() {
smoothTurnRateText.text = MoveCenterTabController.smoothTurnRate + "%" smoothTurnRateText.text = MoveCenterTabController.smoothTurnRate + "%"
} }
} }
@@ -100,16 +100,16 @@ GroupBox {
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onTurnBindLeftChanged: { function onTurnBindLeftChanged() {
turnBindLeft.checked = MoveCenterTabController.turnBindLeft turnBindLeft.checked = MoveCenterTabController.turnBindLeft
} }
onTurnBindRightChanged: { function onTurnBindRightChanged() {
turnBindRight.checked = MoveCenterTabController.turnBindRight turnBindRight.checked = MoveCenterTabController.turnBindRight
} }
onTurnComfortFactorChanged: { function onTurnComfortFactorChanged() {
turnComfortSlider.value = MoveCenterTabController.turnComfortFactor turnComfortSlider.value = MoveCenterTabController.turnComfortFactor
} }
onTurnBoundsChanged: { function onTurnBoundsChanged() {
turnBounds.checked = MoveCenterTabController.turnBounds turnBounds.checked = MoveCenterTabController.turnBounds
} }
} }
@@ -76,10 +76,10 @@ GroupBox {
Connections { Connections {
target: RotationTabController target: RotationTabController
onViewRatchettingEnabledChanged:{ function onViewRatchettingEnabledChanged(){
viewRatchetToggleBtn.checked = RotationTabController.viewRatchettingEnabled viewRatchetToggleBtn.checked = RotationTabController.viewRatchettingEnabled
} }
onViewRatchettingPercentChanged:{ function onViewRatchettingPercentChanged(){
var ratchetPercVal = RotationTabController.viewRatchettingPercent var ratchetPercVal = RotationTabController.viewRatchettingPercent
viewRatchetSlider.value = ratchetPercVal viewRatchetSlider.value = ratchetPercVal
viewRatchetText.text = ratchetPercVal.toFixed(2) viewRatchetText.text = ratchetPercVal.toFixed(2)
@@ -92,13 +92,13 @@ GroupBox {
Connections { Connections {
target: SteamVRTabController target: SteamVRTabController
onCameraActiveChanged: { function onCameraActiveChanged() {
steamvrCameraActiveToggle.checked = SteamVRTabController.cameraActive steamvrCameraActiveToggle.checked = SteamVRTabController.cameraActive
} }
onCameraContChanged: { function onCameraContChanged() {
steamvrCameraContToggle.checked = SteamVRTabController.cameraCont steamvrCameraContToggle.checked = SteamVRTabController.cameraCont
} }
onCameraBoundsChanged: { function onCameraBoundsChanged() {
steamvrCameraBoundsToggle.checked = SteamVRTabController.cameraBounds steamvrCameraBoundsToggle.checked = SteamVRTabController.cameraBounds
} }
@@ -2,7 +2,7 @@ import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Controls 2.5 import QtQuick.Controls 2.5
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs
import ovras.advsettings 1.0 import ovras.advsettings 1.0
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
import "../../common" import "../../common"
@@ -185,11 +185,11 @@ MyStackViewPage {
} }
Connections{ Connections{
target: SteamVRTabController target: SteamVRTabController
onPairStatusChanged: { function onPairStatusChanged() {
statusText.text = value; statusText.text = value;
getRXTX() getRXTX()
} }
onUpdateRXTX:{ function onUpdateRXTX(){
getRXTX() getRXTX()
} }
@@ -130,7 +130,7 @@ GroupBox {
Connections { Connections {
target: SteamVRTabController target: SteamVRTabController
onPerformanceGraphChanged:{ function onPerformanceGraphChanged() {
steamvrBindingToggle.checked = SteamVRTabController.perAppBindEnabled steamvrBindingToggle.checked = SteamVRTabController.perAppBindEnabled
} }
@@ -131,25 +131,25 @@ GroupBox {
Connections { Connections {
target: SteamVRTabController target: SteamVRTabController
onPerformanceGraphChanged:{ function onPerformanceGraphChanged(){
steamvrPerformanceGraphToggle.checked = SteamVRTabController.performanceGraph steamvrPerformanceGraphToggle.checked = SteamVRTabController.performanceGraph
} }
onSystemButtonChanged:{ function onSystemButtonChanged(){
steamvrSystemButtonToggle.checked = SteamVRTabController.systemButton steamvrSystemButtonToggle.checked = SteamVRTabController.systemButton
} }
onMultipleDriverChanged:{ function onMultipleDriverChanged(){
steamvrMultipleDriverToggle.checked = SteamVRTabController.multipleDriver steamvrMultipleDriverToggle.checked = SteamVRTabController.multipleDriver
} }
onNoFadeToGridChanged:{ function onNoFadeToGridChanged(){
steamvrNoFadeToGridToggle.checked = SteamVRTabController.noFadeToGrid steamvrNoFadeToGridToggle.checked = SteamVRTabController.noFadeToGrid
} }
onDNDChanged:{ function onDNDChanged(){
steamvrNotificationToggle.checked = SteamVRTabController.dnd steamvrNotificationToggle.checked = SteamVRTabController.dnd
} }
onNoHMDChanged:{ function onNoHMDChanged(){
steamvrNoHMDToggle.checked = SteamVRTabController.noHMD steamvrNoHMDToggle.checked = SteamVRTabController.noHMD
} }
onControllerPowerChanged:{ function onControllerPowerChanged(){
steamvrControllerPowerToggle.checked = SteamVRTabController.controllerPower steamvrControllerPowerToggle.checked = SteamVRTabController.controllerPower
} }
@@ -103,10 +103,10 @@ GroupBox {
} }
Connections { Connections {
target: VrAlarm target: VrAlarm
onAlarmEnabledChanged: { function onAlarmEnabledChanged() {
alarmClockToggle.checked = VrAlarm.alarmEnabled alarmClockToggle.checked = VrAlarm.alarmEnabled
} }
onAlarmTimeChanged: { function onAlarmTimeChanged() {
alarmClockTimeAssembly.changeTimer(VrAlarm.getAlarmHour(), alarmClockTimeAssembly.changeTimer(VrAlarm.getAlarmHour(),
VrAlarm.getAlarmMinute(), VrAlarm.getAlarmMinute(),
VrAlarm.getAlarmSecond()) VrAlarm.getAlarmSecond())
@@ -45,7 +45,7 @@ GroupBox {
} }
Connections { Connections {
target: OverlayController target: OverlayController
onKeyBoardInputSignal: { function onKeyBoardInputSignal() {
if (userValue == 601) { if (userValue == 601) {
UtilitiesTabController.sendKeyboardInput(input) UtilitiesTabController.sendKeyboardInput(input)
} }
@@ -581,7 +581,7 @@ GroupBox {
} }
Connections { Connections {
target: UtilitiesTabController target: UtilitiesTabController
onVrcDebugChanged: { function onVrcDebugChanged() {
vrcDebugRow.visible = UtilitiesTabController.vrcDebug vrcDebugRow.visible = UtilitiesTabController.vrcDebug
} }
} }
+1 -1
View File
@@ -53,7 +53,7 @@ GroupBox {
Connections { Connections {
target: UtilitiesTabController target: UtilitiesTabController
onTrackerOvlEnabledChanged:{ function onTrackerOvlEnabledChanged(){
trackerOvlToggle.checked = UtilitiesTabController.trackerOvlEnabled trackerOvlToggle.checked = UtilitiesTabController.trackerOvlEnabled
} }
+1 -1
View File
@@ -47,7 +47,7 @@ MyStackViewPage {
Connections { Connections {
target: VideoTabController target: VideoTabController
onIsOverlayMethodActiveChanged:{ function onIsOverlayMethodActiveChanged(){
overlayMethodGroupBox.visible = VideoTabController.isOverlayMethodActive overlayMethodGroupBox.visible = VideoTabController.isOverlayMethodActive
brightnessGroupBox.visible = !(VideoTabController.isOverlayMethodActive); brightnessGroupBox.visible = !(VideoTabController.isOverlayMethodActive);
colorGroupBox.visible = !(VideoTabController.isOverlayMethodActive); colorGroupBox.visible = !(VideoTabController.isOverlayMethodActive);
@@ -95,12 +95,12 @@ GroupBox {
Connections { Connections {
target: VideoTabController target: VideoTabController
onBrightnessOpacityValueChanged: { function onBrightnessOpacityValueChanged() {
var brightvalue = VideoTabController.brightnessOpacityValue var brightvalue = VideoTabController.brightnessOpacityValue
brightnessSlider.value = brightvalue brightnessSlider.value = brightvalue
brightnessValueText.text = Math.round(brightvalue*100)+ "%" brightnessValueText.text = Math.round(brightvalue*100)+ "%"
} }
onBrightnessEnabledChanged: { function onBrightnessEnabledChanged() {
brightnessToggle.checked = VideoTabController.brightnessEnabled brightnessToggle.checked = VideoTabController.brightnessEnabled
} }
} }
@@ -197,17 +197,17 @@ GroupBox {
Connections { Connections {
target: VideoTabController target: VideoTabController
onColorRedChanged:{ function onColorRedChanged(){
var redValue = VideoTabController.colorRed var redValue = VideoTabController.colorRed
colorRedText.text = Math.round(redValue * 100) + "%" colorRedText.text = Math.round(redValue * 100) + "%"
colorRedSlider.value = redValue colorRedSlider.value = redValue
} }
onColorGreenChanged:{ function onColorGreenChanged(){
var greenValue = VideoTabController.colorGreen var greenValue = VideoTabController.colorGreen
colorGreenText.text = Math.round(greenValue * 100) + "%" colorGreenText.text = Math.round(greenValue * 100) + "%"
colorGreenSlider.value = greenValue colorGreenSlider.value = greenValue
} }
onColorBlueChanged:{ function onColorBlueChanged(){
var blueValue = VideoTabController.colorBlue var blueValue = VideoTabController.colorBlue
colorBlueText.text = Math.round(blueValue * 100) + "%" colorBlueText.text = Math.round(blueValue * 100) + "%"
colorBlueSlider.value = blueValue colorBlueSlider.value = blueValue
@@ -73,14 +73,14 @@ GroupBox {
Connections { Connections {
target: VideoTabController target: VideoTabController
onAllowSupersampleFilteringChanged: { function onAllowSupersampleFilteringChanged() {
videoAllowSupersampleFilteringToggle.checked = VideoTabController.allowSupersampleFiltering videoAllowSupersampleFilteringToggle.checked = VideoTabController.allowSupersampleFiltering
} }
onMotionSmoothingChanged: { function onMotionSmoothingChanged() {
videoMotionSmoothingToggle.checked = VideoTabController.motionSmoothing videoMotionSmoothingToggle.checked = VideoTabController.motionSmoothing
} }
onIsOverlayMethodActiveChanged:{ function onIsOverlayMethodActiveChanged(){
videoUseOverlayToggle.checked = VideoTabController.isOverlayMethodActive videoUseOverlayToggle.checked = VideoTabController.isOverlayMethodActive
} }
@@ -298,32 +298,33 @@ GroupBox {
Connections { Connections {
target: VideoTabController target: VideoTabController
onBrightnessOpacityValueChanged: { function onBrightnessOpacityValueChanged() {
var brightvalue = VideoTabController.brightnessOpacityValue var brightvalue = VideoTabController.brightnessOpacityValue
brightnessSlider.value = brightvalue brightnessSlider.value = brightvalue
brightnessValueText.text = Math.round(brightvalue*100)+ "%" brightnessValueText.text = Math.round(brightvalue*100)+ "%"
brightnessSlider.value = VideoTabController.brightnessOpacityValue
} }
onBrightnessEnabledChanged: { function onBrightnessEnabledChanged() {
brightnessToggle.checked = VideoTabController.brightnessEnabled brightnessToggle.checked = VideoTabController.brightnessEnabled
} }
onColorOverlayOpacityChanged:{ function onColorOverlayOpacityChanged(){
opacitySlider.value = VideoTabController.colorOverlayOpacity opacitySlider.value = VideoTabController.colorOverlayOpacity
} }
onColorOverlayEnabledChanged:{ function onColorOverlayEnabledChanged(){
colorToggle.checked = VideoTabController.colorOverlayEnabled colorToggle.checked = VideoTabController.colorOverlayEnabled
} }
onColorRedChanged:{ function onColorRedChanged(){
var redValue = VideoTabController.colorRed var redValue = VideoTabController.colorRed
colorRedText.text = Math.round(redValue * 100) + "%" colorRedText.text = Math.round(redValue * 100) + "%"
colorRedSlider.value = redValue colorRedSlider.value = redValue
} }
onColorGreenChanged:{ function onColorGreenChanged(){
var greenValue = VideoTabController.colorGreen var greenValue = VideoTabController.colorGreen
colorGreenText.text = Math.round(greenValue * 100) + "%" colorGreenText.text = Math.round(greenValue * 100) + "%"
colorGreenSlider.value = greenValue colorGreenSlider.value = greenValue
} }
onColorBlueChanged:{ function onColorBlueChanged(){
var blueValue = VideoTabController.colorBlue var blueValue = VideoTabController.colorBlue
colorBlueText.text = Math.round(blueValue * 100) + "%" colorBlueText.text = Math.round(blueValue * 100) + "%"
colorBlueSlider.value = blueValue colorBlueSlider.value = blueValue
@@ -108,10 +108,10 @@ GroupBox {
} }
Connections { Connections {
target: VideoTabController target: VideoTabController
onVideoProfilesUpdated: { function onVideoProfilesUpdated() {
reloadVideoProfiles() reloadVideoProfiles()
} }
onVideoProfileAdded: { function onVideoProfileAdded() {
videoProfileComboBox.currentIndex = VideoTabController.getVideoProfileCount() videoProfileComboBox.currentIndex = VideoTabController.getVideoProfileCount()
} }
@@ -133,12 +133,12 @@ GroupBox {
Connections { Connections {
target: VideoTabController target: VideoTabController
onSuperSamplingChanged: { function onSuperSamplingChanged() {
var s1 = VideoTabController.superSampling var s1 = VideoTabController.superSampling
videoSupersamplingSlider.value = s1 videoSupersamplingSlider.value = s1
videoSupersamplingText.text = s1.toFixed(2) videoSupersamplingText.text = s1.toFixed(2)
} }
onAllowSupersampleOverrideChanged: { function onAllowSupersampleOverrideChanged() {
videoAllowSupersampleOverrideToggle.checked = VideoTabController.allowSupersampleOverride videoAllowSupersampleOverrideToggle.checked = VideoTabController.allowSupersampleOverride
var s1 = VideoTabController.superSampling var s1 = VideoTabController.superSampling
videoSupersamplingSlider.value = s1 videoSupersamplingSlider.value = s1
+68 -34
View File
@@ -1,34 +1,68 @@
<!DOCTYPE RCC><RCC version="1.0"> <RCC>
<qresource prefix="/common"> <qresource prefix="/common">
<file alias="backarrow">img/common/backarrow.svg</file> <file alias="backarrow">img/common/backarrow.svg</file>
<file alias="box_checkmark">img/common/check.svg</file> <file alias="box_checkmark">img/common/check.svg</file>
</qresource> </qresource>
<qresource prefix="/microphone"> <qresource prefix="/microphone">
<file alias="on">img/audio/microphone/mic_on.svg</file> <file alias="on">img/audio/microphone/mic_on.svg</file>
<file alias="off">img/audio/microphone/mic_off.svg</file> <file alias="off">img/audio/microphone/mic_off.svg</file>
</qresource> <file alias="ptt_notification.png">img/audio/microphone/ptt_notification.png</file>
<qresource prefix="/speaker"> <file alias="ptm_notification.png">img/audio/microphone/ptm_notification.png</file>
<file alias="on">img/audio/speaker/speaker_on.svg</file> <file alias="ptt_notification.svg">img/audio/microphone/ptt_notification.svg</file>
<file alias="off">img/audio/speaker/speaker_off.svg</file> </qresource>
</qresource> <qresource prefix="/speaker">
<qresource prefix="/media_keys"> <file alias="on">img/audio/speaker/speaker_on.svg</file>
<file alias="play_pause">img/audio/media_keys/outline_play_pause_white_24dp.svg</file> <file alias="off">img/audio/speaker/speaker_off.svg</file>
<file alias="next">img/audio/media_keys/outline_skip_next_white_24dp.svg</file> </qresource>
<file alias="previous">img/audio/media_keys/outline_skip_previous_white_24dp.svg</file> <qresource prefix="/media_keys">
<file alias="stop">img/audio/media_keys/outline_stop_white_24dp.svg</file> <file alias="play_pause">img/audio/media_keys/outline_play_pause_white_24dp.svg</file>
</qresource> <file alias="next">img/audio/media_keys/outline_skip_next_white_24dp.svg</file>
<qresource prefix="/main_menu_icons"> <file alias="previous">img/audio/media_keys/outline_skip_previous_white_24dp.svg</file>
<file alias="audio_tab_icon">img/main_menu_icons/audio_tab_icon.svg</file> <file alias="stop">img/audio/media_keys/outline_stop_white_24dp.svg</file>
<file alias="bindings_tab_icon">img/main_menu_icons/bindings_tab_icon.svg</file> </qresource>
<file alias="chaperone_tab_icon">img/main_menu_icons/chaperone_tab_icon.svg</file> <qresource prefix="/main_menu_icons">
<file alias="motion_tab_icon">img/main_menu_icons/motion_tab_icon.svg</file> <file alias="audio_tab_icon">img/main_menu_icons/audio_tab_icon.svg</file>
<file alias="offsets_tab_icon">img/main_menu_icons/offsets_tab_icon.svg</file> <file alias="bindings_tab_icon">img/main_menu_icons/bindings_tab_icon.svg</file>
<file alias="settings_tab_icon">img/main_menu_icons/settings_tab_icon.svg</file> <file alias="chaperone_tab_icon">img/main_menu_icons/chaperone_tab_icon.svg</file>
<file alias="space_fix_tab_icon">img/main_menu_icons/space_fix_tab_icon.svg</file> <file alias="motion_tab_icon">img/main_menu_icons/motion_tab_icon.svg</file>
<file alias="statistics_tab_icon">img/main_menu_icons/statistics_tab_icon.svg</file> <file alias="offsets_tab_icon">img/main_menu_icons/offsets_tab_icon.svg</file>
<file alias="steamvr_tab_icon">img/main_menu_icons/steamvr_tab_icon.svg</file> <file alias="settings_tab_icon">img/main_menu_icons/settings_tab_icon.svg</file>
<file alias="utilities_tab_icon">img/main_menu_icons/utilities_tab_icon.svg</file> <file alias="space_fix_tab_icon">img/main_menu_icons/space_fix_tab_icon.svg</file>
<file alias="video_tab_icon">img/main_menu_icons/video_tab_icon.svg</file> <file alias="statistics_tab_icon">img/main_menu_icons/statistics_tab_icon.svg</file>
<file alias="rotation_tab_icon">img/main_menu_icons/rotation_tab_icon.svg</file> <file alias="steamvr_tab_icon">img/main_menu_icons/steamvr_tab_icon.svg</file>
</qresource> <file alias="utilities_tab_icon">img/main_menu_icons/utilities_tab_icon.svg</file>
</RCC> <file alias="video_tab_icon">img/main_menu_icons/video_tab_icon.svg</file>
<file alias="rotation_tab_icon">img/main_menu_icons/rotation_tab_icon.svg</file>
</qresource>
<qresource prefix="/sounds">
<file alias="alarm01.wav">sounds/alarm01.wav</file>
<file alias="click.wav">sounds/click.wav</file>
<file alias="focus.wav">sounds/focus.wav</file>
</qresource>
<qresource prefix="/battery">
<file alias="battery_0.png">img/battery/battery_0.png</file>
<file alias="battery_1.png">img/battery/battery_1.png</file>
<file alias="battery_2.png">img/battery/battery_2.png</file>
<file alias="battery_3.png">img/battery/battery_3.png</file>
<file alias="battery_4.png">img/battery/battery_4.png</file>
<file alias="battery_5.png">img/battery/battery_5.png</file>
</qresource>
<qresource prefix="/chaperone">
<file alias="centermark.png">img/chaperone/centermark.png</file>
<file alias="centermarkl1.png">img/chaperone/centermarkl1.png</file>
<file alias="centermarkl2.png">img/chaperone/centermarkl2.png</file>
<file alias="centermarkl3.png">img/chaperone/centermarkl3.png</file>
<file alias="centermarkr1.png">img/chaperone/centermarkr1.png</file>
<file alias="centermarkr2.png">img/chaperone/centermarkr2.png</file>
<file alias="centermarkr3.png">img/chaperone/centermarkr3.png</file>
</qresource>
<qresource prefix="/video">
<file alias="color.png">img/video/color.png</file>
<file alias="dimmer.png">img/video/dimmer.png</file>
</qresource>
<qresource prefix="/rotation">
<file alias="autoturn.png">img/rotation/autoturn.png</file>
<file alias="noautoturn.png">img/rotation/noautoturn.png</file>
<file alias="noautoturn.svg">img/rotation/noautoturn.svg</file>
</qresource>
</RCC>
+8 -7
View File
@@ -2,7 +2,8 @@
#include <assert.h> #include <assert.h>
#include <array> #include <array>
#include <vector> #include <vector>
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
#include "../settings.h" #include "../settings.h"
#include "setting_value.h" #include "setting_value.h"
#include "../../utils/setup.h" #include "../../utils/setup.h"
@@ -64,12 +65,12 @@ void verifySettings( std::array<Value, ArraySize> v ) noexcept
const auto enumSettingNumber = static_cast<int>( currentSetting ); const auto enumSettingNumber = static_cast<int>( currentSetting );
LOG( ERROR ) << enumName << ": at index '" << settingIndex qCritical() << enumName << ": at index '" << settingIndex
<< "' is incorrect. Current value: '" << "' is incorrect. Current value: '"
<< enumSettingNumber << enumSettingNumber
<< "'. Exiting " << "'. Exiting "
"with error code " "with error code "
<< ReturnErrorCode::SETTING_INCORRECT_INDEX << "."; << ReturnErrorCode::SETTING_INCORRECT_INDEX << ".";
exit( ReturnErrorCode::SETTING_INCORRECT_INDEX ); exit( ReturnErrorCode::SETTING_INCORRECT_INDEX );
} }
} }
+1 -1
View File
@@ -84,7 +84,7 @@ void saveQtSetting( const SettingCategory category,
getQSettings().endGroup(); getQSettings().endGroup();
} }
template <typename Value>[[nodiscard]] bool isValidQVariant( const QVariant v ) template <typename Value> [[nodiscard]] bool isValidQVariant( const QVariant v )
{ {
auto savedSettingIsValid = v.isValid() && !v.isNull(); auto savedSettingIsValid = v.isValid() && !v.isNull();
@@ -1,6 +1,5 @@
#pragma once #pragma once
#include <list> #include <list>
#include <easylogging++.h>
namespace settings namespace settings
{ {
+4 -3
View File
@@ -1,5 +1,6 @@
#include <utility> #include <utility>
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h" #include "../overlaycontroller.h"
#include "internal/settings_controller.h" #include "internal/settings_controller.h"
@@ -14,9 +15,9 @@ void saveChangedSettings()
void saveAllSettings() void saveAllSettings()
{ {
LOG( INFO ) << "Saving all settings."; qInfo() << "Saving all settings.";
settingController.saveAllSettings(); settingController.saveAllSettings();
LOG( INFO ) << "All settings saved."; qInfo() << "All settings saved.";
} }
[[nodiscard]] bool getSetting( const BoolSetting setting ) [[nodiscard]] bool getSetting( const BoolSetting setting )
+98 -106
View File
@@ -1,6 +1,8 @@
#include "AudioTabController.h" #include "AudioTabController.h"
#include <QQuickWindow> #include <QQuickWindow>
#include <QApplication> #include <QApplication>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h" #include "../overlaycontroller.h"
#include "../settings/settings.h" #include "../settings/settings.h"
#include "../settings/settings_object.h" #include "../settings/settings_object.h"
@@ -39,11 +41,11 @@ void AudioTabController::initStage1()
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( WARNING ) << "Could not read \"" qWarning() << "Could not read \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String << vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: " << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
else else
{ {
@@ -63,8 +65,9 @@ void AudioTabController::initStage1()
eventLoopTick(); eventLoopTick();
} }
void AudioTabController::initStage2() void AudioTabController::initStage2( OverlayController* var_parent )
{ {
this->parent = var_parent;
const auto pushToTalkOverlayKey const auto pushToTalkOverlayKey
= std::string( application_strings::applicationKey ) = std::string( application_strings::applicationKey )
+ ".pptnotification"; + ".pptnotification";
@@ -75,43 +78,40 @@ void AudioTabController::initStage2()
&m_pushToTalkValues.overlayHandle ); &m_pushToTalkValues.overlayHandle );
if ( overlayError != vr::VROverlayError_None ) if ( overlayError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Could not create ptt notification overlay: " qCritical() << "Could not create ptt notification overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( << vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError ); overlayError );
emit defaultProfileDisplay(); emit defaultProfileDisplay();
return; return;
} }
constexpr auto pushToTalkIconFilepath QImage pushToTalkIcon;
= "/res/img/audio/microphone/ptt_notification.png"; Q_ASSERT( pushToTalkIcon.load(
constexpr auto pushToMuteIconFilepath QString( "qrc:/res/img/audio/microphone/ptt_notification.png" ) ) );
= "/res/img/audio/microphone/ptm_notification.png"; QImage pushToMuteIcon;
Q_ASSERT( pushToMuteIcon.load(
QString( "qrc:/res/img/audio/microphone/ptt_notification.png" ) ) );
const auto pushToTalkIconFilePath emit defaultProfileDisplay();
= paths::verifyIconFilePath( pushToTalkIconFilepath ); return;
const auto pushToMuteIconFilePath
= paths::verifyIconFilePath( pushToMuteIconFilepath );
if ( !pushToTalkIconFilePath.has_value() auto* rhi = parent->m_renderControl.rhi();
|| !pushToMuteIconFilePath.has_value() ) m_pushToTalkValues.pushToTalkTex.reset(
{ rhi->newTexture( QRhiTexture::RGBA8, pushToTalkIcon.size(), 1 ) );
emit defaultProfileDisplay(); m_pushToTalkValues.pushToMuteTex.reset(
return; rhi->newTexture( QRhiTexture::RGBA8, pushToTalkIcon.size(), 1 ) );
}
m_pushToTalkValues.pushToTalkPath = *pushToTalkIconFilePath; auto* pushToTex = m_pushToTalkValues.pushToTalkTex.get();
m_pushToTalkValues.pushToMutePath = *pushToMuteIconFilePath;
auto pushToPath = m_pushToTalkValues.pushToTalkPath.c_str();
if ( settings::getSetting( settings::BoolSetting::AUDIO_micReversePtt ) ) if ( settings::getSetting( settings::BoolSetting::AUDIO_micReversePtt ) )
{ {
pushToPath = m_pushToTalkValues.pushToMutePath.c_str(); pushToTex = m_pushToTalkValues.pushToMuteTex.get();
} }
vr::VROverlay()->SetOverlayFromFile( m_pushToTalkValues.overlayHandle, auto tex = parent->vrTextureFromRhiTexture( *pushToTex );
pushToPath ); vr::VROverlay()->SetOverlayTexture( m_pushToTalkValues.overlayHandle,
&tex );
vr::VROverlay()->SetOverlayWidthInMeters( m_pushToTalkValues.overlayHandle, vr::VROverlay()->SetOverlayWidthInMeters( m_pushToTalkValues.overlayHandle,
0.02f ); 0.02f );
vr::HmdMatrix34_t notificationTransform vr::HmdMatrix34_t notificationTransform
@@ -196,11 +196,11 @@ void AudioTabController::eventLoopTick()
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( WARNING ) << "Could not read \"" qWarning() << "Could not read \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String << vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: " << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
if ( lastMirrorDevId.compare( mirrorDeviceId ) != 0 ) if ( lastMirrorDevId.compare( mirrorDeviceId ) != 0 )
{ {
@@ -358,15 +358,11 @@ void AudioTabController::setMicReversePtt( bool value, bool notify )
if ( value ) if ( value )
{ {
vr::VROverlay()->SetOverlayFromFile( // vr::VROverlay()->SetOverlayFromFile(m_ptt_overlayHandle,/*pt_mute*/);
m_pushToTalkValues.overlayHandle,
m_pushToTalkValues.pushToMutePath.c_str() );
} }
else else
{ {
vr::VROverlay()->SetOverlayFromFile( // vr::VROverlay()->SetOverlayFromFile(m_ptt_overlayHandle,/*pt_talk*/);
m_pushToTalkValues.overlayHandle,
m_pushToTalkValues.pushToTalkPath.c_str() );
} }
if ( pttEnabled() ) if ( pttEnabled() )
@@ -447,17 +443,17 @@ bool indexIsValid( const int index,
{ {
if ( index < 0 ) if ( index < 0 )
{ {
LOG( ERROR ) << functionName qCritical() << functionName
<< " called with index below zero: " << index; << " called with index below zero: " << index;
return false; return false;
} }
if ( static_cast<size_t>( index ) >= devices.size() ) if ( static_cast<size_t>( index ) >= devices.size() )
{ {
LOG( ERROR ) << functionName qCritical() << functionName
<< " called with index greater than size of " << " called with index greater than size of "
"devices '" "devices '"
<< devices.size() << "', index '" << index << "'."; << devices.size() << "', index '" << index << "'.";
return false; return false;
} }
@@ -571,12 +567,11 @@ void AudioTabController::setMirrorDeviceIndex( int index, bool notify )
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( WARNING ) qWarning() << "Could not remove \""
<< "Could not remove \"" << vr::k_pch_audio_PlaybackMirrorDevice_String
<< vr::k_pch_audio_PlaybackMirrorDevice_String << "\" setting: "
<< "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( vrSettingsError );
vrSettingsError );
} }
else else
{ {
@@ -596,12 +591,11 @@ void AudioTabController::setMirrorDeviceIndex( int index, bool notify )
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( WARNING ) qWarning() << "Could not write \""
<< "Could not write \"" << vr::k_pch_audio_PlaybackMirrorDevice_String
<< vr::k_pch_audio_PlaybackMirrorDevice_String << "\" setting: "
<< "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( vrSettingsError );
vrSettingsError );
} }
else else
{ {
@@ -883,12 +877,11 @@ void AudioTabController::deleteAudioProfile( unsigned index )
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( WARNING ) qWarning() << "Could not remove \""
<< "Could not remove \"" << vr::k_pch_audio_PlaybackDeviceOverrideName_String
<< vr::k_pch_audio_PlaybackDeviceOverrideName_String << "\" setting: "
<< "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( vrSettingsError );
vrSettingsError );
} }
vr::VRSettings()->RemoveKeyInSection( vr::VRSettings()->RemoveKeyInSection(
@@ -897,12 +890,11 @@ void AudioTabController::deleteAudioProfile( unsigned index )
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( WARNING ) qWarning() << "Could not remove \""
<< "Could not remove \"" << vr::k_pch_audio_RecordingDeviceOverrideName_String
<< vr::k_pch_audio_RecordingDeviceOverrideName_String << "\" setting: "
<< "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( vrSettingsError );
vrSettingsError );
} }
} }
audioProfiles.erase( pos ); audioProfiles.erase( pos );
@@ -936,9 +928,9 @@ void AudioTabController::setPlaybackOverride( bool value, bool notify )
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( ERROR ) << "Could not set playback override setting: " qCritical() << "Could not set playback override setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
if ( notify ) if ( notify )
{ {
@@ -959,9 +951,9 @@ void AudioTabController::setRecordingOverride( bool value, bool notify )
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( ERROR ) << "Could not set recording override setting: " qCritical() << "Could not set recording override setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
if ( notify ) if ( notify )
{ {
@@ -979,10 +971,10 @@ void AudioTabController::initOverride()
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( ERROR ) << "Could not get recording override setting: " qCritical() << "Could not get recording override setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
LOG( INFO ) << "Setting recording override to false"; qInfo() << "Setting recording override to false";
setRecordingOverride( false ); setRecordingOverride( false );
} }
else else
@@ -995,10 +987,10 @@ void AudioTabController::initOverride()
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( ERROR ) << "Could not get playback override setting: " qCritical() << "Could not get playback override setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
LOG( INFO ) << "Setting playback override to false"; qInfo() << "Setting playback override to false";
setPlaybackOverride( false ); setPlaybackOverride( false );
} }
else else
@@ -1091,11 +1083,11 @@ void AudioTabController::setDefaultPlayback( int index, bool notify )
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( WARNING ) << "Could not write \"" qWarning() << "Could not write \""
<< vr::k_pch_audio_PlaybackDeviceOverrideName_String << vr::k_pch_audio_PlaybackDeviceOverrideName_String
<< "\" setting: " << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
else else
{ {
@@ -1114,11 +1106,11 @@ void AudioTabController::setDefaultMic( int index, bool notify )
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( WARNING ) << "Could not write \"" qWarning() << "Could not write \""
<< vr::k_pch_audio_RecordingDeviceOverrideName_String << vr::k_pch_audio_RecordingDeviceOverrideName_String
<< "\" setting: " << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
else else
{ {
@@ -1138,11 +1130,11 @@ void AudioTabController::setDefaultMirror( int index, bool notify )
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( WARNING ) << "Could not remove \"" qWarning() << "Could not remove \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String << vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: " << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
else else
{ {
@@ -1159,11 +1151,11 @@ void AudioTabController::setDefaultMirror( int index, bool notify )
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( WARNING ) << "Could not write \"" qWarning() << "Could not write \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String << vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: " << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
else else
{ {
@@ -1258,7 +1250,7 @@ void AudioTabController::shutdown()
{ {
setMirrorDeviceIndex( -1 ); setMirrorDeviceIndex( -1 );
} }
LOG( INFO ) << "Audio Tab Controller Has Shut Down"; qInfo() << "Audio Tab Controller Has Shut Down";
} }
bool AudioTabController::pttEnabled() const bool AudioTabController::pttEnabled() const
+5 -3
View File
@@ -5,6 +5,7 @@
#include "audiomanager/AudioManager.h" #include "audiomanager/AudioManager.h"
#include <memory> #include <memory>
#include <rhi/qrhi.h>
#include "../utils/FrameRateUtils.h" #include "../utils/FrameRateUtils.h"
#include "../settings/settings_object.h" #include "../settings/settings_object.h"
@@ -111,11 +112,12 @@ class AudioTabController : public QObject
setPttShowNotification NOTIFY pttShowNotificationChanged ) setPttShowNotification NOTIFY pttShowNotificationChanged )
private: private:
OverlayController* parent;
struct struct
{ {
vr::VROverlayHandle_t overlayHandle = vr::k_ulOverlayHandleInvalid; vr::VROverlayHandle_t overlayHandle = vr::k_ulOverlayHandleInvalid;
std::string pushToTalkPath; std::unique_ptr<QRhiTexture> pushToTalkTex;
std::string pushToMutePath; std::unique_ptr<QRhiTexture> pushToMuteTex;
} m_pushToTalkValues; } m_pushToTalkValues;
int m_playbackDeviceIndex = -1; int m_playbackDeviceIndex = -1;
@@ -178,7 +180,7 @@ private:
public: public:
void initStage1(); void initStage1();
void initStage2(); void initStage2( OverlayController* var_parent );
void reloadAudioSettings(); void reloadAudioSettings();
+18 -17
View File
@@ -1,5 +1,7 @@
#include "ChaperoneTabController.h" #include "ChaperoneTabController.h"
#include <QQuickWindow> #include <QQuickWindow>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h" #include "../overlaycontroller.h"
#include "../settings/settings.h" #include "../settings/settings.h"
#include "../utils/Matrix.h" #include "../utils/Matrix.h"
@@ -182,7 +184,7 @@ void ChaperoneTabController::handleChaperoneWarnings( float distance )
// Alarm Sound // Alarm Sound
if ( isChaperoneAlarmSoundEnabled() ) if ( isChaperoneAlarmSoundEnabled() )
{ {
// LOG(WARNING) << "In alarm"; qWarning() << "In alarm";
float activationDistance = chaperoneAlarmSoundDistance(); float activationDistance = chaperoneAlarmSoundDistance();
if ( distance <= activationDistance && proxSensorOverrideState ) if ( distance <= activationDistance && proxSensorOverrideState )
@@ -763,12 +765,12 @@ void ChaperoneTabController::setChaperoneColorR( int value, bool notify )
if ( value > 255 ) if ( value > 255 )
{ {
value = 255; value = 255;
LOG( WARNING ) << "Red Channel larger than 255, setting to 255"; qWarning() << "Red Channel larger than 255, setting to 255";
} }
else if ( value < 0 ) else if ( value < 0 )
{ {
value = 0; value = 0;
LOG( WARNING ) << "Red Channel smaller than 0, setting to 0"; qWarning() << "Red Channel smaller than 0, setting to 0";
} }
m_chaperoneColorR = value; m_chaperoneColorR = value;
ovr_settings_wrapper::setInt32( ovr_settings_wrapper::setInt32(
@@ -791,12 +793,12 @@ void ChaperoneTabController::setChaperoneColorG( int value, bool notify )
if ( value > 255 ) if ( value > 255 )
{ {
value = 255; value = 255;
LOG( WARNING ) << "Green Channel larger than 255, setting to 255"; qWarning() << "Green Channel larger than 255, setting to 255";
} }
else if ( value < 0 ) else if ( value < 0 )
{ {
value = 0; value = 0;
LOG( WARNING ) << "Green Channel smaller than 0, setting to 0"; qWarning() << "Green Channel smaller than 0, setting to 0";
} }
m_chaperoneColorG = value; m_chaperoneColorG = value;
ovr_settings_wrapper::setInt32( ovr_settings_wrapper::setInt32(
@@ -819,12 +821,12 @@ void ChaperoneTabController::setChaperoneColorB( int value, bool notify )
if ( value > 255 ) if ( value > 255 )
{ {
value = 255; value = 255;
LOG( WARNING ) << "Blue Channel larger than 255, setting to 255"; qWarning() << "Blue Channel larger than 255, setting to 255";
} }
else if ( value < 0 ) else if ( value < 0 )
{ {
value = 0; value = 0;
LOG( WARNING ) << "Blue Channel smaller than 0, setting to 0"; qWarning() << "Blue Channel smaller than 0, setting to 0";
} }
m_chaperoneColorB = value; m_chaperoneColorB = value;
ovr_settings_wrapper::setInt32( ovr_settings_wrapper::setInt32(
@@ -855,12 +857,12 @@ void ChaperoneTabController::setChaperoneColorA( int value, bool notify )
if ( value > 255 ) if ( value > 255 )
{ {
value = 255; value = 255;
LOG( WARNING ) << "Alpha Channel larger than 255, setting to 255"; qWarning() << "Alpha Channel larger than 255, setting to 255";
} }
else if ( value < 0 ) else if ( value < 0 )
{ {
value = 0; value = 0;
LOG( WARNING ) << "Alpha Channel smaller than 0, setting to 0"; qWarning() << "Alpha Channel smaller than 0, setting to 0";
} }
m_chaperoneColorA = value; m_chaperoneColorA = value;
ovr_settings_wrapper::setInt32( ovr_settings_wrapper::setInt32(
@@ -926,14 +928,13 @@ void ChaperoneTabController::setCollisionBoundStyle( int value,
if ( vr::COLLISION_BOUNDS_STYLE_COUNT < value ) if ( vr::COLLISION_BOUNDS_STYLE_COUNT < value )
{ {
value = 0; value = 0;
LOG( WARNING ) qWarning()
<< "Invalid Collision Bound Value (>count), set to beginner"; << "Invalid Collision Bound Value (>count), set to beginner";
} }
else if ( value < 0 ) else if ( value < 0 )
{ {
value = 0; value = 0;
LOG( WARNING ) qWarning() << "Invalid Collision Bound Value (<0), set to beginner";
<< "Invalid Collision Bound Value (<0), set to beginner";
} }
if ( !isTemp ) if ( !isTemp )
{ {
@@ -1468,7 +1469,7 @@ void ChaperoneTabController::createNewAutosaveProfile()
} }
else else
{ {
LOG( INFO ) qInfo()
<< "[Chaperone Autosave] «Autosaved Profile (previous)» not found"; << "[Chaperone Autosave] «Autosaved Profile (previous)» not found";
} }
@@ -1484,7 +1485,7 @@ void ChaperoneTabController::createNewAutosaveProfile()
} }
else else
{ {
LOG( INFO ) << "[Chaperone Autosave] «Autosaved Profile» not found"; qInfo() << "[Chaperone Autosave] «Autosaved Profile» not found";
} }
// create a new autosave from current chaperone (all options set true) // create a new autosave from current chaperone (all options set true)
@@ -1515,8 +1516,8 @@ void ChaperoneTabController::applyAutosavedProfile()
} }
else else
{ {
LOG( WARNING ) << "Failed to apply chaperone Autosaved Profile " qWarning() << "Failed to apply chaperone Autosaved Profile "
"(autosave doesn't exist)"; "(autosave doesn't exist)";
} }
} }
@@ -1629,7 +1630,7 @@ void ChaperoneTabController::initCenterMarkerOverlay()
} }
else else
{ {
LOG( ERROR ) << "overlay Not initialized"; qCritical() << "overlay Not initialized";
// TODO Set Failure variable. // TODO Set Failure variable.
} }
} }
+12 -11
View File
@@ -1,5 +1,7 @@
#include "FixFloorTabController.h" #include "FixFloorTabController.h"
#include <QQuickWindow> #include <QQuickWindow>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h" #include "../overlaycontroller.h"
// application namespace // application namespace
@@ -153,7 +155,7 @@ void FixFloorTabController::dashboardLoopTick(
/* /*
floorOffsetY = static_cast<float>(tempOffsetY); floorOffsetY = static_cast<float>(tempOffsetY);
LOG(INFO) << "Offset For Knuckles up is: " << qInfo() << "Offset For Knuckles up is: " <<
floorOffsetY; floorOffsetY;
*/ */
} }
@@ -183,7 +185,7 @@ void FixFloorTabController::dashboardLoopTick(
/* /*
floorOffsetY = static_cast<float>(tempOffsetY); floorOffsetY = static_cast<float>(tempOffsetY);
LOG(INFO) << "Offset For Knuckles up is: " << qInfo() << "Offset For Knuckles up is: " <<
floorOffsetY; floorOffsetY;
*/ */
} }
@@ -196,10 +198,9 @@ void FixFloorTabController::dashboardLoopTick(
floorOffsetX = static_cast<float>( tempOffsetX ); floorOffsetX = static_cast<float>( tempOffsetX );
floorOffsetZ = static_cast<float>( tempOffsetZ ); floorOffsetZ = static_cast<float>( tempOffsetZ );
LOG( INFO ) qInfo() << "Fix Floor and adjust space center: Floor Offset = ["
<< "Fix Floor and adjust space center: Floor Offset = [" << floorOffsetX << ", " << floorOffsetY << ", "
<< floorOffsetX << ", " << floorOffsetY << ", " << floorOffsetZ << "]";
<< floorOffsetZ << "]";
float offset[3] = { 0, 0, 0 }; float offset[3] = { 0, 0, 0 };
offset[1] = floorOffsetY; offset[1] = floorOffsetY;
if ( state == 2 ) if ( state == 2 )
@@ -243,12 +244,12 @@ int FixFloorTabController::getControllerType(
&error ); &error );
if ( error != vr::TrackedProp_Success ) if ( error != vr::TrackedProp_Success )
{ {
LOG( ERROR ) << "Error With Controller Type: " qCritical() << "Error With Controller Type: "
<< vr::VRSystem()->GetPropErrorNameFromEnum( error ); << vr::VRSystem()->GetPropErrorNameFromEnum( error );
} }
else if ( stringLength == 0 ) else if ( stringLength == 0 )
{ {
LOG( ERROR ) << "Device Index not valid"; qCritical() << "Device Index not valid";
} }
else if ( strcmp( controllerTypeString, "knuckles" ) == 0 ) else if ( strcmp( controllerTypeString, "knuckles" ) == 0 )
{ {
@@ -308,8 +309,8 @@ void FixFloorTabController::undoFixFloorClicked()
{ {
float off[3] = { -floorOffsetX, -floorOffsetY, -floorOffsetZ }; float off[3] = { -floorOffsetX, -floorOffsetY, -floorOffsetZ };
parent->m_moveCenterTabController.addOffset( off ); parent->m_moveCenterTabController.addOffset( off );
LOG( INFO ) << "Fix Floor: Undo Floor Offset = [" << -floorOffsetX << ", " qInfo() << "Fix Floor: Undo Floor Offset = [" << -floorOffsetX << ", "
<< -floorOffsetY << ", " << -floorOffsetZ << "]"; << -floorOffsetY << ", " << -floorOffsetZ << "]";
floorOffsetY = 0.0f; floorOffsetY = 0.0f;
statusMessage = "Undo ... OK"; statusMessage = "Undo ... OK";
statusMessageTimeout = 1.0; statusMessageTimeout = 1.0;
+91 -97
View File
@@ -1,5 +1,7 @@
#include "MoveCenterTabController.h" #include "MoveCenterTabController.h"
#include <QQuickWindow> #include <QQuickWindow>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h" #include "../overlaycontroller.h"
#include "../quaternion/quaternion.h" #include "../quaternion/quaternion.h"
#include "../settings/settings.h" #include "../settings/settings.h"
@@ -116,10 +118,10 @@ void MoveCenterTabController::applyOffsetProfile( unsigned index )
emit offsetXChanged( m_offsetX ); emit offsetXChanged( m_offsetX );
emit offsetYChanged( m_offsetY ); emit offsetYChanged( m_offsetY );
emit offsetZChanged( m_offsetZ ); emit offsetZChanged( m_offsetZ );
LOG( INFO ) << "Applying Offset Profile:" << profile.profileName qInfo() << "Applying Offset Profile:" << profile.profileName
<< " X:" << m_offsetX << " Y:" << m_offsetY << " X:" << m_offsetX << " Y:" << m_offsetY
<< " Z:" << m_offsetZ << " Rotation:" << " Z:" << m_offsetZ
<< ( static_cast<float>( m_rotation ) / 100 ); << " Rotation:" << ( static_cast<float>( m_rotation ) / 100 );
} }
} }
@@ -168,10 +170,10 @@ void MoveCenterTabController::outputLogPoses()
vr::HmdMatrix34_t hmdStanding vr::HmdMatrix34_t hmdStanding
= devicePosesStanding[0].mDeviceToAbsoluteTracking; = devicePosesStanding[0].mDeviceToAbsoluteTracking;
LOG( INFO ) << ""; qInfo() << "";
LOG( INFO ) << " ____Begin Matrices Log Ouput__________"; qInfo() << " ____Begin Matrices Log Ouput__________";
LOG( INFO ) << "|"; qInfo() << "|";
LOG( INFO ) << "HMD POSE (standing universe)"; qInfo() << "HMD POSE (standing universe)";
outputLogHmdMatrix( hmdStanding ); outputLogHmdMatrix( hmdStanding );
vr::TrackedDevicePose_t devicePosesSeated[vr::k_unMaxTrackedDeviceCount]; vr::TrackedDevicePose_t devicePosesSeated[vr::k_unMaxTrackedDeviceCount];
@@ -185,7 +187,7 @@ void MoveCenterTabController::outputLogPoses()
vr::HmdMatrix34_t hmdSeated vr::HmdMatrix34_t hmdSeated
= devicePosesSeated[0].mDeviceToAbsoluteTracking; = devicePosesSeated[0].mDeviceToAbsoluteTracking;
LOG( INFO ) << "HMD POSE (seated universe)"; qInfo() << "HMD POSE (seated universe)";
outputLogHmdMatrix( hmdSeated ); outputLogHmdMatrix( hmdSeated );
auto leftHand = vr::VRSystem()->GetTrackedDeviceIndexForControllerRole( auto leftHand = vr::VRSystem()->GetTrackedDeviceIndexForControllerRole(
@@ -198,70 +200,65 @@ void MoveCenterTabController::outputLogPoses()
vr::HmdMatrix34_t rightHandMatrix vr::HmdMatrix34_t rightHandMatrix
= devicePosesStanding[rightHand].mDeviceToAbsoluteTracking; = devicePosesStanding[rightHand].mDeviceToAbsoluteTracking;
LOG( INFO ) << "LEFT Hand Controller Pose (standing universe)"; qInfo() << "LEFT Hand Controller Pose (standing universe)";
outputLogHmdMatrix( leftHandMatrix ); outputLogHmdMatrix( leftHandMatrix );
LOG( INFO ) << "RIGHT Hand Controller Pose (standing universe)"; qInfo() << "RIGHT Hand Controller Pose (standing universe)";
outputLogHmdMatrix( rightHandMatrix ); outputLogHmdMatrix( rightHandMatrix );
vr::HmdMatrix34_t standingZero; vr::HmdMatrix34_t standingZero;
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose( vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
&standingZero ); &standingZero );
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose"; qInfo() << "GetWorkingStandingZeroPoseToRawTrackingPose";
outputLogHmdMatrix( standingZero ); outputLogHmdMatrix( standingZero );
vr::HmdMatrix34_t seatedZero; vr::HmdMatrix34_t seatedZero;
vr::VRChaperoneSetup()->GetWorkingSeatedZeroPoseToRawTrackingPose( vr::VRChaperoneSetup()->GetWorkingSeatedZeroPoseToRawTrackingPose(
&seatedZero ); &seatedZero );
LOG( INFO ) << "GetWorkingSeatedZeroPoseToRawTrackingPose"; qInfo() << "GetWorkingSeatedZeroPoseToRawTrackingPose";
outputLogHmdMatrix( seatedZero ); outputLogHmdMatrix( seatedZero );
vr::HmdMatrix34_t seatedZeroLive; vr::HmdMatrix34_t seatedZeroLive;
vr::VRChaperoneSetup()->GetLiveSeatedZeroPoseToRawTrackingPose( vr::VRChaperoneSetup()->GetLiveSeatedZeroPoseToRawTrackingPose(
&seatedZeroLive ); &seatedZeroLive );
LOG( INFO ) << "GetLiveSeatedZeroPoseToRawTrackingPose"; qInfo() << "GetLiveSeatedZeroPoseToRawTrackingPose";
outputLogHmdMatrix( seatedZeroLive ); outputLogHmdMatrix( seatedZeroLive );
vr::HmdMatrix34_t seatedToStandingAbsolute vr::HmdMatrix34_t seatedToStandingAbsolute
= vr::VRSystem()->GetSeatedZeroPoseToStandingAbsoluteTrackingPose(); = vr::VRSystem()->GetSeatedZeroPoseToStandingAbsoluteTrackingPose();
LOG( INFO ) << "GetSeatedZeroPoseToStandingAbsoluteTrackingPose"; qInfo() << "GetSeatedZeroPoseToStandingAbsoluteTrackingPose";
outputLogHmdMatrix( seatedToStandingAbsolute ); outputLogHmdMatrix( seatedToStandingAbsolute );
LOG( INFO ) << "m_universeCenterForReset"; qInfo() << "m_universeCenterForReset";
outputLogHmdMatrix( m_universeCenterForReset ); outputLogHmdMatrix( m_universeCenterForReset );
LOG( INFO ) << "m_seatedCenterForReset"; qInfo() << "m_seatedCenterForReset";
outputLogHmdMatrix( m_seatedCenterForReset ); outputLogHmdMatrix( m_seatedCenterForReset );
LOG( INFO ) << "|____End Matrices Log Ouput____________"; qInfo() << "|____End Matrices Log Ouput____________";
LOG( INFO ) << ""; qInfo() << "";
} }
void MoveCenterTabController::outputLogHmdMatrix( vr::HmdMatrix34_t hmdMatrix ) void MoveCenterTabController::outputLogHmdMatrix( vr::HmdMatrix34_t hmdMatrix )
{ {
LOG( INFO ) << hmdMatrix.m[0][0] << "\t\t\t" << hmdMatrix.m[0][1] qInfo() << hmdMatrix.m[0][0] << "\t\t\t" << hmdMatrix.m[0][1] << "\t\t\t"
<< "\t\t\t" << hmdMatrix.m[0][2] << "\t\t\t" << hmdMatrix.m[0][2] << "\t\t\t" << hmdMatrix.m[0][3];
<< hmdMatrix.m[0][3]; qInfo() << hmdMatrix.m[1][0] << "\t\t\t" << hmdMatrix.m[1][1] << "\t\t\t"
LOG( INFO ) << hmdMatrix.m[1][0] << "\t\t\t" << hmdMatrix.m[1][1] << hmdMatrix.m[1][2] << "\t\t\t" << hmdMatrix.m[1][3];
<< "\t\t\t" << hmdMatrix.m[1][2] << "\t\t\t" qInfo() << hmdMatrix.m[2][0] << "\t\t\t" << hmdMatrix.m[2][1] << "\t\t\t"
<< hmdMatrix.m[1][3]; << hmdMatrix.m[2][2] << "\t\t\t" << hmdMatrix.m[2][3];
LOG( INFO ) << hmdMatrix.m[2][0] << "\t\t\t" << hmdMatrix.m[2][1]
<< "\t\t\t" << hmdMatrix.m[2][2] << "\t\t\t"
<< hmdMatrix.m[2][3];
float atan2Yaw = std::atan2( hmdMatrix.m[0][2], hmdMatrix.m[2][2] ); float atan2Yaw = std::atan2( hmdMatrix.m[0][2], hmdMatrix.m[2][2] );
LOG( INFO ) << "atan2 Yaw Calculation: " << atan2Yaw << "radians " qInfo() << "atan2 Yaw Calculation: " << atan2Yaw << "radians "
<< ( ( static_cast<double>( atan2Yaw ) << ( ( static_cast<double>( atan2Yaw ) * k_radiansToCentidegrees )
* k_radiansToCentidegrees ) / 100 )
/ 100 ) << "degrees";
<< "degrees";
vr::HmdQuaternion_t hmdQuat = quaternion::fromHmdMatrix34( hmdMatrix ); vr::HmdQuaternion_t hmdQuat = quaternion::fromHmdMatrix34( hmdMatrix );
double hmdQuatYaw = quaternion::getYaw( hmdQuat ); double hmdQuatYaw = quaternion::getYaw( hmdQuat );
LOG( INFO ) << "Quaternion Yaw Calculation: " << hmdQuatYaw << "radians " qInfo() << "Quaternion Yaw Calculation: " << hmdQuatYaw << "radians "
<< ( ( hmdQuatYaw * k_radiansToCentidegrees ) / 100 ) << ( ( hmdQuatYaw * k_radiansToCentidegrees ) / 100 ) << "degrees";
<< "degrees"; qInfo() << "";
LOG( INFO ) << "";
} }
int MoveCenterTabController::trackingUniverse() const int MoveCenterTabController::trackingUniverse() const
@@ -283,7 +280,7 @@ void MoveCenterTabController::setTrackingUniverse( int value, bool notify )
if ( notify ) if ( notify )
{ {
emit trackingUniverseChanged( m_trackingUniverse ); emit trackingUniverseChanged( m_trackingUniverse );
LOG( INFO ) << "Tracking Universe: " << m_trackingUniverse; qInfo() << "Tracking Universe: " << m_trackingUniverse;
} }
} }
} }
@@ -914,19 +911,19 @@ void MoveCenterTabController::incomingZeroReset()
// aspects) IN mixed tracking environments I get this issue, the check if // aspects) IN mixed tracking environments I get this issue, the check if
// there is an error and apply autosaved profile is hopefully a workaround // there is an error and apply autosaved profile is hopefully a workaround
auto calState = vr::VRChaperone()->GetCalibrationState(); auto calState = vr::VRChaperone()->GetCalibrationState();
LOG( INFO ) << "Calibration State on Zero Reset is: " << calState; qInfo() << "Calibration State on Zero Reset is: " << calState;
// If we detect a seated Recenter and are not currently in process // If we detect a seated Recenter and are not currently in process
// we reload chaperone from disk // we reload chaperone from disk
if ( m_recenterStages < 1 ) if ( m_recenterStages < 1 )
{ {
LOG( INFO ) << "Re-Center Stage 1, reload from disk"; qInfo() << "Re-Center Stage 1, reload from disk";
m_recenterStages++; m_recenterStages++;
if ( calState > 199 && m_initComplete ) if ( calState > 199 && m_initComplete )
{ {
LOG( INFO ) << "Chaperone calibration state is error, attempting " qInfo() << "Chaperone calibration state is error, attempting "
"to apply autosaved profile to fix issue"; "to apply autosaved profile to fix issue";
parent->m_chaperoneTabController.applyAutosavedProfile(); parent->m_chaperoneTabController.applyAutosavedProfile();
} }
@@ -940,7 +937,7 @@ void MoveCenterTabController::incomingZeroReset()
// and reseting our stage counter // and reseting our stage counter
if ( m_recenterStages == 1 ) if ( m_recenterStages == 1 )
{ {
LOG( INFO ) << "Recenter Stage 2 re-set zero pos, and reset offsets"; qInfo() << "Recenter Stage 2 re-set zero pos, and reset offsets";
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose( vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
&m_universeCenterForReset ); &m_universeCenterForReset );
vr::VRChaperoneSetup()->GetWorkingSeatedZeroPoseToRawTrackingPose( vr::VRChaperoneSetup()->GetWorkingSeatedZeroPoseToRawTrackingPose(
@@ -956,12 +953,12 @@ void MoveCenterTabController::reset()
// DO NOT attempt to apply autosaved profile on reset, as it is triggered by // DO NOT attempt to apply autosaved profile on reset, as it is triggered by
// the apply chaperone profile Side effects are bad! // the apply chaperone profile Side effects are bad!
auto calState = vr::VRChaperone()->GetCalibrationState(); auto calState = vr::VRChaperone()->GetCalibrationState();
LOG( INFO ) << "Calibration State on Reset is: " << calState; qInfo() << "Calibration State on Reset is: " << calState;
if ( !m_chaperoneBasisAcquired ) if ( !m_chaperoneBasisAcquired )
{ {
LOG( WARNING ) << "WARNING: Attempted reset offsets before chaperone " qWarning() << "WARNING: Attempted reset offsets before chaperone "
"basis is acquired!"; "basis is acquired!";
return; return;
} }
m_heightToggle = false; m_heightToggle = false;
@@ -1035,65 +1032,62 @@ void MoveCenterTabController::zeroOffsets()
- ( m_rotation * k_centidegreesToRadians ) ); - ( m_rotation * k_centidegreesToRadians ) );
if ( abs( currentCenterXyz[0] ) > k_maxOpenvrCommitOffset ) if ( abs( currentCenterXyz[0] ) > k_maxOpenvrCommitOffset )
{ {
LOG( INFO ) << "Attempted Zero Offsets out of commit bounds ( X: " qInfo() << "Attempted Zero Offsets out of commit bounds ( X: "
<< currentCenterXyz[0] << " )"; << currentCenterXyz[0] << " )";
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose"; qInfo() << "GetWorkingStandingZeroPoseToRawTrackingPose";
outputLogHmdMatrix( currentCenter ); outputLogHmdMatrix( currentCenter );
// if reset happens before init is complete we set the universe // if reset happens before init is complete we set the universe
// center to the raw tracking zero point // center to the raw tracking zero point
reset(); reset();
if ( !m_chaperoneBasisAcquired ) if ( !m_chaperoneBasisAcquired )
{ {
LOG( WARNING ) qWarning() << "<[!]><[!]>EXECUTED RESET BEFORE BASIS "
<< "<[!]><[!]>EXECUTED RESET BEFORE BASIS " "ACQUIRED<[!]><[!]> "
"ACQUIRED<[!]><[!]> " "Setting universe center to raw tracking zero point.";
"Setting universe center to raw tracking zero point.";
} }
else else
{ {
LOG( INFO ) << "-Resetting offsets-"; qInfo() << "-Resetting offsets-";
} }
} }
else if ( abs( currentCenterXyz[1] ) > k_maxOpenvrCommitOffset ) else if ( abs( currentCenterXyz[1] ) > k_maxOpenvrCommitOffset )
{ {
LOG( INFO ) << "Attempted Zero Offsets out of commit bounds ( Y: " qInfo() << "Attempted Zero Offsets out of commit bounds ( Y: "
<< currentCenterXyz[1] << " )"; << currentCenterXyz[1] << " )";
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose"; qInfo() << "GetWorkingStandingZeroPoseToRawTrackingPose";
outputLogHmdMatrix( currentCenter ); outputLogHmdMatrix( currentCenter );
// if reset happens before init is complete we set the universe // if reset happens before init is complete we set the universe
// center to the raw tracking zero point // center to the raw tracking zero point
reset(); reset();
if ( !m_chaperoneBasisAcquired ) if ( !m_chaperoneBasisAcquired )
{ {
LOG( WARNING ) qWarning() << "<[!]><[!]>EXECUTED RESET BEFORE BASIS "
<< "<[!]><[!]>EXECUTED RESET BEFORE BASIS " "ACQUIRED<[!]><[!]> "
"ACQUIRED<[!]><[!]> " "Setting universe center to raw tracking zero point.";
"Setting universe center to raw tracking zero point.";
} }
else else
{ {
LOG( INFO ) << "-Resetting offsets-"; qInfo() << "-Resetting offsets-";
} }
} }
else if ( abs( currentCenterXyz[2] ) > k_maxOpenvrCommitOffset ) else if ( abs( currentCenterXyz[2] ) > k_maxOpenvrCommitOffset )
{ {
LOG( INFO ) << "Attempted Zero Offsets out of commit bounds ( Z: " qInfo() << "Attempted Zero Offsets out of commit bounds ( Z: "
<< currentCenterXyz[2] << " )"; << currentCenterXyz[2] << " )";
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose"; qInfo() << "GetWorkingStandingZeroPoseToRawTrackingPose";
outputLogHmdMatrix( currentCenter ); outputLogHmdMatrix( currentCenter );
// if reset happens before init is complete we set the universe // if reset happens before init is complete we set the universe
// center to the raw tracking zero point // center to the raw tracking zero point
reset(); reset();
if ( !m_chaperoneBasisAcquired ) if ( !m_chaperoneBasisAcquired )
{ {
LOG( WARNING ) qWarning() << "<[!]><[!]>EXECUTED RESET BEFORE BASIS "
<< "<[!]><[!]>EXECUTED RESET BEFORE BASIS " "ACQUIRED<[!]><[!]> "
"ACQUIRED<[!]><[!]> " "Setting universe center to raw tracking zero point.";
"Setting universe center to raw tracking zero point.";
} }
else else
{ {
LOG( INFO ) << "-Resetting offsets-"; qInfo() << "-Resetting offsets-";
} }
} }
m_oldOffsetX = 0.0f; m_oldOffsetX = 0.0f;
@@ -1121,7 +1115,7 @@ void MoveCenterTabController::zeroOffsets()
auto calState = vr::VRChaperone()->GetCalibrationState(); auto calState = vr::VRChaperone()->GetCalibrationState();
if ( calState == 200 ) if ( calState == 200 )
{ {
LOG( WARNING ) qWarning()
<< "Chaperone State Does Not Exist Yet, will wait for " << "Chaperone State Does Not Exist Yet, will wait for "
"universe change to finish initialization"; "universe change to finish initialization";
} }
@@ -1135,13 +1129,13 @@ void MoveCenterTabController::zeroOffsets()
else else
{ {
// shutdown was unsafe last session! // shutdown was unsafe last session!
LOG( WARNING ) << "DETECTED UNSAFE SHUTDOWN FROM LAST SESSION"; qWarning() << "DETECTED UNSAFE SHUTDOWN FROM LAST SESSION";
m_initComplete = false; m_initComplete = false;
if ( !parent->crashRecoveryDisabled() ) if ( !parent->crashRecoveryDisabled() )
{ {
parent->m_chaperoneTabController.applyAutosavedProfile(); parent->m_chaperoneTabController.applyAutosavedProfile();
LOG( INFO ) << "Applying last good chaperone " qInfo() << "Applying last good chaperone "
"profile autosave"; "profile autosave";
} }
} }
// Now mark previous shutdown as unsafe in case we crash // Now mark previous shutdown as unsafe in case we crash
@@ -1154,11 +1148,11 @@ void MoveCenterTabController::zeroOffsets()
} }
if ( m_roomSetupModeDetected ) if ( m_roomSetupModeDetected )
{ {
LOG( INFO ) << "room setup EXIT detected"; qInfo() << "room setup EXIT detected";
m_roomSetupModeDetected = false; m_roomSetupModeDetected = false;
} }
LOG( INFO ) << "SUCCESS: Chaperone Data Updated and Offsets zeroed out"; qInfo() << "SUCCESS: Chaperone Data Updated and Offsets zeroed out";
} }
void MoveCenterTabController::sendSeatedRecenter() void MoveCenterTabController::sendSeatedRecenter()
@@ -1196,8 +1190,8 @@ void MoveCenterTabController::updateChaperoneResetData()
auto cstate = vr::VRChaperone()->GetCalibrationState(); auto cstate = vr::VRChaperone()->GetCalibrationState();
if ( cstate > 199 ) if ( cstate > 199 )
{ {
LOG( WARNING ) << "Chaperone Calibration State is error: " << cstate qWarning() << "Chaperone Calibration State is error: " << cstate
<< " While Trying to Update Reset Data"; << " While Trying to Update Reset Data";
} }
else else
{ {
@@ -1905,11 +1899,11 @@ void MoveCenterTabController::resetOffsets( bool resetOffsetsJustPressed )
emit rotationChanged( m_rotation ); emit rotationChanged( m_rotation );
updateSpace( true ); updateSpace( true );
auto calState = vr::VRChaperone()->GetCalibrationState(); auto calState = vr::VRChaperone()->GetCalibrationState();
LOG( INFO ) << "Calibration State on Reset Offsets is: " << calState; qInfo() << "Calibration State on Reset Offsets is: " << calState;
// if ( calState > 199 && m_initComplete ) // if ( calState > 199 && m_initComplete )
// { // {
// LOG( INFO ) << "Chaperone calibration state is error, // qInfo() << "Chaperone calibration state is error,
// attempting " // attempting "
// "to apply autosaved profile to fix issue"; // "to apply autosaved profile to fix issue";
// parent->m_chaperoneTabController.applyAutosavedProfile(); // parent->m_chaperoneTabController.applyAutosavedProfile();
@@ -2139,8 +2133,8 @@ void MoveCenterTabController::updateHmdRotationCounter(
} }
else else
{ {
LOG( WARNING ) << "HMD Was Inverted during a Turn Count, Turn " qWarning() << "HMD Was Inverted during a Turn Count, Turn "
"counter may be in-accurate"; "counter may be in-accurate";
} }
} }
@@ -2586,16 +2580,16 @@ void MoveCenterTabController::updateSpace( bool forceUpdate )
> k_maxOvrasUniverseCenteredTurningOffset > k_maxOvrasUniverseCenteredTurningOffset
&& universeCenteredRotation() ) ) && universeCenteredRotation() ) )
{ {
LOG( INFO ) << "Raw universe center out of bounds ( X: " qInfo() << "Raw universe center out of bounds ( X: "
<< offsetUniverseCenterXyz[0] << " )"; << offsetUniverseCenterXyz[0] << " )";
vr::HmdMatrix34_t standingZero; vr::HmdMatrix34_t standingZero;
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose( vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
&standingZero ); &standingZero );
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose"; qInfo() << "GetWorkingStandingZeroPoseToRawTrackingPose";
outputLogHmdMatrix( standingZero ); outputLogHmdMatrix( standingZero );
reset(); reset();
parent->m_chaperoneTabController.applyAutosavedProfile(); parent->m_chaperoneTabController.applyAutosavedProfile();
LOG( INFO ) << "-Resetting to autosaved chaperone profile-"; qInfo() << "-Resetting to autosaved chaperone profile-";
return; return;
} }
if ( abs( offsetUniverseCenterXyz[1] ) > k_maxOpenvrWorkingSetOffest if ( abs( offsetUniverseCenterXyz[1] ) > k_maxOpenvrWorkingSetOffest
@@ -2603,16 +2597,16 @@ void MoveCenterTabController::updateSpace( bool forceUpdate )
> k_maxOvrasUniverseCenteredTurningOffset > k_maxOvrasUniverseCenteredTurningOffset
&& universeCenteredRotation() ) ) && universeCenteredRotation() ) )
{ {
LOG( INFO ) << "Raw universe center out of bounds ( Y: " qInfo() << "Raw universe center out of bounds ( Y: "
<< offsetUniverseCenterXyz[1] << " )"; << offsetUniverseCenterXyz[1] << " )";
vr::HmdMatrix34_t standingZero; vr::HmdMatrix34_t standingZero;
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose( vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
&standingZero ); &standingZero );
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose"; qInfo() << "GetWorkingStandingZeroPoseToRawTrackingPose";
outputLogHmdMatrix( standingZero ); outputLogHmdMatrix( standingZero );
reset(); reset();
parent->m_chaperoneTabController.applyAutosavedProfile(); parent->m_chaperoneTabController.applyAutosavedProfile();
LOG( INFO ) << "-Resetting to autosaved chaperone profile-"; qInfo() << "-Resetting to autosaved chaperone profile-";
return; return;
} }
if ( abs( offsetUniverseCenterXyz[2] ) > k_maxOpenvrWorkingSetOffest if ( abs( offsetUniverseCenterXyz[2] ) > k_maxOpenvrWorkingSetOffest
@@ -2620,16 +2614,16 @@ void MoveCenterTabController::updateSpace( bool forceUpdate )
> k_maxOvrasUniverseCenteredTurningOffset > k_maxOvrasUniverseCenteredTurningOffset
&& universeCenteredRotation() ) ) && universeCenteredRotation() ) )
{ {
LOG( INFO ) << "Raw universe center out of bounds ( Z: " qInfo() << "Raw universe center out of bounds ( Z: "
<< offsetUniverseCenterXyz[2] << " )"; << offsetUniverseCenterXyz[2] << " )";
vr::HmdMatrix34_t standingZero; vr::HmdMatrix34_t standingZero;
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose( vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
&standingZero ); &standingZero );
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose"; qInfo() << "GetWorkingStandingZeroPoseToRawTrackingPose";
outputLogHmdMatrix( standingZero ); outputLogHmdMatrix( standingZero );
reset(); reset();
parent->m_chaperoneTabController.applyAutosavedProfile(); parent->m_chaperoneTabController.applyAutosavedProfile();
LOG( INFO ) << "-Resetting to autosaved chaperone profile-"; qInfo() << "-Resetting to autosaved chaperone profile-";
return; return;
} }
@@ -2751,7 +2745,7 @@ void MoveCenterTabController::eventLoopTick(
// the middle of room setup. // the middle of room setup.
m_pendingZeroOffsets = false; m_pendingZeroOffsets = false;
LOG( INFO ) << "room setup ENTRY detected"; qInfo() << "room setup ENTRY detected";
vr::VRChaperoneSetup()->HideWorkingSetPreview(); vr::VRChaperoneSetup()->HideWorkingSetPreview();
reset(); reset();
vr::VRChaperoneSetup()->RevertWorkingCopy(); vr::VRChaperoneSetup()->RevertWorkingCopy();
@@ -2765,7 +2759,7 @@ void MoveCenterTabController::eventLoopTick(
if ( universe == vr::TrackingUniverseSeated && !m_seatedModeDetected ) if ( universe == vr::TrackingUniverseSeated && !m_seatedModeDetected )
{ {
m_seatedModeDetected = true; m_seatedModeDetected = true;
LOG( INFO ) << "seated mode ENTRY detected"; qInfo() << "seated mode ENTRY detected";
} }
// detect exiting seated mode // detect exiting seated mode
@@ -2773,7 +2767,7 @@ void MoveCenterTabController::eventLoopTick(
{ {
m_seatedModeDetected = false; m_seatedModeDetected = false;
reset(); reset();
LOG( INFO ) << "seated mode EXIT detected"; qInfo() << "seated mode EXIT detected";
} }
// If we're trying to redifine the origin point, but can't becaues of // If we're trying to redifine the origin point, but can't becaues of
+22 -20
View File
@@ -1,5 +1,7 @@
#include "RotationTabController.h" #include "RotationTabController.h"
#include <QQuickWindow> #include <QQuickWindow>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h" #include "../overlaycontroller.h"
#include "../settings/settings.h" #include "../settings/settings.h"
#include "../utils/Matrix.h" #include "../utils/Matrix.h"
@@ -17,6 +19,8 @@ void RotationTabController::initStage1()
void RotationTabController::initStage2( OverlayController* var_parent ) void RotationTabController::initStage2( OverlayController* var_parent )
{ {
this->parent = var_parent;
const auto autoturnOverlayKey const auto autoturnOverlayKey
= std::string( application_strings::applicationKey ) = std::string( application_strings::applicationKey )
+ ".autoturnnotification"; + ".autoturnnotification";
@@ -27,9 +31,9 @@ void RotationTabController::initStage2( OverlayController* var_parent )
&m_autoturnValues.overlayHandle ); &m_autoturnValues.overlayHandle );
if ( overlayError != vr::VROverlayError_None ) if ( overlayError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Could not create autoturn notification overlay: " qCritical() << "Could not create autoturn notification overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( << vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError ); overlayError );
emit defaultProfileDisplay(); emit defaultProfileDisplay();
@@ -70,8 +74,6 @@ void RotationTabController::initStage2( OverlayController* var_parent )
&notificationTransform ); &notificationTransform );
emit defaultProfileDisplay(); emit defaultProfileDisplay();
this->parent = var_parent;
} }
void RotationTabController::eventLoopTick( void RotationTabController::eventLoopTick(
@@ -401,9 +403,9 @@ void RotationTabController::doAutoTurn(
// Ignore if the wall we encountered is behind us // Ignore if the wall we encountered is behind us
if ( std::abs( hmdToWallYaw ) >= M_PI / 2 ) if ( std::abs( hmdToWallYaw ) >= M_PI / 2 )
{ {
LOG( DEBUG ) << "Ignoring turn in opposite " qDebug() << "Ignoring turn in opposite "
"direction (angle " "direction (angle "
<< std::abs( hmdToWallYaw ) << ")"; << std::abs( hmdToWallYaw ) << ")";
break; break;
} }
@@ -426,7 +428,7 @@ void RotationTabController::doAutoTurn(
// previous wall than the left. // previous wall than the left.
turnLeft = m_autoTurnWallActive[circularIndex( turnLeft = m_autoTurnWallActive[circularIndex(
i, false, chaperoneDistances.size() )]; i, false, chaperoneDistances.size() )];
LOG( DEBUG ) << "turning away from shared corner"; qDebug() << "turning away from shared corner";
} }
// If within m_cordDetanglingAngle degrees of // If within m_cordDetanglingAngle degrees of
// 'straight at a wall', start in whatever direction // 'straight at a wall', start in whatever direction
@@ -440,19 +442,19 @@ void RotationTabController::doAutoTurn(
turnLeft = ( parent->m_moveCenterTabController turnLeft = ( parent->m_moveCenterTabController
.getHmdYawTotal() .getHmdYawTotal()
< 0.0 ); < 0.0 );
LOG( DEBUG ) << "turning to detangle cord"; qDebug() << "turning to detangle cord";
} }
// Turn the closest angle to the wall // Turn the closest angle to the wall
else else
{ {
turnLeft = hmdToWallYaw > 0.0; turnLeft = hmdToWallYaw > 0.0;
LOG( DEBUG ) << "turning closest angle to wall"; qDebug() << "turning closest angle to wall";
} }
LOG( DEBUG ) << "hmd yaw " << hmdYaw qDebug() << "hmd yaw " << hmdYaw
<< ", hmd position to wall angle " << ", hmd position to wall angle "
<< hmdPositionToWallYaw; << hmdPositionToWallYaw;
LOG( DEBUG ) << "hmd to wall angle " << hmdToWallYaw; qDebug() << "hmd to wall angle " << hmdToWallYaw;
// Positive hmd-to-wall is facing left, negative is // Positive hmd-to-wall is facing left, negative is
// facing right (relative to the wall) // facing right (relative to the wall)
double delta_degrees double delta_degrees
@@ -488,17 +490,17 @@ void RotationTabController::doAutoTurn(
= static_cast<double>( std::atan2( = static_cast<double>( std::atan2(
middleCorner.v[0] - touchingWallCorner.v[0], middleCorner.v[0] - touchingWallCorner.v[0],
middleCorner.v[2] - touchingWallCorner.v[2] ) ); middleCorner.v[2] - touchingWallCorner.v[2] ) );
LOG( DEBUG ) << "twa: " << touchingWallAngle qDebug() << "twa: " << touchingWallAngle
<< ", nwa: " << newWallAngle << ", diff: " << ", nwa: " << newWallAngle << ", diff: "
<< ( newWallAngle - touchingWallAngle ); << ( newWallAngle - touchingWallAngle );
delta_degrees = ( newWallAngle - touchingWallAngle delta_degrees = ( newWallAngle - touchingWallAngle
+ ( turnLeft ? M_PI : -M_PI ) ) + ( turnLeft ? M_PI : -M_PI ) )
* k_radiansToCentidegrees; * k_radiansToCentidegrees;
delta_degrees delta_degrees
= reduceAngle<>( delta_degrees, -18000.0, 18000.0 ); = reduceAngle<>( delta_degrees, -18000.0, 18000.0 );
} }
LOG( DEBUG ) << "rotating space " << ( delta_degrees / 100 ) qDebug() << "rotating space " << ( delta_degrees / 100 )
<< " degrees"; << " degrees";
switch ( RotationTabController::autoTurnModeType() ) switch ( RotationTabController::autoTurnModeType() )
{ {
case AutoTurnModes::SNAP: case AutoTurnModes::SNAP:
+5 -3
View File
@@ -1,5 +1,7 @@
#include "SettingsTabController.h" #include "SettingsTabController.h"
#include <QQuickWindow> #include <QQuickWindow>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h" #include "../overlaycontroller.h"
#include "../utils/update_rate.h" #include "../utils/update_rate.h"
@@ -105,9 +107,9 @@ void SettingsTabController::setAutoStartEnabled( bool value, bool notify )
application_strings::applicationKey, m_autoStartEnabled ); application_strings::applicationKey, m_autoStartEnabled );
if ( apperror != vr::VRApplicationError_None ) if ( apperror != vr::VRApplicationError_None )
{ {
LOG( ERROR ) << "Could not set auto start: " qCritical() << "Could not set auto start: "
<< vr::VRApplications() << vr::VRApplications()
->GetApplicationsErrorNameFromEnum( apperror ); ->GetApplicationsErrorNameFromEnum( apperror );
} }
if ( notify ) if ( notify )
{ {
+40 -39
View File
@@ -1,5 +1,7 @@
#include "SteamVRTabController.h" #include "SteamVRTabController.h"
#include <QQuickWindow> #include <QQuickWindow>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h" #include "../overlaycontroller.h"
#include "../utils/update_rate.h" #include "../utils/update_rate.h"
#include <QDesktopServices> #include <QDesktopServices>
@@ -504,7 +506,7 @@ void SteamVRTabController::launchBindingUI()
&inputHandle ); &inputHandle );
if ( error2 != vr::VRInputError_None ) if ( error2 != vr::VRInputError_None )
{ {
LOG( ERROR ) qCritical()
<< "failed to get input handle? is your right controller on?"; << "failed to get input handle? is your right controller on?";
} }
if ( parent->isDesktopMode() ) if ( parent->isDesktopMode() )
@@ -517,7 +519,7 @@ void SteamVRTabController::launchBindingUI()
application_strings::applicationKey, actionHandle, inputHandle, false ); application_strings::applicationKey, actionHandle, inputHandle, false );
if ( error != vr::VRInputError_None ) if ( error != vr::VRInputError_None )
{ {
LOG( ERROR ) << "Input Error: " << error; qCritical() << "Input Error: " << error;
} }
} }
void SteamVRTabController::restartSteamVR() void SteamVRTabController::restartSteamVR()
@@ -525,7 +527,7 @@ void SteamVRTabController::restartSteamVR()
QString cmd = QString( "cmd.exe /C restartvrserver.bat \"" ) QString cmd = QString( "cmd.exe /C restartvrserver.bat \"" )
+ parent->getVRRuntimePathUrl().toLocalFile() + parent->getVRRuntimePathUrl().toLocalFile()
+ QString( "\"" ); + QString( "\"" );
LOG( INFO ) << "SteamVR Restart Command: " << cmd; qInfo() << "SteamVR Restart Command: " << cmd;
QProcess::startDetached( cmd ); QProcess::startDetached( cmd );
} }
@@ -561,8 +563,8 @@ Q_INVOKABLE void SteamVRTabController::pairDevice( QString sn )
{ {
if ( !isSteamVRTracked( sn ) ) if ( !isSteamVRTracked( sn ) )
{ {
LOG( WARNING ) << sn.toStdString() qWarning() << sn.toStdString()
<< " Is Not a SteamVR Dongle, skipping Pair"; << " Is Not a SteamVR Dongle, skipping Pair";
return; return;
} }
m_last_pair_sn = sn; m_last_pair_sn = sn;
@@ -603,26 +605,26 @@ void SteamVRTabController::onConnected()
emit pairStatusChanged( QString( "Pairing..." ) ); emit pairStatusChanged( QString( "Pairing..." ) );
if ( m_last_pair_sn == "" ) if ( m_last_pair_sn == "" )
{ {
LOG( ERROR ) << "No Last SN to pair, this shouldn't happen"; qCritical() << "No Last SN to pair, this shouldn't happen";
} }
m_webSocket.sendTextMessage( messageout ); m_webSocket.sendTextMessage( messageout );
// m_webSocket.close(); // m_webSocket.close();
} }
void SteamVRTabController::onDisconnect() void SteamVRTabController::onDisconnect()
{ {
LOG( INFO ) << "Pair WS disconnect"; qInfo() << "Pair WS disconnect";
m_webSocket.close(); m_webSocket.close();
} }
void SteamVRTabController::onMsgRec( QString Msg ) void SteamVRTabController::onMsgRec( QString Msg )
{ {
if ( Msg.contains( "success" ) ) if ( Msg.contains( "success" ) )
{ {
LOG( INFO ) << "Pair Success"; qInfo() << "Pair Success";
emit pairStatusChanged( QString( "Success" ) ); emit pairStatusChanged( QString( "Success" ) );
} }
if ( Msg.contains( "timeout" ) ) if ( Msg.contains( "timeout" ) )
{ {
LOG( INFO ) << "Pair Timeout"; qInfo() << "Pair Timeout";
emit pairStatusChanged( QString( "Timeout" ) ); emit pairStatusChanged( QString( "Timeout" ) );
} }
m_webSocket.close(); m_webSocket.close();
@@ -691,15 +693,15 @@ void SteamVRTabController::onGetBindingUrlResponse( QNetworkReply* reply )
std::string controllerName = ovr_system_wrapper::getControllerName(); std::string controllerName = ovr_system_wrapper::getControllerName();
if ( controllerName == "" ) if ( controllerName == "" )
{ {
LOG( WARNING ) << "No Controller Detected Skipping Bindings"; qWarning() << "No Controller Detected Skipping Bindings";
return; return;
} }
json jsonfull = json::parse( data.toStdString() ); json jsonfull = json::parse( data.toStdString() );
// LOG( INFO ) << "URL RESPOSNE XXXXXXX"; // qInfo () << "URL RESPOSNE XXXXXXX";
// LOG( INFO ) << jsonfull.dump().c_str(); // qInfo () << jsonfull.dump().c_str();
std::string filepath std::string filepath
= jsonfull["current_binding_url"][controllerName].get<std::string>(); = jsonfull["current_binding_url"][controllerName].get<std::string>();
LOG( INFO ) << "binding url at " << filepath; qInfo() << "binding url at " << filepath;
// TODO perhaps some form of error checking if packet wrong? // TODO perhaps some form of error checking if packet wrong?
reply->close(); reply->close();
getBindingDataReq( filepath, m_lastAppID, controllerName ); getBindingDataReq( filepath, m_lastAppID, controllerName );
@@ -738,24 +740,24 @@ void SteamVRTabController::onGetBindingDataResponse( QNetworkReply* reply )
{ {
return; return;
} }
// LOG( WARNING ) << "DATA RESPONSE"; // qWarning () << "DATA RESPONSE";
// LOG( WARNING ) << data.toStdString(); // qWarning () << data.toStdString();
json jsonfull = json::parse( data.toStdString() ); json jsonfull = json::parse( data.toStdString() );
if ( !jsonfull.contains( "success" ) ) if ( !jsonfull.contains( "success" ) )
{ {
LOG( ERROR ) << "Binding Data Packet Mal-Formed?"; qCritical() << "Binding Data Packet Mal-Formed?";
} }
if ( !jsonfull["success"].get<bool>() ) if ( !jsonfull["success"].get<bool>() )
{ {
// TODO better error handling? // TODO better error handling?
LOG( ERROR ) << "Binding Data Request Failed"; qCritical() << "Binding Data Request Failed";
} }
reply->close(); reply->close();
output = jsonfull["binding_config"]; output = jsonfull["binding_config"];
std::string sceneAppID = ovr_application_wrapper::getSceneAppID(); std::string sceneAppID = ovr_application_wrapper::getSceneAppID();
if ( sceneAppID == "error" ) if ( sceneAppID == "error" )
{ {
LOG( ERROR ) << "aborting bind save, could not find scene app ID"; qCritical() << "aborting bind save, could not find scene app ID";
return; return;
} }
std::string ctrl = ovr_system_wrapper::getControllerName(); std::string ctrl = ovr_system_wrapper::getControllerName();
@@ -795,11 +797,11 @@ bool SteamVRTabController::saveBind( std::string appID,
bindFile.close(); bindFile.close();
if ( bindFile.exists() ) if ( bindFile.exists() )
{ {
LOG( INFO ) << ( def ? "Default " : ( sceneAppID + " " ) ) qInfo() << ( def ? "Default " : ( sceneAppID + " " ) )
+ "Binding File saved at:" + "Binding File saved at:"
<< absPath.toStdString(); << absPath.toStdString();
std::string jsonstring = binds.dump().c_str(); std::string jsonstring = binds.dump().c_str();
LOG( INFO ) << jsonstring; qInfo() << jsonstring;
return true; return true;
} }
return false; return false;
@@ -861,7 +863,7 @@ void SteamVRTabController::applyBindingReq( std::string appID )
std::string sceneAppID = ovr_application_wrapper::getSceneAppID(); std::string sceneAppID = ovr_application_wrapper::getSceneAppID();
if ( sceneAppID == "" ) if ( sceneAppID == "" )
{ {
LOG( ERROR ) << "NO Scene App Detected unable to apply bindings"; qCritical() << "NO Scene App Detected unable to apply bindings";
return; return;
} }
@@ -870,14 +872,14 @@ void SteamVRTabController::applyBindingReq( std::string appID )
+ ctrlType + ".json" ); + ctrlType + ".json" );
if ( !QFileInfo::exists( fi.absolutePath() + QString( "/" ) + Fn ) ) if ( !QFileInfo::exists( fi.absolutePath() + QString( "/" ) + Fn ) )
{ {
LOG( INFO ) << "No Specific Binding Detected for: " + appID qInfo() << "No Specific Binding Detected for: " + appID
+ "for Scene: " + sceneAppID + " Checking Default"; + "for Scene: " + sceneAppID + " Checking Default";
Fn = QString::fromStdString( "defovl" + appID + "ctrl" + ctrlType Fn = QString::fromStdString( "defovl" + appID + "ctrl" + ctrlType
+ ".json" ); + ".json" );
if ( !QFileInfo::exists( fi.absolutePath() + QString( "/" ) + Fn ) ) if ( !QFileInfo::exists( fi.absolutePath() + QString( "/" ) + Fn ) )
{ {
LOG( INFO ) << "No Def Binding Detected for: " + appID qInfo() << "No Def Binding Detected for: " + appID
+ " Not Adjusting Bindings"; + " Not Adjusting Bindings";
return; return;
} }
} }
@@ -886,14 +888,13 @@ void SteamVRTabController::applyBindingReq( std::string appID )
QUrl urlized = QUrl::fromLocalFile( absPath ); QUrl urlized = QUrl::fromLocalFile( absPath );
// std::string filePath = "file:///" + absPath.toStdString(); // std::string filePath = "file:///" + absPath.toStdString();
std::string url = "http://localhost:27062/input/selectconfig.action"; std::string url = "http://localhost:27062/input/selectconfig.action";
// LOG( INFO ) << urlized.toEncoded().toStdString(); // qInfo () << urlized.toEncoded().toStdString();
QUrl urls = QUrl( url.c_str() ); QUrl urls = QUrl( url.c_str() );
QNetworkRequest request; QNetworkRequest request;
request.setUrl( urls ); request.setUrl( urls );
LOG( INFO ) << "Attempting to Apply Binding at: " qInfo() << "Attempting to Apply Binding at: "
<< urlized << urlized.toEncoded( QUrl::EncodeSpaces | QUrl::EncodeReserved )
.toEncoded( QUrl::EncodeSpaces | QUrl::EncodeReserved ) .toStdString();
.toStdString();
// This is Important as otherwise Valve's VRWebServerWillIgnore the Request // This is Important as otherwise Valve's VRWebServerWillIgnore the Request
// If referrer is wrong // If referrer is wrong
request.setHeader( QNetworkRequest::ContentTypeHeader, request.setHeader( QNetworkRequest::ContentTypeHeader,
@@ -909,8 +910,8 @@ void SteamVRTabController::applyBindingReq( std::string appID )
.toStdString() .toStdString()
+ "\"}" ) + "\"}" )
.c_str(); .c_str();
// LOG( INFO ) << "Sending Binding Set Request"; // qInfo () << "Sending Binding Set Request";
// LOG( INFO ) << data.toStdString(); // qInfo () << data.toStdString();
connect( &m_networkManagerApply, connect( &m_networkManagerApply,
SIGNAL( finished( QNetworkReply* ) ), SIGNAL( finished( QNetworkReply* ) ),
this, this,
@@ -926,21 +927,21 @@ void SteamVRTabController::onApplyBindingResponse( QNetworkReply* reply )
{ {
return; return;
} }
// LOG( INFO ) << "APPLY RESPONSE"; // qInfo () << "APPLY RESPONSE";
// LOG( INFO ) << data.toStdString(); // qInfo () << data.toStdString();
reply->close(); reply->close();
json jsonfull = json::parse( data.toStdString() ); json jsonfull = json::parse( data.toStdString() );
if ( !jsonfull.contains( "success" ) ) if ( !jsonfull.contains( "success" ) )
{ {
LOG( ERROR ) << "Apply Binding Packet Mal-Formed?"; qCritical() << "Apply Binding Packet Mal-Formed?";
return; return;
} }
if ( !jsonfull["success"].get<bool>() ) if ( !jsonfull["success"].get<bool>() )
{ {
// TODO better error handling? // TODO better error handling?
LOG( ERROR ) << "Binding Failed To Apply"; qCritical() << "Binding Failed To Apply";
} }
LOG( INFO ) << "New Binding Applied"; qInfo() << "New Binding Applied";
return; return;
} }
+18 -17
View File
@@ -1,6 +1,8 @@
#include "UtilitiesTabController.h" #include "UtilitiesTabController.h"
#include <QQuickWindow> #include <QQuickWindow>
#include <QApplication> #include <QApplication>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h" #include "../overlaycontroller.h"
#include "../keyboard_input/input_sender.h" #include "../keyboard_input/input_sender.h"
#include "../settings/settings.h" #include "../settings/settings.h"
@@ -236,8 +238,8 @@ QString getBatteryIconPath( int batteryState )
if ( !batteryPath.has_value() ) if ( !batteryPath.has_value() )
{ {
LOG( ERROR ) << "Unable to find battery image number '" << batteryState qCritical() << "Unable to find battery image number '" << batteryState
<< "'."; << "'.";
return ""; return "";
} }
@@ -276,19 +278,19 @@ vr::VROverlayHandle_t UtilitiesTabController::createBatteryOverlay(
} }
vr::VROverlay()->SetOverlayTransformTrackedDeviceRelative( vr::VROverlay()->SetOverlayTransformTrackedDeviceRelative(
handle, index, &notificationTransform ); handle, index, &notificationTransform );
LOG( INFO ) << "Created battery overlay for device " << index; qInfo() << "Created battery overlay for device " << index;
} }
else else
{ {
LOG( ERROR ) << "Could not find battery icon \"" << batteryIconPath qCritical() << "Could not find battery icon \"" << batteryIconPath
<< "\""; << "\"";
} }
} }
else else
{ {
LOG( ERROR ) << "Could not create ptt notification overlay: " qCritical() << "Could not create ptt notification overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( << vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError ); overlayError );
} }
return handle; return handle;
@@ -306,8 +308,8 @@ void UtilitiesTabController::destroyBatteryOverlays()
el = 0; el = 0;
if ( err != vr::VROverlayError_None ) if ( err != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Could not Delete Battery Overlay: " qCritical() << "Could not Delete Battery Overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( err ); << vr::VROverlay()->GetOverlayErrorNameFromEnum( err );
} }
} }
} }
@@ -337,7 +339,7 @@ void UtilitiesTabController::handleTrackerBatOvl()
} }
} }
LOG( INFO ) << "Creating battery overlay for device " << i; qInfo() << "Creating battery overlay for device " << i;
m_batteryOverlayHandles[i] = createBatteryOverlay( i, style ); m_batteryOverlayHandles[i] = createBatteryOverlay( i, style );
m_batteryVisible[i] = true; m_batteryVisible[i] = true;
} }
@@ -373,10 +375,9 @@ void UtilitiesTabController::handleTrackerBatOvl()
if ( batteryState != m_batteryState[i] ) if ( batteryState != m_batteryState[i] )
{ {
LOG( INFO ) qInfo() << "Updating battery overlay for device " << i
<< "Updating battery overlay for device " << i << " to " << " to " << batteryState << "(" << battery << ")"
<< batteryState << "(" << battery << ")" << QString::number( m_batteryOverlayHandles[i] );
<< QString::number( m_batteryOverlayHandles[i] );
QString batteryIconPath QString batteryIconPath
= getBatteryIconPath( batteryState ); = getBatteryIconPath( batteryState );
if ( QFile::exists( batteryIconPath ) ) if ( QFile::exists( batteryIconPath ) )
@@ -387,8 +388,8 @@ void UtilitiesTabController::handleTrackerBatOvl()
} }
else else
{ {
LOG( ERROR ) << "Could not find battery icon \"" qCritical() << "Could not find battery icon \""
<< batteryIconPath << "\""; << batteryIconPath << "\"";
} }
m_batteryState[i] = batteryState; m_batteryState[i] = batteryState;
} }
+72 -71
View File
@@ -1,6 +1,8 @@
#include "VideoTabController.h" #include "VideoTabController.h"
#include <QQuickWindow> #include <QQuickWindow>
#include <QApplication> #include <QApplication>
#include <QtLogging>
#include <QtDebug>
#include "../settings/settings.h" #include "../settings/settings.h"
#include "../overlaycontroller.h" #include "../overlaycontroller.h"
#include "../utils/update_rate.h" #include "../utils/update_rate.h"
@@ -71,15 +73,15 @@ void VideoTabController::initBrightnessOverlay()
} }
else else
{ {
LOG( ERROR ) << "Could not find brightness overlay \"" qCritical() << "Could not find brightness overlay \""
<< video_keys::k_brightnessOverlayFilename << "\""; << video_keys::k_brightnessOverlayFilename << "\"";
} }
} }
else else
{ {
LOG( ERROR ) << "Could not create brightness overlay: " qCritical() << "Could not create brightness overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( << vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError ); overlayError );
} }
setBrightnessOpacityValue( brightnessOpacityValue(), false ); setBrightnessOpacityValue( brightnessOpacityValue(), false );
} }
@@ -116,15 +118,15 @@ void VideoTabController::initColorOverlay()
} }
else else
{ {
LOG( ERROR ) << "Could not find Base color overlay: \"" qCritical() << "Could not find Base color overlay: \""
<< video_keys::k_colorOverlayFilename << "\""; << video_keys::k_colorOverlayFilename << "\"";
} }
} }
else else
{ {
LOG( ERROR ) << "Could not create color overlay: " qCritical() << "Could not create color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( << vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError ); overlayError );
} }
} }
@@ -134,18 +136,18 @@ void VideoTabController::loadColorOverlay()
m_colorOverlayHandle, colorRed(), colorGreen(), colorBlue() ); m_colorOverlayHandle, colorRed(), colorGreen(), colorBlue() );
if ( overlayError != vr::VROverlayError_None ) if ( overlayError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Could not set Colors for color overlay: " qCritical() << "Could not set Colors for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( << vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError ); overlayError );
} }
overlayError = vr::VROverlay()->SetOverlayAlpha( m_colorOverlayHandle, overlayError = vr::VROverlay()->SetOverlayAlpha( m_colorOverlayHandle,
colorOverlayOpacity() ); colorOverlayOpacity() );
if ( overlayError != vr::VROverlayError_None ) if ( overlayError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Could not set alpha: " qCritical() << "Could not set alpha: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( << vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError ); overlayError );
} }
emit colorOverlayOpacityChanged( true ); emit colorOverlayOpacityChanged( true );
} }
@@ -214,7 +216,7 @@ void VideoTabController::setBrightnessEnabled( bool value,
setBrightnessOpacityValue( brightnessOpacityValue(), false ); setBrightnessOpacityValue( brightnessOpacityValue(), false );
ovr_overlay_wrapper::showOverlay( ovr_overlay_wrapper::showOverlay(
getBrightnessOverlayHandle() ); getBrightnessOverlayHandle() );
LOG( INFO ) << "Brightness Overlay toggled on"; qInfo() << "Brightness Overlay toggled on";
} }
} }
else else
@@ -223,7 +225,7 @@ void VideoTabController::setBrightnessEnabled( bool value,
{ {
ovr_overlay_wrapper::hideOverlay( ovr_overlay_wrapper::hideOverlay(
getBrightnessOverlayHandle() ); getBrightnessOverlayHandle() );
LOG( INFO ) << "Brightness Overlay toggled off"; qInfo() << "Brightness Overlay toggled off";
} }
} }
@@ -247,7 +249,7 @@ void VideoTabController::setBrightnessOpacityValue( float percvalue,
if ( realvalue >= 0.9999f || realvalue < 0.00f ) if ( realvalue >= 0.9999f || realvalue < 0.00f )
{ {
LOG( WARNING ) << "alpha value is invalid setting to 1.0"; qWarning() << "alpha value is invalid setting to 1.0";
settings::setSetting( settings::setSetting(
settings::DoubleSetting::VIDEO_brightnessOpacityValue, 1.0 ); settings::DoubleSetting::VIDEO_brightnessOpacityValue, 1.0 );
realvalue = 0; realvalue = 0;
@@ -346,7 +348,7 @@ void VideoTabController::setColorOverlayEnabled( bool value,
if ( overlayHandle != vr::k_ulOverlayHandleInvalid ) if ( overlayHandle != vr::k_ulOverlayHandleInvalid )
{ {
ovr_overlay_wrapper::showOverlay( getColorOverlayHandle() ); ovr_overlay_wrapper::showOverlay( getColorOverlayHandle() );
LOG( INFO ) << "Color Overlay toggled on"; qInfo() << "Color Overlay toggled on";
} }
} }
else else
@@ -354,7 +356,7 @@ void VideoTabController::setColorOverlayEnabled( bool value,
if ( overlayHandle != vr::k_ulOverlayHandleInvalid ) if ( overlayHandle != vr::k_ulOverlayHandleInvalid )
{ {
ovr_overlay_wrapper::hideOverlay( getColorOverlayHandle() ); ovr_overlay_wrapper::hideOverlay( getColorOverlayHandle() );
LOG( INFO ) << "Color Overlay toggled off"; qInfo() << "Color Overlay toggled off";
} }
} }
@@ -397,11 +399,11 @@ void VideoTabController::synchGain( bool setValue )
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( WARNING ) << "Could not read \"" qWarning() << "Could not read \""
<< vr::k_pch_SteamVR_HmdDisplayColorGainR_Float << vr::k_pch_SteamVR_HmdDisplayColorGainR_Float
<< "\" setting: " << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
else else
{ {
@@ -418,11 +420,11 @@ void VideoTabController::synchGain( bool setValue )
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( WARNING ) << "Could not read \"" qWarning() << "Could not read \""
<< vr::k_pch_SteamVR_HmdDisplayColorGainB_Float << vr::k_pch_SteamVR_HmdDisplayColorGainB_Float
<< "\" setting: " << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
else else
{ {
@@ -439,11 +441,11 @@ void VideoTabController::synchGain( bool setValue )
&vrSettingsError ); &vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( WARNING ) << "Could not read \"" qWarning() << "Could not read \""
<< vr::k_pch_SteamVR_HmdDisplayColorGainG_Float << vr::k_pch_SteamVR_HmdDisplayColorGainG_Float
<< "\" setting: " << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
else else
{ {
@@ -473,9 +475,9 @@ void VideoTabController::setColorRed( float value, bool notify, bool keepValue )
m_colorOverlayHandle, colorRed(), colorGreen(), colorBlue() ); m_colorOverlayHandle, colorRed(), colorGreen(), colorBlue() );
if ( overlayError != vr::VROverlayError_None ) if ( overlayError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Could not set Red for color overlay: " qCritical() << "Could not set Red for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( << vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError ); overlayError );
} }
} }
else else
@@ -489,13 +491,13 @@ void VideoTabController::setColorRed( float value, bool notify, bool keepValue )
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( ERROR ) << "could not set Red Gain Value, Error: " qCritical() << "could not set Red Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
} }
LOG( DEBUG ) << "Changed Red Value to: " << colorRed(); qDebug() << "Changed Red Value to: " << colorRed();
if ( notify ) if ( notify )
{ {
@@ -523,9 +525,9 @@ void VideoTabController::setColorGreen( float value,
m_colorOverlayHandle, colorRed(), colorGreen(), colorBlue() ); m_colorOverlayHandle, colorRed(), colorGreen(), colorBlue() );
if ( overlayError != vr::VROverlayError_None ) if ( overlayError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Could not set Green for color overlay: " qCritical() << "Could not set Green for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( << vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError ); overlayError );
} }
} }
else else
@@ -539,13 +541,13 @@ void VideoTabController::setColorGreen( float value,
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( ERROR ) << "could not set Green Gain Value, Error: " qCritical() << "could not set Green Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
} }
LOG( DEBUG ) << "Changed Green Value to: " << colorGreen(); qDebug() << "Changed Green Value to: " << colorGreen();
if ( notify ) if ( notify )
{ {
@@ -572,9 +574,9 @@ void VideoTabController::setColorBlue( float value,
m_colorOverlayHandle, colorRed(), colorGreen(), colorBlue() ); m_colorOverlayHandle, colorRed(), colorGreen(), colorBlue() );
if ( overlayError != vr::VROverlayError_None ) if ( overlayError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Could not set Blue for color overlay: " qCritical() << "Could not set Blue for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( << vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError ); overlayError );
} }
} }
else else
@@ -588,13 +590,13 @@ void VideoTabController::setColorBlue( float value,
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( ERROR ) << "could not set Blue Gain Value, Error: " qCritical() << "could not set Blue Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
} }
LOG( DEBUG ) << "Changed Blue Value to: " << colorBlue(); qDebug() << "Changed Blue Value to: " << colorBlue();
if ( notify ) if ( notify )
{ {
@@ -613,9 +615,9 @@ void VideoTabController::resetGain()
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( ERROR ) << "could not set Red Gain Value, Error: " qCritical() << "could not set Red Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
vr::VRSettings()->SetFloat( vr::k_pch_SteamVR_Section, vr::VRSettings()->SetFloat( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_HmdDisplayColorGainG_Float, vr::k_pch_SteamVR_HmdDisplayColorGainG_Float,
@@ -624,9 +626,9 @@ void VideoTabController::resetGain()
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( ERROR ) << "could not set Green Gain Value, Error: " qCritical() << "could not set Green Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
vr::VRSettings()->SetFloat( vr::k_pch_SteamVR_Section, vr::VRSettings()->SetFloat( vr::k_pch_SteamVR_Section,
@@ -636,9 +638,9 @@ void VideoTabController::resetGain()
if ( vrSettingsError != vr::VRSettingsError_None ) if ( vrSettingsError != vr::VRSettingsError_None )
{ {
LOG( ERROR ) << "could not set Blue Gain Value, Error: " qCritical() << "could not set Blue Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( << vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError ); vrSettingsError );
} }
} }
@@ -691,13 +693,12 @@ void VideoTabController::setSuperSampling( float value, const bool notify )
// Mirrors Desktop Clamp // Mirrors Desktop Clamp
if ( value < 0.2f ) if ( value < 0.2f )
{ {
LOG( WARNING ) qWarning() << "Encountered a supersampling value <= 0.2, setting "
<< "Encountered a supersampling value <= 0.2, setting " "supersampling to 1.0";
"supersampling to 1.0";
value = 1.0f; value = 1.0f;
} }
LOG( DEBUG ) << "Supersampling value changed: " << m_superSampling qDebug() << "Supersampling value changed: " << m_superSampling << " => "
<< " => " << value; << value;
m_superSampling = value; m_superSampling = value;
ovr_settings_wrapper::setFloat( ovr_settings_wrapper::setFloat(
vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_Section,
@@ -1,4 +1,3 @@
#include <easylogging++.h>
#include "AudioManagerPulse.h" #include "AudioManagerPulse.h"
#include "AudioManagerPulse_internal.h" #include "AudioManagerPulse_internal.h"
#include "../AudioTabController.h" #include "../AudioTabController.h"
@@ -1,7 +1,8 @@
#pragma once #pragma once
#include <pulse/pulseaudio.h> #include <pulse/pulseaudio.h>
#include <string> #include <string>
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
#include "AudioManager.h" #include "AudioManager.h"
// Used to get the compiler to shut up about C4100: unreferenced formal // Used to get the compiler to shut up about C4100: unreferenced formal
@@ -66,58 +67,58 @@ void customPulseLoop()
// Error function // Error function
void dumpPulseAudioState() void dumpPulseAudioState()
{ {
LOG( ERROR ) << "____"; qCritical() << "____";
LOG( ERROR ) << "Dumping PulseAudio state: "; qCritical() << "Dumping PulseAudio state: ";
LOG( ERROR ) << "mainLoop: " << pulseAudioPointers.mainLoop; qCritical() << "mainLoop: " << pulseAudioPointers.mainLoop;
LOG( ERROR ) << "api: " << pulseAudioPointers.api; qCritical() << "api: " << pulseAudioPointers.api;
LOG( ERROR ) << "context: " << pulseAudioPointers.context; qCritical() << "context: " << pulseAudioPointers.context;
LOG( ERROR ) << ""; qCritical() << "";
LOG( ERROR ) << "Data:"; qCritical() << "Data:";
LOG( ERROR ) << "\tdefaultSinkOutputDeviceId: " qCritical() << "\tdefaultSinkOutputDeviceId: "
<< pulseAudioData.defaultSinkOutputDeviceId; << pulseAudioData.defaultSinkOutputDeviceId;
LOG( ERROR ) << "\tdefaultSourceInputDeviceId: " qCritical() << "\tdefaultSourceInputDeviceId: "
<< pulseAudioData.defaultSourceInputDeviceId; << pulseAudioData.defaultSourceInputDeviceId;
LOG( ERROR ) << ""; qCritical() << "";
LOG( ERROR ) << "\tcurrentDefaultSinkInfo name: " qCritical() << "\tcurrentDefaultSinkInfo name: "
<< pulseAudioData.currentDefaultSinkInfo.name; << pulseAudioData.currentDefaultSinkInfo.name;
LOG( ERROR ) << "\tcurrentDefaultSourceInfo name: " qCritical() << "\tcurrentDefaultSourceInfo name: "
<< pulseAudioData.currentDefaultSourceInfo.name; << pulseAudioData.currentDefaultSourceInfo.name;
LOG( ERROR ) << ""; qCritical() << "";
LOG( ERROR ) << "sinkOutputDevices: "; qCritical() << "sinkOutputDevices: ";
LOG_IF( pulseAudioData.sinkOutputDevices.size() == 0, ERROR ) if ( pulseAudioData.sinkOutputDevices.size() == 0 )
<< "\tOutput devices size zero."; qCritical() << "\tOutput devices size zero.";
for ( const auto& device : pulseAudioData.sinkOutputDevices ) for ( const auto& device : pulseAudioData.sinkOutputDevices )
{ {
LOG( ERROR ) << "\tDevice Name: " << device.name(); qCritical() << "\tDevice Name: " << device.name();
LOG( ERROR ) << "\tDevice Id: " << device.id(); qCritical() << "\tDevice Id: " << device.id();
} }
LOG( ERROR ) << ""; qCritical() << "";
LOG( ERROR ) << "sourceInputDevices: "; qCritical() << "sourceInputDevices: ";
LOG_IF( pulseAudioData.sourceInputDevices.size() == 0, ERROR ) if ( pulseAudioData.sourceInputDevices.size() == 0 )
<< "\tInput devices size zero."; qCritical() << "\tInput devices size zero.";
for ( const auto& device : pulseAudioData.sourceInputDevices ) for ( const auto& device : pulseAudioData.sourceInputDevices )
{ {
LOG( ERROR ) << "\tDevice Name: " << device.name(); qCritical() << "\tDevice Name: " << device.name();
LOG( ERROR ) << "\tDevice Id: " << device.id(); qCritical() << "\tDevice Id: " << device.id();
} }
LOG( ERROR ) << "____"; qCritical() << "____";
} }
PulseAudioIsLastMeaning getIsLastMeaning( const int isLast ) noexcept PulseAudioIsLastMeaning getIsLastMeaning( const int isLast ) noexcept
{ {
if ( isLast < 0 ) if ( isLast < 0 )
{ {
LOG( ERROR ) << "Error in isLast."; qCritical() << "Error in isLast.";
dumpPulseAudioState(); dumpPulseAudioState();
return PulseAudioIsLastMeaning::Error; return PulseAudioIsLastMeaning::Error;
} }
@@ -134,14 +135,14 @@ std::string getDeviceName( pa_proplist* p )
{ {
if ( !p ) if ( !p )
{ {
LOG( ERROR ) << "proplist not valid."; qCritical() << "proplist not valid.";
} }
constexpr auto deviceDescription = "device.description"; constexpr auto deviceDescription = "device.description";
if ( !pa_proplist_contains( p, deviceDescription ) ) if ( !pa_proplist_contains( p, deviceDescription ) )
{ {
LOG( ERROR ) << "proplist does not contain '" << deviceDescription qCritical() << "proplist does not contain '" << deviceDescription
<< "'."; << "'.";
return "ERROR"; return "ERROR";
} }
@@ -166,7 +167,7 @@ template <class T> void deviceCallback( const T* i, const int isLast )
} }
else if ( deviceState == PulseAudioIsLastMeaning::Error ) else if ( deviceState == PulseAudioIsLastMeaning::Error )
{ {
LOG( ERROR ) << "Error in deviceCallback function."; qCritical() << "Error in deviceCallback function.";
dumpPulseAudioState(); dumpPulseAudioState();
loopControl = PulseAudioLoopControl::Stop; loopControl = PulseAudioLoopControl::Stop;
return; return;
@@ -179,8 +180,10 @@ template <class T> void deviceCallback( const T* i, const int isLast )
pulseAudioData.currentDefaultSourceInfo = *i; pulseAudioData.currentDefaultSourceInfo = *i;
} }
LOG( DEBUG ) << "Adding device to input: '" << i->name << "', '" /*
<< getDeviceName( i->proplist ) << "'."; qDebug() << "Adding device to input: '" << i->name << "', '"
<< getDeviceName( i->proplist ) << "'.";
*/
pulseAudioData.sourceInputDevices.push_back( pulseAudioData.sourceInputDevices.push_back(
AudioDevice( i->name, getDeviceName( i->proplist ) ) ); AudioDevice( i->name, getDeviceName( i->proplist ) ) );
} }
@@ -192,8 +195,10 @@ template <class T> void deviceCallback( const T* i, const int isLast )
pulseAudioData.currentDefaultSinkInfo = *i; pulseAudioData.currentDefaultSinkInfo = *i;
} }
LOG( DEBUG ) << "Adding device to output: '" << i->name << "', '" /*
<< getDeviceName( i->proplist ) << "'."; qDebug() << "Adding device to output: '" << i->name << "', '"
<< getDeviceName( i->proplist ) << "'.";
*/
pulseAudioData.sinkOutputDevices.push_back( pulseAudioData.sinkOutputDevices.push_back(
AudioDevice( i->name, getDeviceName( i->proplist ) ) ); AudioDevice( i->name, getDeviceName( i->proplist ) ) );
} }
@@ -230,7 +235,7 @@ void getDefaultDevicesCallback( pa_context* c,
if ( !i ) if ( !i )
{ {
LOG( ERROR ) << "i == 0"; qCritical() << "i == 0";
pulseAudioData.defaultSinkOutputDeviceId = "DDO:ERROR"; pulseAudioData.defaultSinkOutputDeviceId = "DDO:ERROR";
pulseAudioData.defaultSourceInputDeviceId = "DDI:ERROR"; pulseAudioData.defaultSourceInputDeviceId = "DDI:ERROR";
return; return;
@@ -242,10 +247,12 @@ void getDefaultDevicesCallback( pa_context* c,
loopControl = PulseAudioLoopControl::Stop; loopControl = PulseAudioLoopControl::Stop;
LOG( DEBUG ) << "getDefaultDevicesCallback done with sink output device: '" /*
<< pulseAudioData.defaultSinkOutputDeviceId qDebug() << "getDefaultDevicesCallback done with sink output device: '"
<< "' and source input '" << pulseAudioData.defaultSinkOutputDeviceId
<< pulseAudioData.defaultSourceInputDeviceId << "'."; << "' and source input '"
<< pulseAudioData.defaultSourceInputDeviceId << "'.";
*/
} }
void stateCallbackFunction( pa_context* c, void* userdata ) void stateCallbackFunction( pa_context* c, void* userdata )
@@ -256,27 +263,27 @@ void stateCallbackFunction( pa_context* c, void* userdata )
switch ( pa_context_get_state( c ) ) switch ( pa_context_get_state( c ) )
{ {
case PA_CONTEXT_TERMINATED: case PA_CONTEXT_TERMINATED:
LOG( ERROR ) << "PA_CONTEXT_TERMINATED in stateCallbackFunction"; qCritical() << "PA_CONTEXT_TERMINATED in stateCallbackFunction";
dumpPulseAudioState(); dumpPulseAudioState();
return; return;
case PA_CONTEXT_CONNECTING: case PA_CONTEXT_CONNECTING:
LOG( DEBUG ) << "PA_CONTEXT_CONNECTING"; qDebug() << "PA_CONTEXT_CONNECTING";
return; return;
case PA_CONTEXT_AUTHORIZING: case PA_CONTEXT_AUTHORIZING:
LOG( DEBUG ) << "PA_CONTEXT_AUTHORIZING"; qDebug() << "PA_CONTEXT_AUTHORIZING";
return; return;
case PA_CONTEXT_SETTING_NAME: case PA_CONTEXT_SETTING_NAME:
LOG( DEBUG ) << "PA_CONTEXT_SETTING_NAME"; qDebug() << "PA_CONTEXT_SETTING_NAME";
return; return;
case PA_CONTEXT_UNCONNECTED: case PA_CONTEXT_UNCONNECTED:
LOG( DEBUG ) << "PA_CONTEXT_UNCONNECTED"; qDebug() << "PA_CONTEXT_UNCONNECTED";
return; return;
case PA_CONTEXT_FAILED: case PA_CONTEXT_FAILED:
LOG( DEBUG ) << "PA_CONTEXT_FAILED"; qDebug() << "PA_CONTEXT_FAILED";
return; return;
case PA_CONTEXT_READY: case PA_CONTEXT_READY:
LOG( DEBUG ) << "PA_CONTEXT_READY"; qDebug() << "PA_CONTEXT_READY";
loopControl = PulseAudioLoopControl::Stop; loopControl = PulseAudioLoopControl::Stop;
return; return;
} }
@@ -302,7 +309,7 @@ void updateAllPulseData()
pulseAudioPointers.context, setInputDevicesCallback, noCustomUserdata ); pulseAudioPointers.context, setInputDevicesCallback, noCustomUserdata );
customPulseLoop(); customPulseLoop();
LOG( DEBUG ) << "updateAllPulseData done."; qDebug() << "updateAllPulseData done.";
} }
void successCallback( pa_context* c, int success, void* successVariable ) void successCallback( pa_context* c, int success, void* successVariable )
@@ -316,7 +323,7 @@ void successCallback( pa_context* c, int success, void* successVariable )
if ( !success ) if ( !success )
{ {
LOG( ERROR ) << "Non successful callback operation."; qCritical() << "Non successful callback operation.";
dumpPulseAudioState(); dumpPulseAudioState();
} }
@@ -335,12 +342,12 @@ void setPlaybackDeviceInternal( const std::string& id )
if ( !success ) if ( !success )
{ {
LOG( ERROR ) << "setPlaybackDeviceInternal failed to set default sink " qCritical() << "setPlaybackDeviceInternal failed to set default sink "
"for device '" "for device '"
<< id << "'."; << id << "'.";
} }
LOG( DEBUG ) << "setPlaybackDeviceInternal done with id: " << id; qDebug() << "setPlaybackDeviceInternal done with id: " << id;
} }
std::string getCurrentDefaultPlaybackDeviceName() std::string getCurrentDefaultPlaybackDeviceName()
@@ -351,12 +358,12 @@ std::string getCurrentDefaultPlaybackDeviceName()
{ {
if ( dev.id() == pulseAudioData.defaultSinkOutputDeviceId ) if ( dev.id() == pulseAudioData.defaultSinkOutputDeviceId )
{ {
LOG( DEBUG ) << "getCurrentDefaultPlaybackDeviceName done with " qDebug() << "getCurrentDefaultPlaybackDeviceName done with "
<< dev.name(); << dev.name();
return dev.name(); return dev.name();
} }
} }
LOG( ERROR ) << "Unable to find default playback device."; qCritical() << "Unable to find default playback device.";
return "ERROR"; return "ERROR";
} }
@@ -365,8 +372,8 @@ std::string getCurrentDefaultPlaybackDeviceId()
{ {
updateAllPulseData(); updateAllPulseData();
LOG( DEBUG ) << "getCurrentDefaultPlaybackDeviceId done with " qDebug() << "getCurrentDefaultPlaybackDeviceId done with "
<< pulseAudioData.defaultSinkOutputDeviceId; << pulseAudioData.defaultSinkOutputDeviceId;
return pulseAudioData.defaultSinkOutputDeviceId; return pulseAudioData.defaultSinkOutputDeviceId;
} }
@@ -379,12 +386,12 @@ std::string getCurrentDefaultRecordingDeviceName()
{ {
if ( dev.id() == pulseAudioData.defaultSourceInputDeviceId ) if ( dev.id() == pulseAudioData.defaultSourceInputDeviceId )
{ {
LOG( DEBUG ) << "getCurrentDefaultRecordingDeviceName done with: " qDebug() << "getCurrentDefaultRecordingDeviceName done with: "
<< dev.name(); << dev.name();
return dev.name(); return dev.name();
} }
} }
LOG( ERROR ) << "Unable to find default playback device."; qCritical() << "Unable to find default playback device.";
return "ERROR"; return "ERROR";
} }
@@ -393,8 +400,8 @@ std::string getCurrentDefaultRecordingDeviceId()
{ {
updateAllPulseData(); updateAllPulseData();
LOG( DEBUG ) << "getCurrentDefaultRecordingDeviceId done with " qDebug() << "getCurrentDefaultRecordingDeviceId done with "
<< pulseAudioData.defaultSourceInputDeviceId; << pulseAudioData.defaultSourceInputDeviceId;
return pulseAudioData.defaultSourceInputDeviceId; return pulseAudioData.defaultSourceInputDeviceId;
} }
@@ -452,7 +459,7 @@ void sourceOutputCallback( pa_context* c,
} }
else if ( deviceState == PulseAudioIsLastMeaning::Error ) else if ( deviceState == PulseAudioIsLastMeaning::Error )
{ {
LOG( ERROR ) << "Error in sourceOutputCallback function."; qCritical() << "Error in sourceOutputCallback function.";
dumpPulseAudioState(); dumpPulseAudioState();
return; return;
} }
@@ -460,9 +467,9 @@ void sourceOutputCallback( pa_context* c,
const auto sourceOutputIndex = i->index; const auto sourceOutputIndex = i->index;
const auto sourceIndex = pulseAudioData.currentDefaultSourceInfo.index; const auto sourceIndex = pulseAudioData.currentDefaultSourceInfo.index;
LOG( DEBUG ) << "Attempting to move sourceOutputIndex: '" qDebug() << "Attempting to move sourceOutputIndex: '" << sourceOutputIndex
<< sourceOutputIndex << "' to sourceIndex '" << sourceIndex << "' to sourceIndex '" << sourceIndex
<< "' with source output name " << i->name << "."; << "' with source output name " << i->name << ".";
pa_context_move_source_output_by_index( pa_context_move_source_output_by_index(
c, sourceOutputIndex, sourceIndex, successCallback, &success ); c, sourceOutputIndex, sourceIndex, successCallback, &success );
@@ -470,7 +477,7 @@ void sourceOutputCallback( pa_context* c,
void setMicrophoneDevice( const std::string& id ) void setMicrophoneDevice( const std::string& id )
{ {
LOG( DEBUG ) << "setMicrophoneDevice called with 'id': " << id; qDebug() << "setMicrophoneDevice called with 'id': " << id;
updateAllPulseData(); updateAllPulseData();
@@ -482,7 +489,7 @@ void setMicrophoneDevice( const std::string& id )
if ( !success ) if ( !success )
{ {
LOG( ERROR ) << "Error setting microphone device for '" << id << "'."; qCritical() << "Error setting microphone device for '" << id << "'.";
} }
updateAllPulseData(); updateAllPulseData();
@@ -494,17 +501,17 @@ void setMicrophoneDevice( const std::string& id )
if ( !success ) if ( !success )
{ {
LOG( ERROR ) << "Error in moving source outputs to new source."; qCritical() << "Error in moving source outputs to new source.";
} }
updateAllPulseData(); updateAllPulseData();
LOG( DEBUG ) << "setMicrophoneDevice done."; qDebug() << "setMicrophoneDevice done.";
} }
bool setPlaybackVolume( const float volume ) bool setPlaybackVolume( const float volume )
{ {
LOG( DEBUG ) << "setPlaybackVolume called with 'volume': " << volume; qDebug() << "setPlaybackVolume called with 'volume': " << volume;
updateAllPulseData(); updateAllPulseData();
@@ -525,19 +532,19 @@ bool setPlaybackVolume( const float volume )
if ( !success ) if ( !success )
{ {
LOG( ERROR ) << "setPlaybackVolume failed to set volume '" << volume qCritical() << "setPlaybackVolume failed to set volume '" << volume
<< "' for device '" << "' for device '"
<< pulseAudioData.defaultSinkOutputDeviceId << "'."; << pulseAudioData.defaultSinkOutputDeviceId << "'.";
} }
LOG( DEBUG ) << "setPlaybackVolume done with 'success': " << success; qDebug() << "setPlaybackVolume done with 'success': " << success;
return success; return success;
} }
bool setMicrophoneVolume( const float volume ) bool setMicrophoneVolume( const float volume )
{ {
LOG( DEBUG ) << "setMicrophoneVolume called with 'volume': " << volume; qDebug() << "setMicrophoneVolume called with 'volume': " << volume;
updateAllPulseData(); updateAllPulseData();
@@ -558,19 +565,19 @@ bool setMicrophoneVolume( const float volume )
if ( !success ) if ( !success )
{ {
LOG( ERROR ) << "seMicrophoneVolume failed to set volume '" << volume qCritical() << "seMicrophoneVolume failed to set volume '" << volume
<< "' for device '" << "' for device '"
<< pulseAudioData.defaultSourceInputDeviceId << "'."; << pulseAudioData.defaultSourceInputDeviceId << "'.";
} }
LOG( DEBUG ) << "setMicrophoneVolume done with 'success': " << success; qDebug() << "setMicrophoneVolume done with 'success': " << success;
return success; return success;
} }
bool setMicMuteState( const bool muted ) bool setMicMuteState( const bool muted )
{ {
LOG( DEBUG ) << "setMicMuteState called with 'muted': " << muted; qDebug() << "setMicMuteState called with 'muted': " << muted;
bool success = false; bool success = false;
pa_context_set_source_mute_by_name( pa_context_set_source_mute_by_name(
@@ -584,19 +591,19 @@ bool setMicMuteState( const bool muted )
if ( !success ) if ( !success )
{ {
LOG( ERROR ) << "setMicMuteState failed to set muted '" << muted qCritical() << "setMicMuteState failed to set muted '" << muted
<< "' for device '" << "' for device '"
<< pulseAudioData.defaultSourceInputDeviceId << "'."; << pulseAudioData.defaultSourceInputDeviceId << "'.";
} }
LOG( DEBUG ) << "setMicMuteState done with 'success': " << success; qDebug() << "setMicMuteState done with 'success': " << success;
return success; return success;
} }
void restorePulseAudioState() void restorePulseAudioState()
{ {
LOG( DEBUG ) << "restorePulseAudioState called."; qDebug() << "restorePulseAudioState called.";
setPlaybackDeviceInternal( pulseAudioData.originalDefaultOutputDeviceId ); setPlaybackDeviceInternal( pulseAudioData.originalDefaultOutputDeviceId );
setPlaybackVolume( pulseAudioData.originalDefaultOutputDeviceVolume ); setPlaybackVolume( pulseAudioData.originalDefaultOutputDeviceVolume );
@@ -604,12 +611,12 @@ void restorePulseAudioState()
setMicrophoneDevice( pulseAudioData.originalDefaultInputDeviceId ); setMicrophoneDevice( pulseAudioData.originalDefaultInputDeviceId );
setMicrophoneVolume( pulseAudioData.originalDefaultInputDeviceVolume ); setMicrophoneVolume( pulseAudioData.originalDefaultInputDeviceVolume );
LOG( DEBUG ) << "restorePulseAudioState done."; qDebug() << "restorePulseAudioState done.";
} }
void initializePulseAudio() void initializePulseAudio()
{ {
LOG( DEBUG ) << "initializePulseAudio called."; qDebug() << "initializePulseAudio called.";
pulseAudioPointers.mainLoop = pa_mainloop_new(); pulseAudioPointers.mainLoop = pa_mainloop_new();
@@ -644,6 +651,6 @@ void initializePulseAudio()
= static_cast<float>( pa_sw_volume_to_linear( = static_cast<float>( pa_sw_volume_to_linear(
pa_cvolume_avg( &pulseAudioData.currentDefaultSinkInfo.volume ) ) ); pa_cvolume_avg( &pulseAudioData.currentDefaultSinkInfo.volume ) ) );
LOG( DEBUG ) << "initializePulseAudio finished."; qDebug() << "initializePulseAudio finished.";
} }
} // namespace advsettings } // namespace advsettings

Some files were not shown because too many files have changed in this diff Show More