* 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 "vr_alarm.h"
#include "../openvr/ovr_overlay_wrapper.h"
#include "../utils/update_rate.h"
#include <thread>
#include <QtLogging>
#include <QtDebug>
namespace alarm_clock
{
@@ -76,13 +79,14 @@ void VrAlarm::checkAlarmStatus()
&& timeToAlarmActivation > 0;
if ( activateAlarm )
{
LOG( INFO ) << "Alarm fired at " << m_alarm.hour() << ":"
<< m_alarm.minute() << ":" << m_alarm.second() << ".";
qInfo() << "Alarm fired at " << m_alarm.hour() << ":"
<< m_alarm.minute() << ":" << m_alarm.second() << ".";
showAlarmNotification();
setAlarmEnabled( false );
std::thread t(
[]( vr::VROverlayHandle_t overlayHandle ) {
[]( vr::VROverlayHandle_t overlayHandle )
{
// This will freeze the overlay for 3 seconds
std::this_thread::sleep_for( std::chrono::seconds( 3 ) );
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 ) )
{
LOG( ERROR ) << "setAlarmTime passed invalid time values: '" << hour
<< "' hours, '" << minute << "' minutes, '" << second
<< "' seconds.";
qCritical() << "setAlarmTime passed invalid time values: '" << hour
<< "' hours, '" << minute << "' minutes, '" << second
<< "' seconds.";
}
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 )
{
LOG( ERROR ) << "modAlarmTime called with incorrect hour value: '"
<< hour << "'. Values not applied.";
qCritical() << "modAlarmTime called with incorrect hour value: '"
<< hour << "'. Values not applied.";
return;
}
if ( minute > 58 || minute < -58 )
{
LOG( ERROR ) << "modAlarmTime called with incorrect minute value: '"
<< minute << "'. Values not applied.";
qCritical() << "modAlarmTime called with incorrect minute value: '"
<< minute << "'. Values not applied.";
return;
}
if ( second > 58 || minute < -58 )
{
LOG( ERROR ) << "modAlarmTime called with incorrect second value: '"
<< second << "'. Values not applied.";
qCritical() << "modAlarmTime called with incorrect second value: '"
<< second << "'. Values not applied.";
return;
}
+6 -3
View File
@@ -1,5 +1,8 @@
#include "input_parser.h"
#include <QtLogging>
#include <QtDebug>
std::optional<Token> getModifier( const char& character ) noexcept
{
switch ( character )
@@ -50,7 +53,7 @@ std::optional<Token> getFunctionNumber( const char& character ) noexcept
return Token::KEY_F9;
default:
LOG( INFO ) << "Unknown function key number: " << character;
qInfo() << "Unknown function key number: " << character;
return std::nullopt;
}
}
@@ -80,7 +83,7 @@ std::optional<Token> getFunctionNumberExtended( const char& character ) noexcept
case '9':
return Token::KEY_F19;
default:
LOG( INFO ) << "Unknown function key number: " << character;
qInfo() << "Unknown function key number: " << character;
return std::nullopt;
}
}
@@ -210,7 +213,7 @@ std::vector<Token>
if ( !isupper( *ch ) || isspace( *ch ) )
{
LOG( INFO ) << "Unknown character found in sequence: " << *ch;
qInfo() << "Unknown character found in sequence: " << *ch;
continue;
}
// Everything below is upper case
-1
View File
@@ -3,7 +3,6 @@
#include <vector>
#include <cctype>
#include <optional>
#include <easylogging++.h>
enum class Token
{
-1
View File
@@ -1,6 +1,5 @@
#pragma once
#include "input_parser.h"
#include <easylogging++.h>
enum class KeyStatus
{
+4 -2
View File
@@ -2,6 +2,8 @@
#include <vector>
#include <Windows.h>
#include <cctype>
#include <QtLogging>
#include <QtDebug>
WORD convertToVirtualKeycode( const Token token )
{
@@ -183,13 +185,13 @@ void sendKeyboardInputRaw( std::vector<INPUT> inputs )
0,
nullptr ) )
{
LOG( ERROR )
qCritical()
<< "Error calling SendInput(): Could not get error message ("
<< errCode << ")";
}
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 "settings/settings.h"
#include "openvr/ovr_settings_wrapper.h"
#include <QtLogging>
#include <QtDebug>
#include <memory>
#ifdef _WIN64
# include <windows.h>
extern "C" __declspec( dllexport ) DWORD NvOptimusEnablement = 0x00000001;
@@ -8,16 +13,13 @@ extern "C" __declspec( dllexport ) DWORD AmdPowerXpressRequestHighPerformance
= 0x00000001;
#endif
INITIALIZE_EASYLOGGINGPP
int main( int argc, char* argv[] )
{
setUpLogging();
LOG( INFO ) << "Settings File: "
<< settings::initializeAndGetSettingsPath();
qInfo() << "Settings File: " << settings::initializeAndGetSettingsPath();
LOG( INFO ) << settings::getSettingsAndValues();
qInfo() << settings::getSettingsAndValues();
QCoreApplication::setAttribute( Qt::AA_Use96Dpi );
QCoreApplication::setAttribute( Qt::AA_UseDesktopOpenGL );
@@ -30,8 +32,6 @@ int main( int argc, char* argv[] )
mainEventLoop.setApplicationVersion(
application_strings::applicationVersionString );
qInstallMessageHandler( mainQtMessageHandler );
const auto commandLineArgs
= argument::returnCommandLineParser( mainEventLoop );
@@ -51,34 +51,25 @@ int main( int argc, char* argv[] )
{
QQmlEngine qmlEngine;
advsettings::OverlayController controller( commandLineArgs.desktopMode,
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." );
}
std::unique_ptr<advsettings::OverlayController> controller(
new advsettings::OverlayController( commandLineArgs.desktopMode,
commandLineArgs.forceNoSound,
qmlEngine ) );
const auto url
= QUrl::fromLocalFile( QString::fromStdString( ( *path ) ) );
= QUrl( "qrc:/qt/qml/AdvancedSettings/common/mainwidget.qml" );
QQmlComponent component( &qmlEngine, url );
auto errors = component.errors();
for ( auto& e : errors )
{
LOG( ERROR ) << "QML Error: " << e.toString().toStdString()
<< std::endl;
qCritical() << "QML Error: "
<< e.toString().toStdString(); //<< std::endl;
}
auto quickObj = component.create();
controller.SetWidget( qobject_cast<QQuickItem*>( quickObj ),
application_strings::applicationDisplayName,
application_strings::applicationKey );
controller->SetWidget( qobject_cast<QQuickItem*>( quickObj ),
application_strings::applicationDisplayName,
application_strings::applicationKey );
// Attempts to install the application manifest on all "regular" starts.
if ( !commandLineArgs.forceNoManifest )
@@ -99,7 +90,7 @@ int main( int argc, char* argv[] )
}
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 )
{
LOG( FATAL ) << e.what();
qFatal() << e.what();
return ReturnErrorCode::GENERAL_FAILURE;
}
}
-1
View File
@@ -1,5 +1,4 @@
#pragma once
#include <easylogging++.h>
#include <vector>
#include <QString>
+5 -3
View File
@@ -3,6 +3,8 @@
#include <QtCore/QDebug>
#include <QtCore/QStringList>
#include <QtDBus/QtDBus>
#include <QtLogging>
#include <QtDebug>
namespace keyboardinput
{
@@ -10,7 +12,7 @@ void callMethodForAllMediaPlayerAvailableServices( const QString& method )
{
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;
}
@@ -18,9 +20,9 @@ void callMethodForAllMediaPlayerAvailableServices( const QString& method )
= QDBusConnection::sessionBus().interface()->registeredServiceNames();
if ( !names.isValid() )
{
LOG( ERROR )
qCritical()
<< "Media Keys: Error getting DBUS registered service names:";
LOG( ERROR ) << names.error().message();
qCritical() << names.error().message();
}
foreach ( QString name, names.value() )
+4 -2
View File
@@ -1,6 +1,8 @@
#include "media_keys.h"
#include "src/keyboard_input/input_sender.h"
#include <Windows.h>
#include <QtLogging>
#include <QtDebug>
namespace keyboardinput
{
@@ -45,13 +47,13 @@ void sendKeyboardInputRaw( std::vector<INPUT> inputs )
0,
nullptr ) )
{
LOG( ERROR )
qCritical()
<< "Error calling SendInput(): Could not get error message ("
<< errCode << ")";
}
else
{
LOG( ERROR ) << "Error calling SendInput(): " << err;
qCritical() << "Error calling SendInput(): " << err;
}
}
}
+7 -6
View File
@@ -3,7 +3,8 @@
#include <openvr.h>
#include <iostream>
#include <array>
#include <easylogging++.h>
#include <QtLogging>
#include <QtDebug>
namespace input
{
@@ -30,8 +31,8 @@ vr::InputDigitalActionData_t getDigitalActionData( DigitalAction& action )
if ( error != vr::EVRInputError::VRInputError_None )
{
LOG( ERROR ) << "Error getting IVRInput Digital Action Data for handle "
<< action.name() << ". SteamVR Error: " << error;
qCritical() << "Error getting IVRInput Digital Action Data for handle "
<< action.name() << ". SteamVR Error: " << error;
}
return handleData;
@@ -60,8 +61,8 @@ vr::InputAnalogActionData_t getAnalogActionData( AnalogAction& action )
if ( error != vr::EVRInputError::VRInputError_None )
{
LOG( ERROR ) << "Error getting IVRInput Digital Action Data for handle "
<< action.name() << ". SteamVR Error: " << error;
qCritical() << "Error getting IVRInput Digital Action Data for handle "
<< action.name() << ". SteamVR Error: " << error;
}
return handleData;
@@ -454,7 +455,7 @@ void SteamIVRInput::UpdateStates()
if ( error != vr::EVRInputError::VRInputError_None )
{
LOG( ERROR )
qCritical()
<< "Error during IVRInput action state update. OpenVR Error: "
<< error;
}
+4 -3
View File
@@ -1,6 +1,7 @@
#pragma once
#include <openvr.h>
#include <easylogging++.h>
#include <QtLogging>
#include <QtDebug>
namespace input
{
@@ -30,8 +31,8 @@ public:
if ( error != vr::EVRInputError::VRInputError_None )
{
LOG( ERROR ) << "Error getting handle for '" << actionName
<< "'. OpenVR Error: " << error;
qCritical() << "Error getting handle for '" << actionName
<< "'. OpenVR Error: " << error;
}
}
/*!
+4 -3
View File
@@ -1,6 +1,7 @@
#pragma once
#include <openvr.h>
#include <easylogging++.h>
#include <QtLogging>
#include <QtDebug>
namespace input
{
@@ -16,8 +17,8 @@ public:
auto error = vr::VRInput()->GetActionSetHandle( setName, &handle );
if ( error != vr::EVRInputError::VRInputError_None )
{
LOG( ERROR ) << "Error getting handle for '" << setName
<< "'. OpenVR Error: " << error;
qCritical() << "Error getting handle for '" << setName
<< "'. OpenVR Error: " << error;
}
m_activeActionSet.ulActionSet = handle;
+4 -4
View File
@@ -1,6 +1,7 @@
#pragma once
#include <openvr.h>
#include <easylogging++.h>
#include <QtLogging>
#include <QtDebug>
namespace input
{
@@ -17,9 +18,8 @@ public:
if ( error != vr::EVRInputError::VRInputError_None )
{
LOG( ERROR ) << "Error getting input handle for '"
<< inputSourceName
<< "'. OpenVR Input Error: " << error;
qCritical() << "Error getting input handle for '" << inputSourceName
<< "'. OpenVR Input Error: " << error;
}
}
/*!
+6 -5
View File
@@ -1,6 +1,7 @@
#pragma once
#include <openvr.h>
#include <easylogging++.h>
#include <QtLogging>
#include <QtDebug>
#include "../utils/paths.h"
namespace input
@@ -19,8 +20,8 @@ public:
if ( !actionManifestPath.has_value() )
{
LOG( ERROR ) << "Could not find action manifest. Action manifests "
"not initialized.";
qCritical() << "Could not find action manifest. Action manifests "
"not initialized.";
return;
}
@@ -29,8 +30,8 @@ public:
auto error = vr::VRInput()->SetActionManifestPath( validManifestPath );
if ( error != vr::EVRInputError::VRInputError_None )
{
LOG( ERROR ) << "Error setting action manifest path: "
<< validManifestPath << ". OpenVR Error: " << error;
qCritical() << "Error setting action manifest path: "
<< validManifestPath << ". OpenVR Error: " << error;
}
}
+12 -9
View File
@@ -1,4 +1,7 @@
#include "lh_console_util.h"
#include <QtLogging>
#include <QtDebug>
#include <QRegularExpression>
namespace lh_con_util
{
@@ -6,12 +9,12 @@ bool LHCUtil::FindAll()
{
if ( !FindAllRX() )
{
LOG( ERROR ) << "Find All Recievers Failed";
qCritical() << "Find All Recievers Failed";
return false;
}
if ( !FindAllTX() )
{
LOG( ERROR ) << "Find All Transmitters Failed";
qCritical() << "Find All Transmitters Failed";
return false;
}
return true;
@@ -26,7 +29,7 @@ bool LHCUtil::FindAllRX()
QString output = QString( lhProcess->readAllStandardOutput() );
QStringList outputLines
= output.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts );
= output.split( QRegularExpression( "[\r\n]" ), Qt::SkipEmptyParts );
bool RecieverStart = false;
for ( auto OutputLine : outputLines )
@@ -44,7 +47,7 @@ bool LHCUtil::FindAllRX()
}
OutputLine.simplified().remove( " " );
OutputLine.remove( 0, 1 );
// LOG( WARNING ) << OutputLine << std::endl;
// qWarning() << OutputLine << std::endl;
RXTX_Pairs_.push_back( RXTX_Pair{ OutputLine, " ", true, false } );
}
}
@@ -53,21 +56,21 @@ bool LHCUtil::FindAllRX()
bool LHCUtil::FindConnectedTX( QString RXSerial )
{
LOG( WARNING ) << RXSerial;
qWarning() << RXSerial;
QProcess* lhProcess = new QProcess();
lhProcess->start( path_, QStringList() << "/serial" << RXSerial << "exit" );
lhProcess->waitForFinished();
QString output = QString( lhProcess->readAllStandardOutput() );
QStringList outputLines
= output.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts );
= output.split( QRegularExpression( "[\r\n]" ), Qt::SkipEmptyParts );
// std::vector<std::string> OutputLines
// = exec( ( "\"" + path_ + "\" /serial " + RXSerial + " exit" ).c_str()
// );
bool lhConFound = false;
for ( auto outputLine : outputLines )
{
// LOG( WARNING ) << outputLine;
// qWarning() << outputLine;
if ( outputLine.contains( "Connected to receiver" ) )
{
auto splitList = outputLine.split( ":" );
@@ -84,7 +87,7 @@ bool LHCUtil::FindConnectedTX( QString RXSerial )
rxtx.TX_Serial = TXSerial;
rxtx.Is_Paired = true;
rxtx.Is_Init = true;
LOG( WARNING )
qWarning()
<< "tx serial stored: " << TXSerial.toStdString();
return true;
}
@@ -102,7 +105,7 @@ bool LHCUtil::FindConnectedTX( QString RXSerial )
rxtx.TX_Serial = "";
rxtx.Is_Paired = false;
rxtx.Is_Init = true;
LOG( WARNING ) << "tx oops";
qWarning() << "tx oops";
return true;
}
}
-1
View File
@@ -12,7 +12,6 @@
#include <QString>
#include <QStringList>
#include <QRegularExpression>
#include <easylogging++.h>
namespace lh_con_util
{
+20 -18
View File
@@ -1,8 +1,10 @@
#include <string>
#include <thread>
#include <openvr.h>
#include <QMessageBox>
#include "openvr_init.h"
#include <easylogging++.h>
#include <QtLogging>
#include <QtDebug>
#include "../openvr/ivrinput_manifest.h"
namespace openvr_init
@@ -29,17 +31,17 @@ bool initializeProperly( const OpenVrInitializationType initType )
// In particular in some setups these errors are thrown while
// nothing is wrong with their setup presumably this is some sort of
// race condition
LOG( WARNING ) << "HMD not Found During Startup";
LOG( WARNING ) << "steamvr error: "
+ std::string(
vr::VR_GetVRInitErrorAsEnglishDescription(
initError ) );
qWarning() << "HMD not Found During Startup";
qWarning() << "steamvr error: "
+ std::string(
vr::VR_GetVRInitErrorAsEnglishDescription(
initError ) );
return false;
}
LOG( ERROR ) << "Failed to initialize OpenVR: "
+ std::string(
vr::VR_GetVRInitErrorAsEnglishDescription(
initError ) );
qCritical() << "Failed to initialize OpenVR: "
+ std::string(
vr::VR_GetVRInitErrorAsEnglishDescription(
initError ) );
// Going to stop Exiting App, This may lead to crashes if OpenVR
// actually fails to start, HOWEVER based on the HMD errors we are
// probably pre-maturely killing ourselves from some sort of OpenVR race
@@ -48,7 +50,7 @@ bool initializeProperly( const OpenVrInitializationType initType )
return false;
}
LOG( INFO ) << "OpenVR initialized successfully.";
qInfo() << "OpenVR initialized successfully.";
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
// fails to load we should have issues. we will re-initialize a few
// times if that is the case and hope that fixes things
LOG( WARNING ) << "OpenVR version is invalid: Interface version "
<< interfaceAndVersion << " not found. attempt number: "
<< std::to_string( trynumber );
qWarning() << "OpenVR version is invalid: Interface version "
<< interfaceAndVersion << " not found. attempt number: "
<< std::to_string( trynumber );
};
// Check whether OpenVR is too outdated
@@ -121,16 +123,16 @@ void initializeOpenVR( const OpenVrInitializationType initType, int count )
}
if ( !success && count < 3 )
{
LOG( WARNING ) << "An error occured on initialization of "
"openvr/steamvr attempting again "
<< std::to_string( count + 1 ) << " of 3 Attempts";
qWarning() << "An error occured on initialization of "
"openvr/steamvr attempting again "
<< std::to_string( count + 1 ) << " of 3 Attempts";
std::this_thread::sleep_for( std::chrono::seconds( 5 ) );
// 5.8.1 Unknown if VR shutdown needs to be callled if vr init fails
initializeOpenVR( initType, ( count + 1 ) );
}
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 <QtLogging>
#include <QtDebug>
constexpr uint32_t bufferLen = 4096;
namespace ovr_application_wrapper
{
@@ -12,9 +14,8 @@ std::string getSceneAppID()
std::string keys = key;
if ( error != vr::VRApplicationError_None )
{
LOG( WARNING ) << "Could not Get App ID by PID: "
+ std::to_string( error );
LOG( WARNING ) << "Attempting to find through Enumeration";
qWarning() << "Could not Get App ID by PID: " + std::to_string( error );
qWarning() << "Attempting to find through Enumeration";
auto appCount = vr::VRApplications()->GetApplicationCount();
const uint32_t bufferMax = vr::k_unMaxApplicationKeyLength;
char cStringOut[bufferMax];
@@ -25,17 +26,17 @@ std::string getSceneAppID()
std::string appID( cStringOut );
if ( appID.find( "steam.app" ) != std::string::npos )
{
LOG( WARNING ) << "Found App ID through Enumeration (only "
"steam apps caught): "
<< appID;
qWarning() << "Found App ID through Enumeration (only "
"steam apps caught): "
<< appID;
if ( error2 == vr::VRApplicationError_None )
{
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 keys;
-1
View File
@@ -3,7 +3,6 @@
#include <openvr.h>
#include <iostream>
#include <string>
#include <easylogging++.h>
#include <utility>
#include <map>
+35 -34
View File
@@ -1,4 +1,6 @@
#include "ovr_overlay_wrapper.h"
#include <QtLogging>
#include <QtDebug>
namespace ovr_overlay_wrapper
{
@@ -11,10 +13,9 @@ OverlayError createOverlay( const std::string overlayKey,
overlayKey.c_str(), overlayName.c_str(), overlayHandle );
if ( oError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Could not create overlay: " << overlayName
<< "because "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg;
qCritical() << "Could not create overlay: " << overlayName << "because "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg;
return OverlayError::UndefinedError;
}
return OverlayError::NoError;
@@ -30,10 +31,10 @@ OverlayError setOverlayColor( vr::VROverlayHandle_t overlayHandle,
= vr::VROverlay()->SetOverlayColor( overlayHandle, red, green, blue );
if ( oError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Error setting Overlay Color For "
<< getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg;
qCritical() << "Error setting Overlay Color For "
<< getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg;
return OverlayError::UndefinedError;
}
return OverlayError::NoError;
@@ -47,10 +48,10 @@ OverlayError setOverlayAlpha( vr::VROverlayHandle_t overlayHandle,
= vr::VROverlay()->SetOverlayAlpha( overlayHandle, alpha );
if ( oError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Error setting Overlay Alpha For "
<< getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg;
qCritical() << "Error setting Overlay Alpha For "
<< getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg;
return OverlayError::UndefinedError;
}
return OverlayError::NoError;
@@ -64,10 +65,10 @@ OverlayError setOverlayWidthInMeters( vr::VROverlayHandle_t overlayHandle,
overlayHandle, widthInMeters );
if ( oError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Error setting overlay width For "
<< getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg;
qCritical() << "Error setting overlay width For "
<< getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg;
return OverlayError::UndefinedError;
}
return OverlayError::NoError;
@@ -81,18 +82,18 @@ OverlayError setOverlayFromFile( vr::VROverlayHandle_t overlayHandle,
const auto overlayPath = paths::binaryDirectoryFindFile( fileName );
if ( !overlayPath.has_value() )
{
LOG( ERROR ) << "File not Found: " << fileName << customErrorMsg;
qCritical() << "File not Found: " << fileName << customErrorMsg;
return OverlayError::UndefinedError;
}
vr::VROverlayError oError = vr::VROverlay()->SetOverlayFromFile(
overlayHandle, overlayPath->c_str() );
if ( oError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Error setting Overlay from file For "
<< getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
oError )
<< " " << customErrorMsg;
qCritical() << "Error setting Overlay from file For "
<< getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
oError )
<< " " << customErrorMsg;
return OverlayError::UndefinedError;
}
return OverlayError::NoError;
@@ -105,10 +106,10 @@ OverlayError showOverlay( vr::VROverlayHandle_t overlayHandle,
vr::VROverlayError oError = vr::VROverlay()->ShowOverlay( overlayHandle );
if ( oError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Error showing overlay For "
<< getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg;
qCritical() << "Error showing overlay For "
<< getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg;
return OverlayError::UndefinedError;
}
return OverlayError::NoError;
@@ -120,10 +121,10 @@ OverlayError hideOverlay( vr::VROverlayHandle_t overlayHandle,
vr::VROverlayError oError = vr::VROverlay()->HideOverlay( overlayHandle );
if ( oError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Error hiding overlay For "
<< getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg;
qCritical() << "Error hiding overlay For "
<< getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg;
return OverlayError::UndefinedError;
}
return OverlayError::NoError;
@@ -139,10 +140,10 @@ OverlayError setOverlayTransformAbsolute(
overlayHandle, trackingOrigin, trackingOriginToOverlayTransform );
if ( oError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Error setting Overlay Position For "
<< getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg;
qCritical() << "Error setting Overlay Position For "
<< getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg;
return OverlayError::UndefinedError;
}
return OverlayError::NoError;
-1
View File
@@ -3,7 +3,6 @@
#include <openvr.h>
#include <iostream>
#include <string>
#include <easylogging++.h>
#include <utility>
#include <string>
#include "../utils/paths.h"
+5 -3
View File
@@ -1,4 +1,6 @@
#include "ovr_settings_wrapper.h"
#include <QtLogging>
#include <QtDebug>
namespace ovr_settings_wrapper
{
@@ -19,9 +21,9 @@ SettingsError handleErrors( std::string settingsKey,
{
return SettingsError::UndefinedError;
}
LOG( ERROR ) << "Could not access \"" << settingsKey << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( error )
<< " " << customErrorMsg;
qCritical() << "Could not access \"" << settingsKey << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( error )
<< " " << customErrorMsg;
if ( error
== vr::EVRSettingsError::VRSettingsError_UnsetSettingHasNoDefault )
{
-1
View File
@@ -3,7 +3,6 @@
#include <openvr.h>
#include <iostream>
#include <string>
#include <easylogging++.h>
#include <utility>
/* 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 <QtLogging>
#include <QtDebug>
#include <vector>
namespace ovr_system_wrapper
{
@@ -8,11 +11,11 @@ SystemError handleTrackedPropertyErrors( vr::TrackedDeviceProperty tdp,
{
if ( error != vr::TrackedProp_Success )
{
LOG( ERROR ) << "Could not get Property with error \""
<< vr::VRSystem()->GetPropErrorNameFromEnum( error )
<< "\" property: "
<< "todo"
<< " " << customErrorMsg;
qCritical() << "Could not get Property with error \""
<< vr::VRSystem()->GetPropErrorNameFromEnum( error )
<< "\" property: "
<< "todo"
<< " " << customErrorMsg;
if ( tdp == vr::Prop_TrackedDeviceProperty_Max )
{
// Just for Error OPPS todo
@@ -295,7 +298,7 @@ std::string getControllerName()
}
if ( !isLeftCon && !isRightCon && hasHMD )
{
LOG( WARNING ) << "WARNING: No Controllers assuming based on HMD";
qWarning() << "WARNING: No Controllers assuming based on HMD";
auto hmdName
= getStringTrackedProperty( hmdIdx, vr::Prop_ControllerType_String )
.second;
@@ -309,27 +312,27 @@ std::string getControllerName()
}
if ( hmdName == "vive_pro" )
{
LOG( WARNING )
qWarning()
<< "Vive Pro Detected, Assuming Knuckles this may be wrong";
return "knuckles";
}
if ( hmdName == "holographic_hmd" )
{
LOG( WARNING ) << "WMR detected, Assuming HP CONTROLLERS";
qWarning() << "WMR detected, Assuming HP CONTROLLERS";
return "hpmotioncontroller";
}
if ( hmdName == "rift" )
{
return "oculus_touch";
}
LOG( WARNING ) << "Headset Not recognized Assuming touch controllers "
+ hmdName;
qWarning() << "Headset Not recognized Assuming touch controllers "
+ hmdName;
return "oculus_touch";
}
if ( right != left )
{
LOG( WARNING ) << "WARNING: Left and Right Controllers are Different, "
"Prioritizing right";
qWarning() << "WARNING: Left and Right Controllers are Different, "
"Prioritizing right";
}
if ( rightIdx == 999 )
{
+1 -1
View File
@@ -3,9 +3,9 @@
#include <openvr.h>
#include <iostream>
#include <string>
#include <easylogging++.h>
#include <utility>
#include <map>
#include <vector>
/* Wrapper For OpenVR's IVR settings class, allows us to do our error logging
* while also minimizing code
+128 -139
View File
@@ -15,13 +15,19 @@
#include <QCursor>
#include <QProcess>
#include <QMessageBox>
#include <QtLogging>
#include <QtDebug>
#include <iostream>
#include <cmath>
#include <openvr.h>
#include <easylogging++.h>
#include "utils/Matrix.h"
#include "keyboard_input/input_sender.h"
#include "settings/settings.h"
#include <qapplication.h>
#include <qlogging.h>
#include <qnamespace.h>
#include <rhi/qrhi.h>
#include <stdexcept>
// application namespace
namespace advsettings
@@ -60,61 +66,23 @@ OverlayController::OverlayController( bool desktopMode,
// Throw Error If over 16k characters in path string
if ( !pathIsGood )
{
LOG( ERROR ) << "Error Finding VR Runtime Path, Attempting Recovery: ";
qCritical() << "Error Finding VR Runtime Path, Attempting Recovery: ";
uint32_t maxLengthRe = requiredLength;
LOG( INFO ) << "Open VR reporting Required path length of: "
<< maxLengthRe;
qInfo() << "Open VR reporting Required path length of: " << maxLengthRe;
}
m_runtimePathUrl = QUrl::fromLocalFile( tempRuntimePath );
LOG( INFO ) << "VR Runtime Path: " << m_runtimePathUrl.toLocalFile();
qInfo() << "VR Runtime Path: " << m_runtimePathUrl.toLocalFile();
const double initVol = soundVolume();
constexpr auto clickSoundURL = "res/sounds/click.wav";
const auto activationSoundFile
= paths::binaryDirectoryFindFile( clickSoundURL );
m_activationSoundEffect.setSource( QUrl( "qrc:/sounds/click.wav" ) );
m_activationSoundEffect.setVolume( initVol );
if ( activationSoundFile.has_value() )
{
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 );
m_focusChangedSoundEffect.setSource( QUrl( "qrc:/sounds/focus.wav" ) );
m_focusChangedSoundEffect.setVolume( initVol );
if ( focusChangedSoundFile.has_value() )
{
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;
}
m_alarm01SoundEffect.setSource( QUrl( "qrc:/sounds/alarm01.wav" ) );
m_alarm01SoundEffect.setVolume( 1.0 );
// If we have desktop mode flag ignore waht toggle says otherwise we use
// toggle
@@ -123,28 +91,6 @@ OverlayController::OverlayController( bool desktopMode,
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() )
{
QMessageBox::critical(
@@ -344,11 +290,11 @@ OverlayController::OverlayController( bool desktopMode,
}
else
{
LOG( INFO ) << "Version Check: Feature disabled. Not checking version.";
qInfo() << "Version Check: Feature disabled. Not checking version.";
}
LOG( INFO ) << "OPENSSL VERSION: "
<< QSslSocket::sslLibraryBuildVersionString();
qInfo() << "OPENSSL VERSION: "
<< QSslSocket::sslLibraryBuildVersionString();
}
OverlayController::~OverlayController()
@@ -373,7 +319,7 @@ void OverlayController::exitApp()
Shutdown();
QApplication::exit();
LOG( INFO ) << "All systems exited.";
qInfo() << "All systems exited.";
exit( EXIT_SUCCESS );
// Does not fallthrough
}
@@ -403,7 +349,9 @@ void OverlayController::Shutdown()
m_pRenderTimer->stop();
m_pRenderTimer.reset();
}
m_pFbo.reset();
m_render_pass_descriptor.reset();
m_render_target.reset();
m_pFBTexture.reset();
}
void OverlayController::SetWidget( QQuickItem* quickItem,
@@ -449,14 +397,15 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
}
else
{
LOG( ERROR ) << "Could not find thumbnail icon \""
<< thumbiconFilename << "\"";
qCritical() << "Could not find thumbnail icon \""
<< thumbiconFilename << "\"";
}
// Too many render calls in too short time overwhelm Qt and an
// assertion gets thrown. Therefore we use an timer to delay render
// calls
m_pRenderTimer.reset( new QTimer() );
m_pRenderTimer->moveToThread( qApp->thread() );
m_pRenderTimer->setSingleShot( true );
m_pRenderTimer->setInterval( 5 );
connect( m_pRenderTimer.get(),
@@ -464,22 +413,38 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
this,
SLOT( renderOverlay() ) );
QOpenGLFramebufferObjectFormat fboFormat;
fboFormat.setAttachment(
QOpenGLFramebufferObject::CombinedDepthStencil );
fboFormat.setTextureTarget( GL_TEXTURE_2D );
m_pFbo.reset( new QOpenGLFramebufferObject(
static_cast<int>( quickItem->width() ),
static_cast<int>( quickItem->height() ),
fboFormat ) );
if ( !m_renderControl.initialize() )
throw std::runtime_error( "could not initialize m_renderControl" );
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() );
m_window.setGeometry( 0,
0,
static_cast<int>( quickItem->width() ),
static_cast<int>( quickItem->height() ) );
m_renderControl.initialize( &m_openGLContext );
m_renderControl.initialize();
vr::HmdVector2_t vecWindowSize
= { static_cast<float>( quickItem->width() ),
@@ -510,7 +475,7 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
m_steamVRTabController.initStage2( this );
m_chaperoneTabController.initStage2( this );
m_fixFloorTabController.initStage2( this );
m_audioTabController.initStage2();
m_audioTabController.initStage2( this );
m_statisticsTabController.initStage2( this );
m_settingsTabController.initStage2( this );
m_utilitiesTabController.initStage2( this );
@@ -526,7 +491,7 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
autoApplyChaperoneName() );
if ( chapindex.first )
{
LOG( INFO ) << "Auto Applying Chaperone";
qInfo() << "Auto Applying Chaperone";
m_chaperoneTabController.applyChaperoneProfile( chapindex.second );
// This should be the way to stop room-setup from starting... as it
// sends steamvr a signal that it is completed
@@ -534,7 +499,7 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
vr::EChaperoneConfigFile_Live );
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()
{
if ( !m_desktopMode )
@@ -557,28 +558,18 @@ void OverlayController::renderOverlay()
m_ulOverlayThumbnailHandle ) ) )
return;
m_renderControl.polishItems();
m_renderControl.beginFrame();
m_renderControl.sync();
m_renderControl.render();
m_renderControl.endFrame();
GLuint unTexture = m_pFbo->texture();
if ( unTexture != 0 )
{
#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 );
}
auto tex = vrTextureFromRhiTexture( *m_pFBTexture );
vr::VROverlay()->SetOverlayTexture( m_ulOverlayHandle, &tex );
/*
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;
#ifdef __linux__
float h = static_cast<float>( m_window.height() );
y = h - y;
#endif
return QPoint( static_cast<int>( mouse.x ), static_cast<int>( y ) );
return { mouse.x, y };
}
void OverlayController::processMediaKeyBindings()
@@ -988,7 +979,7 @@ QString OverlayController::versionCheckText() const
void OverlayController::setVersionCheckText( QString value, bool notify )
{
m_versionCheckText = value;
LOG( INFO ) << "m_versionCheckText = " << m_versionCheckText;
qInfo() << "m_versionCheckText = " << m_versionCheckText;
if ( notify )
{
emit versionCheckTextChanged( m_versionCheckText );
@@ -1109,7 +1100,7 @@ void OverlayController::mainEventLoop()
{
case vr::VREvent_MouseMove:
{
QPoint ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse );
QPointF ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse );
if ( ptNewMouse != m_ptLastMouse )
{
QMouseEvent mouseEvent( QEvent::MouseMove,
@@ -1117,7 +1108,7 @@ void OverlayController::mainEventLoop()
m_window.mapToGlobal( ptNewMouse ),
Qt::NoButton,
m_lastMouseButtons,
nullptr );
Qt::NoModifier );
m_ptLastMouse = ptNewMouse;
QCoreApplication::sendEvent( &m_window, &mouseEvent );
OnRenderRequest();
@@ -1127,7 +1118,7 @@ void OverlayController::mainEventLoop()
case vr::VREvent_MouseButtonDown:
{
QPoint ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse );
QPointF ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse );
Qt::MouseButton button
= vrEvent.data.mouse.button == vr::VRMouseButton_Right
? Qt::RightButton
@@ -1138,14 +1129,14 @@ void OverlayController::mainEventLoop()
m_window.mapToGlobal( ptNewMouse ),
button,
m_lastMouseButtons,
nullptr );
Qt::NoModifier );
QCoreApplication::sendEvent( &m_window, &mouseEvent );
}
break;
case vr::VREvent_MouseButtonUp:
{
QPoint ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse );
QPointF ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse );
Qt::MouseButton button
= vrEvent.data.mouse.button == vr::VRMouseButton_Right
? Qt::RightButton
@@ -1156,7 +1147,7 @@ void OverlayController::mainEventLoop()
m_window.mapToGlobal( ptNewMouse ),
button,
m_lastMouseButtons,
nullptr );
Qt::NoModifier );
QCoreApplication::sendEvent( &m_window, &mouseEvent );
}
break;
@@ -1172,10 +1163,10 @@ void OverlayController::mainEventLoop()
* ( 360.0f * 8.0f ) ),
static_cast<int>( vrEvent.data.scroll.ydelta
* ( 360.0f * 8.0f ) ) ),
0,
Qt::Vertical,
m_lastMouseButtons,
nullptr );
Qt::KeyboardModifiers::fromInt( 0 ),
Qt::ScrollPhase::NoScrollPhase,
false );
QCoreApplication::sendEvent( &m_window, &wheelEvent );
}
break;
@@ -1188,7 +1179,7 @@ void OverlayController::mainEventLoop()
case vr::VREvent_Quit:
{
LOG( INFO ) << "Received quit request.";
qInfo() << "Received quit request.";
vr::VRSystem()->AcknowledgeQuit_Exiting(); // Let us buy some
// time just in case
@@ -1200,14 +1191,14 @@ void OverlayController::mainEventLoop()
case vr::VREvent_DashboardActivated:
{
LOG( DEBUG ) << "Dashboard activated";
qDebug() << "Dashboard activated";
m_dashboardVisible = true;
}
break;
case vr::VREvent_DashboardDeactivated:
{
LOG( DEBUG ) << "Dashboard deactivated";
qDebug() << "Dashboard deactivated";
m_dashboardVisible = false;
settings::saveChangedSettings();
}
@@ -1243,9 +1234,8 @@ void OverlayController::mainEventLoop()
= vrEvent.data.chaperone.m_nPreviousUniverse;
uint64_t currentUniverseId
= vrEvent.data.chaperone.m_nCurrentUniverse;
LOG( INFO )
<< "(VREvent) ChaperoneUniverseHasChanged... Previous : "
<< previousUniverseId << " Current:" << currentUniverseId;
qInfo() << "(VREvent) ChaperoneUniverseHasChanged... Previous : "
<< previousUniverseId << " Current:" << currentUniverseId;
if ( !chaperoneDataAlreadyUpdated )
{
m_chaperoneUtils.loadChaperoneData();
@@ -1260,7 +1250,7 @@ void OverlayController::mainEventLoop()
break;
case vr::VREvent_Input_ActionManifestReloaded:
{
// LOG( WARNING ) << "Action Manifest Reloaded";
// qWarning() << "Action Manifest Reloaded";
if ( m_steamVRTabController.perAppBindEnabled() )
{
m_steamVRTabController.applyAllCustomBindings();
@@ -1274,7 +1264,7 @@ void OverlayController::mainEventLoop()
if ( m_incomingReset )
{
m_incomingReset = false;
LOG( INFO ) << "Reset zero event recorded";
qInfo() << "Reset zero event recorded";
m_moveCenterTabController.incomingZeroReset();
}
@@ -1641,7 +1631,7 @@ void OverlayController::OnNetworkReply( QNetworkReply* reply )
if ( reply->error() == QNetworkReply::NoError )
{
QByteArray replyByteData = reply->readAll();
LOG( INFO ) << "Version Check: Recieved Data: " << replyByteData;
qInfo() << "Version Check: Recieved Data: " << replyByteData;
QJsonParseError parseError;
m_remoteVersionJsonDocument
= QJsonDocument::fromJson( replyByteData, &parseError );
@@ -1684,10 +1674,9 @@ void OverlayController::OnNetworkReply( QNetworkReply* reply )
+ QString::number( m_remoteVersionPatch )
+ ") available." );
}
LOG( INFO )
<< "Version Check: Newer version (" << m_remoteVersionMajor
<< "." << m_remoteVersionMinor << "."
<< m_remoteVersionPatch << ") available.";
qInfo() << "Version Check: Newer version ("
<< m_remoteVersionMajor << "." << m_remoteVersionMinor
<< "." << m_remoteVersionPatch << ") available.";
}
else
{
@@ -1696,22 +1685,22 @@ void OverlayController::OnNetworkReply( QNetworkReply* reply )
setVersionCheckText( m_optionalMessage );
}
setNewVersionDetected( false );
LOG( INFO ) << "Version Check: Installed version is latest "
"release.";
qInfo() << "Version Check: Installed version is latest "
"release.";
}
}
else
{
LOG( ERROR )
qCritical()
<< "Version Check: Error parsing json. QJsonParseError = "
<< parseError.error;
}
}
else
{
LOG( ERROR ) << "Version Check: Error connecting to network. "
"QNetworkReply::NetworkError = "
<< reply->error();
qCritical() << "Version Check: Error connecting to network. "
"QNetworkReply::NetworkError = "
<< reply->error();
}
reply->deleteLater();
}
+22 -8
View File
@@ -1,10 +1,10 @@
#pragma once
#include <algorithm>
#include <openvr.h>
#include <QtCore/QtCore>
// because of incompatibilities with QtOpenGL and GLEW we need to cherry pick
// includes
#include <QVector2D>
#include <QMatrix4x4>
#include <QVector>
#include <QVector2D>
@@ -22,8 +22,10 @@
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QQuickRenderTarget>
#include <memory>
#include <easylogging++.h>
#include <optional>
#include <rhi/qrhi.h>
#include "openvr/openvr_init.h"
@@ -106,18 +108,24 @@ private:
vr::VROverlayHandle_t m_ulOverlayThumbnailHandle
= vr::k_ulOverlayHandleInvalid;
QQuickRenderControl m_renderControl;
QQuickWindow m_window{ &m_renderControl };
std::optional<vr::ETextureType> m_cached_vr_texture_type;
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;
QQuickRenderTarget m_pRenderTarget;
QOpenGLContext m_openGLContext;
QOffscreenSurface m_offscreenSurface;
*/
QTimer m_pumpEventsTimer;
std::unique_ptr<QTimer> m_pRenderTimer;
bool m_dashboardVisible = false;
QPoint m_ptLastMouse;
Qt::MouseButtons m_lastMouseButtons = nullptr;
QPointF m_ptLastMouse;
Qt::MouseButtons m_lastMouseButtons;
bool m_desktopMode;
bool m_noSound;
@@ -154,7 +162,11 @@ private:
QJsonDocument m_remoteVersionJsonDocument = QJsonDocument();
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.
SteamVRTabController m_steamVRTabController;
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;
private:
QPoint getMousePositionForEvent( vr::VREvent_Mouse_t mouse );
QPointF getMousePositionForEvent( vr::VREvent_Mouse_t mouse );
void processInputBindings();
void processMediaKeyBindings();
void processMotionBindings();
@@ -184,6 +196,8 @@ private:
bool m_keyPressTwoState = false;
public:
vr::ETextureType vrTextureTypeFromRhiBackend();
vr::Texture_t vrTextureFromRhiTexture( QRhiTexture& tex );
OverlayController( bool desktopMode, bool noSound, QQmlEngine& qmlEngine );
virtual ~OverlayController();
+10 -10
View File
@@ -1,7 +1,7 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2
import QtQuick.Dialogs
import ovras.advsettings 1.0
import "." // QTBUG-34418, singletons require explicit import to load qmldir file
import "common"
@@ -415,43 +415,43 @@ MyStackViewPage {
Connections {
target: ChaperoneTabController
onChaperoneSwitchToBeginnerEnabledChanged: {
function onChaperoneSwitchToBeginnerEnabledChanged() {
switchBeginnerToggle.checked = ChaperoneTabController.chaperoneSwitchToBeginnerEnabled
}
onChaperoneSwitchToBeginnerDistanceChanged: {
function onChaperoneSwitchToBeginnerDistanceChanged() {
var d = ChaperoneTabController.chaperoneSwitchToBeginnerDistance.toFixed(2)
if (d <= switchBeginnerDistanceSlider.to && Math.abs(switchBeginnerDistanceSlider.value - d) > 0.0008) {
switchBeginnerDistanceSlider.value = d
}
switchBeginnerDistanceText.text = d
}
onChaperoneHapticFeedbackEnabledChanged: {
function onChaperoneHapticFeedbackEnabledChanged() {
hapticFeedbackToggle.checked = ChaperoneTabController.chaperoneHapticFeedbackEnabled
}
onChaperoneHapticFeedbackDistanceChanged: {
function onChaperoneHapticFeedbackDistanceChanged() {
var d = ChaperoneTabController.chaperoneHapticFeedbackDistance.toFixed(2)
if (d <= hapticFeedbackDistanceSlider.to && Math.abs(hapticFeedbackDistanceSlider.value - d) > 0.0008) {
hapticFeedbackDistanceSlider.value = d
}
hapticFeedbackDistanceText.text = d
}
onChaperoneAlarmSoundEnabledChanged: {
function onChaperoneAlarmSoundEnabledChanged() {
audioWarningToggle.checked = ChaperoneTabController.chaperoneAlarmSoundEnabled
}
onChaperoneAlarmSoundLoopingChanged: {
function onChaperoneAlarmSoundLoopingChanged() {
audioWarningLoopingToggle.checked = ChaperoneTabController.chaperoneAlarmSoundLooping
}
onChaperoneAlarmSoundDistanceChanged: {
function onChaperoneAlarmSoundDistanceChanged() {
var d = ChaperoneTabController.chaperoneAlarmSoundDistance.toFixed(2)
if (d <= audioWarningDistanceSlider.to && Math.abs(audioWarningDistanceSlider.value - d) > 0.0008) {
audioWarningDistanceSlider.value = d
}
audioWarningDistanceText.text = d
}
onChaperoneShowDashboardEnabledChanged: {
function onChaperoneShowDashboardEnabledChanged() {
openDashboardToggle.checked = ChaperoneTabController.chaperoneShowDashboardEnabled
}
onChaperoneShowDashboardDistanceChanged: {
function onChaperoneShowDashboardDistanceChanged() {
var d = ChaperoneTabController.chaperoneShowDashboardDistance.toFixed(2)
if (d <= openDashboardDistanceSlider.to && Math.abs(openDashboardDistanceSlider.value - d) > 0.0008) {
openDashboardDistanceSlider.value = d
+5 -5
View File
@@ -140,7 +140,7 @@ MyStackViewPage {
Connections {
target: FixFloorTabController
onStatusMessageSignal: {
function onStatusMessageSignal() {
if (statusMessageTimer.running) {
statusMessageTimer.stop()
}
@@ -148,15 +148,15 @@ MyStackViewPage {
statusMessageTimer.interval = FixFloorTabController.currentStatusMessageTimeout() * 1000
statusMessageTimer.start()
}
onMeasureStartSignal: {
function onMeasureStartSignal() {
fixButton.enabled = false
undoFixButton.enabled = false
}
onMeasureEndSignal: {
function onMeasureEndSignal() {
fixButton.enabled = true
// undoFixButton.enabled = FixFloorTabController.canUndo
}
onCanUndoChanged: {
function onCanUndoChanged() {
//undoFixButton.enabled = FixFloorTabController.canUndo
// revert below to this -^
undoFixButton.enabled = false
@@ -165,7 +165,7 @@ MyStackViewPage {
Connections {
target: MoveCenterTabController
onTrackingUniverseChanged: {
function onTrackingUniverseChanged() {
if (MoveCenterTabController.trackingUniverse === 0) {
fixButton.enabled = false
recenterButton.enabled = false
+10 -10
View File
@@ -524,33 +524,33 @@ MyStackViewPage {
Connections {
target: MoveCenterTabController
onOffsetXChanged: {
function onOffsetXChanged() {
spaceMoveXText.text = MoveCenterTabController.offsetX.toFixed(2)
}
onOffsetYChanged: {
function onOffsetYChanged() {
spaceMoveYText.text = MoveCenterTabController.offsetY.toFixed(2)
}
onOffsetZChanged: {
function onOffsetZChanged() {
spaceMoveZText.text = MoveCenterTabController.offsetZ.toFixed(2)
}
onRotationChanged: {
function onRotationChanged() {
spaceRotationSlider.value = ( MoveCenterTabController.rotation / 100 )
}
onTempRotationChanged: {
function onTempRotationChanged() {
var intTempRotation = MoveCenterTabController.tempRotation
spaceRotationSlider.value = ( intTempRotation / 100 )
spaceRotationText.text = ( intTempRotation / 100 ) + "°"
}
onLockXToggleChanged: {
function onLockXToggleChanged() {
lockXToggle.checked = MoveCenterTabController.lockXToggle
}
onLockYToggleChanged: {
function onLockYToggleChanged() {
lockYToggle.checked = MoveCenterTabController.lockYToggle
}
onLockZToggleChanged: {
function onLockZToggleChanged() {
lockZToggle.checked = MoveCenterTabController.lockZToggle
}
onTrackingUniverseChanged: {
function onTrackingUniverseChanged() {
if (MoveCenterTabController.trackingUniverse === 0) {
spaceModeText.text = "Sitting"
spaceSeatedRecenter.visible = true
@@ -560,7 +560,7 @@ MyStackViewPage {
spaceModeText.text = "Unknown(" + MoveCenterTabController.trackingUniverse + ")"
}
}
onOffsetProfilesUpdated: {
function onOffsetProfilesUpdated() {
reloadOffsetProfiles()
}
}
+9 -9
View File
@@ -473,7 +473,7 @@ MyStackViewPage {
Connections {
target: OverlayController
onNewVersionDetectedChanged: {
function onNewVersionDetectedChanged() {
if (OverlayController.newVersionDetected)
{
summaryVersionCheckTextRect.color = "#ff0000"
@@ -481,10 +481,10 @@ MyStackViewPage {
summaryVersionCheckTextRect.color = "#2a2e35"
}
}
onVersionCheckTextChanged: {
function onVersionCheckTextChanged() {
summaryVersionCheckText.text = OverlayController.versionCheckText
}
onDisableVersionCheckChanged: {
function onDisableVersionCheckChanged() {
if (OverlayController.disableVersionCheck)
{
summaryVersionCheckText.visible = false
@@ -503,34 +503,34 @@ MyStackViewPage {
Connections {
target: ChaperoneTabController
onChaperoneProfilesUpdated: {
function onChaperoneProfilesUpdated() {
reloadChaperoneProfiles()
}
}
Connections {
target: VideoTabController
onVideoProfilesUpdated: {
function onVideoProfilesUpdated() {
reloadVideoProfiles()
}
}
Connections {
target: AudioTabController
onMicVolumeChanged: {
function onMicVolumeChanged() {
summaryMicVolumeSlider.value = AudioTabController.micVolume
}
onMicMutedChanged: {
function onMicMutedChanged() {
summaryMicMuteToggle.checked = AudioTabController.micMuted
}
onPttEnabledChanged: {
function onPttEnabledChanged() {
summaryPttToggle.checked = AudioTabController.pttEnabled
}
}
Connections {
target: MoveCenterTabController
onTrackingUniverseChanged: {
function onTrackingUniverseChanged() {
if (MoveCenterTabController.trackingUniverse === 0) {
summaryPlaySpaceModeText.text = "Sitting"
} else if (MoveCenterTabController.trackingUniverse === 1) {
+15 -15
View File
@@ -338,66 +338,66 @@ MyStackViewPage {
Connections {
target: SettingsTabController
onAutoStartEnabledChanged: {
function onAutoStartEnabledChanged() {
settingsAutoStartToggle.checked = SettingsTabController.autoStartEnabled
}
onNativeChaperoneToggleChanged:{
function onNativeChaperoneToggleChanged(){
nativeChaperoneToggleButton.checked = SettingsTabController.nativeChaperoneToggle
}
onOculusSdkToggleChanged:{
function onOculusSdkToggleChanged(){
oculusSdkToggleButton.checked = SettingsTabController.oculusSdkToggle
}
}
Connections {
target: MoveCenterTabController
onUniverseCenteredRotationChanged: {
function onUniverseCenteredRotationChanged() {
universeCenteredRotationToggle.checked = MoveCenterTabController.universeCenteredRotation
}
}
Connections {
target: OverlayController
onVsyncDisabledChanged: {
function onVsyncDisabledChanged() {
vsyncDisabledToggle.checked = OverlayController.vsyncDisabled
customTickRateText.visible = vsyncDisabledToggle.checked
customTickRateLabel.visible = vsyncDisabledToggle.checked
customTickRateMsLabel.visible = vsyncDisabledToggle.checked
}
onCrashRecoveryDisabledChanged: {
function onCrashRecoveryDisabledChanged() {
disableCrashRecoveryToggle.checked = !OverlayController.crashRecoveryDisabled
}
onCustomTickRateMsChanged: {
function onCustomTickRateMsChanged() {
customTickRateText.text = OverlayController.customTickRateMs
}
onEnableDebugChanged: {
function onEnableDebugChanged() {
debugStateRow.visible = OverlayController.enableDebug
}
onDebugStateChanged: {
function onDebugStateChanged() {
debugStateText.text = OverlayController.debugState
}
onDisableVersionCheckChanged: {
function onDisableVersionCheckChanged() {
disableVersionCheckToggle.checked = OverlayController.disableVersionCheck
}
onExclusiveInputEnabledChanged:{
function onExclusiveInputEnabledChanged(){
exclusiveInputToggleButton.checked = OverlayController.exclusiveInputEnabled
}
onAutoApplyChaperoneEnabledChanged: {
function onAutoApplyChaperoneEnabledChanged() {
autoApplyChaperoneToggleButton.checked = OverlayController.autoApplyChaperoneEnabled
}
onSoundVolumeChanged:{
function onSoundVolumeChanged(){
volumeSlider.value = OverlayController.soundVolume
}
onDesktopModeToggleChanged:{
function onDesktopModeToggleChanged(){
desktopModeToggleButton.checked = OverlayController.desktopModeToggle
}
}
Connections{
target: ChaperoneTabController
onChaperoneProfilesUpdated: {
function onChaperoneProfilesUpdated() {
reloadChaperoneProfiles()
}
}
@@ -44,14 +44,14 @@ RowLayout {
Connections {
target: AudioTabController
onPlaybackDeviceIndexChanged: {
function onPlaybackDeviceIndexChanged() {
setShownAudioDevice(index)
}
onPlaybackDeviceListChanged: {
function onPlaybackDeviceListChanged() {
audioPlaybackNameCombo.devices = getAudioDeviceList()
setShownAudioDevice(AudioTabController.playbackDeviceIndex)
}
onPlaybackOverrideChanged: {
function onPlaybackOverrideChanged() {
playbackOverrideToggle.value = AudioTabController.playbackOverride
}
}
@@ -63,14 +63,14 @@ RowLayout {
}
Connections {
target: AudioTabController
onMicDeviceIndexChanged: {
function onMicDeviceIndexChanged() {
setShownAudioDevice(index)
}
onRecordingDeviceListChanged: {
function onRecordingDeviceListChanged() {
devices = getAudioDeviceList()
setShownAudioDevice(AudioTabController.micDeviceIndex)
}
onRecordingOverrideChanged: {
function onRecordingOverrideChanged() {
recordingOverrideToggle.value = AudioTabController.recordingOverride
}
}
@@ -89,7 +89,7 @@ ColumnLayout {
}
Connections {
target: AudioTabController
onMicDeviceIndexChanged: {
function onMicDeviceIndexChanged() {
if (index < 0) {
audioMicVolumeMinusButton.enabled = false
audioMicVolumeSlider.enabled = false
@@ -102,16 +102,16 @@ ColumnLayout {
audioMicMuteToggle.enabled = true
}
}
onMicVolumeChanged: {
function onMicVolumeChanged() {
audioMicVolumeSlider.value = AudioTabController.micVolume
}
onMicMutedChanged: {
function onMicMutedChanged() {
audioMicMuteToggle.checked = AudioTabController.micMuted
}
onPlaybackDeviceListChanged: {
function onPlaybackDeviceListChanged() {
}
onRecordingDeviceListChanged: {
function onRecordingDeviceListChanged() {
if (AudioTabController.micDeviceIndex < 0) {
audioMicVolumeMinusButton.enabled = false
audioMicVolumeSlider.enabled = false
@@ -41,10 +41,10 @@ RowLayout {
}
Connections {
target: AudioTabController
onMirrorDeviceIndexChanged: {
function onMirrorDeviceIndexChanged() {
setShownAudioDevice(index)
}
onPlaybackDeviceListChanged: {
function onPlaybackDeviceListChanged() {
audioMirrorNameCombo.devices = getAudioDeviceList()
setShownAudioDevice(AudioTabController.mirrorDeviceIndex)
}
@@ -89,7 +89,7 @@ ColumnLayout {
}
Connections {
target: AudioTabController
onMirrorDeviceIndexChanged: {
function onMirrorDeviceIndexChanged() {
if (index < 0) {
audioMirrorNameCombo.deviceIndex = 0
audioMirrorVolumeMinusButton.enabled = false
@@ -104,13 +104,13 @@ ColumnLayout {
audioMirrorNameCombo.deviceIndex = index + 1
}
}
onMirrorVolumeChanged: {
function onMirrorVolumeChanged() {
audioMirrorVolumeSlider.value = AudioTabController.mirrorVolume
}
onMirrorMutedChanged: {
function onMirrorMutedChanged() {
audioMirrorMuteToggle.checked = AudioTabController.mirrorMuted
}
onPlaybackDeviceListChanged: {
function onPlaybackDeviceListChanged() {
if (AudioTabController.mirrorDeviceIndex < 0) {
audioMirrorVolumeMinusButton.enabled = false
audioMirrorVolumeSlider.enabled = false
@@ -98,13 +98,13 @@ ColumnLayout {
}
Connections {
target: AudioTabController
onAudioProfilesUpdated: {
function onAudioProfilesUpdated() {
reloadAudioProfiles()
}
onAudioProfileAdded: {
function onAudioProfileAdded() {
audioProfileComboBox.currentIndex = AudioTabController.getAudioProfileCount()
}
onDefaultProfileDisplay: {
function onDefaultProfileDisplay() {
audioProfileComboBox.currentIndex = AudioTabController.getDefaultAudioProfileIndex(
) + 1
}
@@ -21,7 +21,7 @@ MyToggleButton {
}
Connections {
target: AudioTabController
onMicProximitySensorCanMuteChanged: {
function onMicProximitySensorCanMuteChanged() {
audioMuteProximitySensorToggle.checked = AudioTabController.micProximitySensorCanMute
}
}
@@ -39,13 +39,13 @@ ColumnLayout {
}
Connections {
target: AudioTabController
onPttEnabledChanged: {
function onPttEnabledChanged() {
audioPttEnabledToggle.checked = AudioTabController.pttEnabled
}
onMicReversePttChanged: {
function onMicReversePttChanged() {
audioPttReverseToggle.checked = AudioTabController.micReversePtt
}
onPttShowNotificationChanged: {
function onPttShowNotificationChanged() {
audioPttShowNotificationToggle.checked = AudioTabController.pttShowNotification
}
}
+9 -9
View File
@@ -1,7 +1,7 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2
import QtQuick.Dialogs
import ovras.advsettings 1.0
import "." // QTBUG-34418, singletons require explicit import to load qmldir file
import "../common"
@@ -586,26 +586,26 @@ MyStackViewPage {
Connections {
target: ChaperoneTabController
onBoundsVisibilityChanged: {
function onBoundsVisibilityChanged() {
if (Math.abs(chaperoneVisibilitySlider.value - ChaperoneTabController.boundsVisibility) > 0.008) {
chaperoneVisibilitySlider.value = ChaperoneTabController.boundsVisibility
}
}
onFadeDistanceChanged: {
function onFadeDistanceChanged() {
var d = ChaperoneTabController.fadeDistance.toFixed(1)
if (d <= chaperoneFadeDistanceSlider.to && Math.abs(chaperoneFadeDistanceSlider.value - d) > 0.008) {
chaperoneFadeDistanceSlider.value = d
}
chaperoneFadeDistanceText.text = d
}
onHeightChanged: {
function onHeightChanged() {
var h = ChaperoneTabController.height.toFixed(2)
if (h <= chaperoneHeightSlider.to && Math.abs(chaperoneHeightSlider.value - h) > 0.008) {
chaperoneHeightSlider.value = h
}
chaperoneHeightText.text = h
}
onChaperoneDimHeightChanged: {
function onChaperoneDimHeightChanged() {
var dim = ChaperoneTabController.chaperoneDimHeight
if(dim > 0.0){
chaperoneDisableChaperone.enabled = false;
@@ -625,16 +625,16 @@ MyStackViewPage {
chaperoneFadeDistanceText.enabled = true;
}
}
onCenterMarkerNewChanged: {
function onCenterMarkerNewChanged() {
chaperoneCenterMarkerToggle.checked = ChaperoneTabController.centerMarkerNew
}
onPlaySpaceMarkerChanged: {
function onPlaySpaceMarkerChanged() {
chaperonePlaySpaceToggle.checked = ChaperoneTabController.playSpaceMarker
}
onForceBoundsChanged: {
function onForceBoundsChanged() {
chaperoneForceBoundsToggle.checked = ChaperoneTabController.forceBounds
}
onChaperoneProfilesUpdated: {
function onChaperoneProfilesUpdated() {
reloadChaperoneProfiles()
}
}
@@ -1,7 +1,7 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2
import QtQuick.Dialogs
import ovras.advsettings 1.0
import "." // QTBUG-34418, singletons require explicit import to load qmldir file
import "../../common"
@@ -113,7 +113,7 @@ MyStackViewPage {
Connections {
target: ChaperoneTabController
onChaperoneDimHeightChanged: {
function onChaperoneDimHeightChanged() {
var d = ChaperoneTabController.chaperoneDimHeight.toFixed(2)
if (d <= dimHeightSlider.to && Math.abs(dimHeightSlider.value - d) > 0.0008) {
dimHeightSlider.value = d
@@ -180,17 +180,17 @@ GroupBox {
Connections {
target: ChaperoneTabController
onChaperoneColorRChanged:{
function onChaperoneColorRChanged(){
var redValue = ChaperoneTabController.chaperoneColorR
colorRedText.text = redValue
chaperoneColorRedSlider.value = redValue
}
onChaperoneColorGChanged:{
function onChaperoneColorGChanged(){
var greenValue = ChaperoneTabController.chaperoneColorG
colorGreenText.text = greenValue
chaperoneColorGreenSlider.value = greenValue
}
onChaperoneColorBChanged:{
function onChaperoneColorBChanged(){
var blueValue = ChaperoneTabController.chaperoneColorB
colorBlueText.text = blueValue
chaperoneColorBlueSlider.value = blueValue
@@ -70,10 +70,10 @@ GroupBox {
Connections {
target: ChaperoneTabController
onChaperoneFloorToggleChanged:{
function onChaperoneFloorToggleChanged(){
chaperoneFloorToggleBtn.checked = ChaperoneTabController.chaperoneFloorToggle
}
onCenterMarkerChanged:{
function onCenterMarkerChanged(){
legacyCenterMarkerbtn.checked = ChaperoneTabController.centerMarker
}
}
@@ -112,7 +112,7 @@ GroupBox {
Connections {
target: ChaperoneTabController
onCollisionBoundStyleChanged:{
function onCollisionBoundStyleChanged(){
var collisiontype = ChaperoneTabController.collisionBoundStyle
switch(collisiontype){
case 0: denseRadio.checked = true; break;
+1 -1
View File
@@ -39,7 +39,7 @@ TextField {
}
Connections {
target: OverlayController
onKeyBoardInputSignal: {
function onKeyBoardInputSignal() {
if (userValue == keyBoardUID) {
if (myTextField.text !== input) {
myTextField.onInputEvent(input)
@@ -218,19 +218,19 @@ GroupBox {
Connections {
target: MoveCenterTabController
onGravityActiveChanged: {
function onGravityActiveChanged() {
gravityToggleButton.checked = MoveCenterTabController.gravityActive
}
onGravityStrengthChanged: {
function onGravityStrengthChanged() {
gravityStrengthText.text = MoveCenterTabController.gravityStrength.toFixed(2)
}
onMomentumSaveChanged: {
function onMomentumSaveChanged() {
momentumToggleButton.checked = MoveCenterTabController.momentumSave
}
onFlingStrengthChanged: {
function onFlingStrengthChanged() {
flingStrengthText.text = MoveCenterTabController.flingStrength.toFixed(2)
}
onFrictionPercentChanged: {
function onFrictionPercentChanged() {
frictionPercentText.text = MoveCenterTabController.frictionPercent + "%"
}
}
@@ -88,10 +88,10 @@ GroupBox {
Connections {
target: MoveCenterTabController
onHeightToggleChanged: {
function onHeightToggleChanged() {
heightToggleButton.checked = MoveCenterTabController.heightToggle
}
onHeightToggleOffsetChanged: {
function onHeightToggleOffsetChanged() {
heightToggleOffsetText.text = MoveCenterTabController.heightToggleOffset.toFixed(2)
}
}
@@ -156,19 +156,19 @@ GroupBox {
Connections {
target: MoveCenterTabController
onMoveShortcutLeftChanged: {
function onMoveShortcutLeftChanged() {
moveShortcutLeft.checked = MoveCenterTabController.moveShortcutLeft
}
onMoveShortcutRightChanged: {
function onMoveShortcutRightChanged() {
moveShortcutRight.checked = MoveCenterTabController.moveShortcutRight
}
onDragComfortFactorChanged: {
function onDragComfortFactorChanged() {
dragComfortSlider.value = MoveCenterTabController.dragComfortFactor
}
onDragBoundsChanged: {
function onDragBoundsChanged() {
dragBounds.checked = MoveCenterTabController.dragBounds
}
onDragMultChanged: {
function onDragMultChanged() {
dragMultText.text = MoveCenterTabController.dragMult.toFixed(2)
}
}
@@ -312,23 +312,23 @@ GroupBox {
Connections {
target: RotationTabController
onAutoTurnEnabledChanged: {
function onAutoTurnEnabledChanged() {
autoTurn.checked = RotationTabController.autoTurnEnabled
}
onAutoTurnActivationDistanceChanged: {
function onAutoTurnActivationDistanceChanged() {
activationSlider.value = RotationTabController.autoTurnActivationDistance.toFixed(2)
}
onAutoTurnDeactivationDistanceChanged:{
function onAutoTurnDeactivationDistanceChanged(){
deactivationSlider.value = RotationTabController.autoTurnDeactivationDistance.toFixed(2)
}
onAutoTurnUseCornerAngleChanged:{
function onAutoTurnUseCornerAngleChanged(){
cornerAngle.checked = RotationTabController.autoTurnUseCornerAngle
}
onAutoTurnSpeedChanged:{
function onAutoTurnSpeedChanged(){
var val = RotationTabController.autoTurnSpeed
speedSlider.value = ((val/100).toFixed())
}
onAutoTurnModeChanged:{
function onAutoTurnModeChanged(){
if(RotationTabController.autoTurnMode === 1){
autoTurnModeToggle.checked = true;
@@ -338,13 +338,13 @@ GroupBox {
autoTurnModeToggle.checked = false;
}
}
onMinCordTangleChanged:{
function onMinCordTangleChanged(){
detangleAngleStartText.text = parseInt(RotationTabController.minCordTangle*(180/Math.PI))+ "°"
}
onCordDetangleAngleChanged:{
function onCordDetangleAngleChanged(){
detangleAngleAssistText.text = parseInt(RotationTabController.cordDetangleAngle*(180/Math.PI))+ "°"
}
onAutoTurnShowNotificationChanged:{
function onAutoTurnShowNotificationChanged(){
autoTurnNotificationToggle.checked = RotationTabController.autoTurnShowNotification
}
}
@@ -115,10 +115,10 @@ GroupBox {
Connections {
target: RotationTabController
onVestibularMotionEnabledChanged:{
function onVestibularMotionEnabledChanged(){
redirectedModeToggle.checked = RotationTabController.vestibularMotionEnabled
}
onVestibularMotionRadiusChanged:{
function onVestibularMotionRadiusChanged(){
redirectedWalkingRadiusText.text = ((RotationTabController.vestibularMotionRadius).toFixed(2))
}
}
@@ -103,10 +103,10 @@ GroupBox {
Connections {
target: MoveCenterTabController
onSnapTurnAngleChanged: {
function onSnapTurnAngleChanged() {
snapTurnAngleText.text = ( Math.round( MoveCenterTabController.snapTurnAngle / 100 ) ) + "°"
}
onSmoothTurnRateChanged: {
function onSmoothTurnRateChanged() {
smoothTurnRateText.text = MoveCenterTabController.smoothTurnRate + "%"
}
}
@@ -100,16 +100,16 @@ GroupBox {
Connections {
target: MoveCenterTabController
onTurnBindLeftChanged: {
function onTurnBindLeftChanged() {
turnBindLeft.checked = MoveCenterTabController.turnBindLeft
}
onTurnBindRightChanged: {
function onTurnBindRightChanged() {
turnBindRight.checked = MoveCenterTabController.turnBindRight
}
onTurnComfortFactorChanged: {
function onTurnComfortFactorChanged() {
turnComfortSlider.value = MoveCenterTabController.turnComfortFactor
}
onTurnBoundsChanged: {
function onTurnBoundsChanged() {
turnBounds.checked = MoveCenterTabController.turnBounds
}
}
@@ -76,10 +76,10 @@ GroupBox {
Connections {
target: RotationTabController
onViewRatchettingEnabledChanged:{
function onViewRatchettingEnabledChanged(){
viewRatchetToggleBtn.checked = RotationTabController.viewRatchettingEnabled
}
onViewRatchettingPercentChanged:{
function onViewRatchettingPercentChanged(){
var ratchetPercVal = RotationTabController.viewRatchettingPercent
viewRatchetSlider.value = ratchetPercVal
viewRatchetText.text = ratchetPercVal.toFixed(2)
@@ -92,13 +92,13 @@ GroupBox {
Connections {
target: SteamVRTabController
onCameraActiveChanged: {
function onCameraActiveChanged() {
steamvrCameraActiveToggle.checked = SteamVRTabController.cameraActive
}
onCameraContChanged: {
function onCameraContChanged() {
steamvrCameraContToggle.checked = SteamVRTabController.cameraCont
}
onCameraBoundsChanged: {
function onCameraBoundsChanged() {
steamvrCameraBoundsToggle.checked = SteamVRTabController.cameraBounds
}
@@ -2,7 +2,7 @@ import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2
import QtQuick.Dialogs
import ovras.advsettings 1.0
import "." // QTBUG-34418, singletons require explicit import to load qmldir file
import "../../common"
@@ -185,11 +185,11 @@ MyStackViewPage {
}
Connections{
target: SteamVRTabController
onPairStatusChanged: {
function onPairStatusChanged() {
statusText.text = value;
getRXTX()
}
onUpdateRXTX:{
function onUpdateRXTX(){
getRXTX()
}
@@ -130,7 +130,7 @@ GroupBox {
Connections {
target: SteamVRTabController
onPerformanceGraphChanged:{
function onPerformanceGraphChanged() {
steamvrBindingToggle.checked = SteamVRTabController.perAppBindEnabled
}
@@ -131,25 +131,25 @@ GroupBox {
Connections {
target: SteamVRTabController
onPerformanceGraphChanged:{
function onPerformanceGraphChanged(){
steamvrPerformanceGraphToggle.checked = SteamVRTabController.performanceGraph
}
onSystemButtonChanged:{
function onSystemButtonChanged(){
steamvrSystemButtonToggle.checked = SteamVRTabController.systemButton
}
onMultipleDriverChanged:{
function onMultipleDriverChanged(){
steamvrMultipleDriverToggle.checked = SteamVRTabController.multipleDriver
}
onNoFadeToGridChanged:{
function onNoFadeToGridChanged(){
steamvrNoFadeToGridToggle.checked = SteamVRTabController.noFadeToGrid
}
onDNDChanged:{
function onDNDChanged(){
steamvrNotificationToggle.checked = SteamVRTabController.dnd
}
onNoHMDChanged:{
function onNoHMDChanged(){
steamvrNoHMDToggle.checked = SteamVRTabController.noHMD
}
onControllerPowerChanged:{
function onControllerPowerChanged(){
steamvrControllerPowerToggle.checked = SteamVRTabController.controllerPower
}
@@ -103,10 +103,10 @@ GroupBox {
}
Connections {
target: VrAlarm
onAlarmEnabledChanged: {
function onAlarmEnabledChanged() {
alarmClockToggle.checked = VrAlarm.alarmEnabled
}
onAlarmTimeChanged: {
function onAlarmTimeChanged() {
alarmClockTimeAssembly.changeTimer(VrAlarm.getAlarmHour(),
VrAlarm.getAlarmMinute(),
VrAlarm.getAlarmSecond())
@@ -45,7 +45,7 @@ GroupBox {
}
Connections {
target: OverlayController
onKeyBoardInputSignal: {
function onKeyBoardInputSignal() {
if (userValue == 601) {
UtilitiesTabController.sendKeyboardInput(input)
}
@@ -581,7 +581,7 @@ GroupBox {
}
Connections {
target: UtilitiesTabController
onVrcDebugChanged: {
function onVrcDebugChanged() {
vrcDebugRow.visible = UtilitiesTabController.vrcDebug
}
}
+1 -1
View File
@@ -53,7 +53,7 @@ GroupBox {
Connections {
target: UtilitiesTabController
onTrackerOvlEnabledChanged:{
function onTrackerOvlEnabledChanged(){
trackerOvlToggle.checked = UtilitiesTabController.trackerOvlEnabled
}
+1 -1
View File
@@ -47,7 +47,7 @@ MyStackViewPage {
Connections {
target: VideoTabController
onIsOverlayMethodActiveChanged:{
function onIsOverlayMethodActiveChanged(){
overlayMethodGroupBox.visible = VideoTabController.isOverlayMethodActive
brightnessGroupBox.visible = !(VideoTabController.isOverlayMethodActive);
colorGroupBox.visible = !(VideoTabController.isOverlayMethodActive);
@@ -95,12 +95,12 @@ GroupBox {
Connections {
target: VideoTabController
onBrightnessOpacityValueChanged: {
function onBrightnessOpacityValueChanged() {
var brightvalue = VideoTabController.brightnessOpacityValue
brightnessSlider.value = brightvalue
brightnessValueText.text = Math.round(brightvalue*100)+ "%"
}
onBrightnessEnabledChanged: {
function onBrightnessEnabledChanged() {
brightnessToggle.checked = VideoTabController.brightnessEnabled
}
}
@@ -197,17 +197,17 @@ GroupBox {
Connections {
target: VideoTabController
onColorRedChanged:{
function onColorRedChanged(){
var redValue = VideoTabController.colorRed
colorRedText.text = Math.round(redValue * 100) + "%"
colorRedSlider.value = redValue
}
onColorGreenChanged:{
function onColorGreenChanged(){
var greenValue = VideoTabController.colorGreen
colorGreenText.text = Math.round(greenValue * 100) + "%"
colorGreenSlider.value = greenValue
}
onColorBlueChanged:{
function onColorBlueChanged(){
var blueValue = VideoTabController.colorBlue
colorBlueText.text = Math.round(blueValue * 100) + "%"
colorBlueSlider.value = blueValue
@@ -73,14 +73,14 @@ GroupBox {
Connections {
target: VideoTabController
onAllowSupersampleFilteringChanged: {
function onAllowSupersampleFilteringChanged() {
videoAllowSupersampleFilteringToggle.checked = VideoTabController.allowSupersampleFiltering
}
onMotionSmoothingChanged: {
function onMotionSmoothingChanged() {
videoMotionSmoothingToggle.checked = VideoTabController.motionSmoothing
}
onIsOverlayMethodActiveChanged:{
function onIsOverlayMethodActiveChanged(){
videoUseOverlayToggle.checked = VideoTabController.isOverlayMethodActive
}
@@ -298,32 +298,33 @@ GroupBox {
Connections {
target: VideoTabController
onBrightnessOpacityValueChanged: {
function onBrightnessOpacityValueChanged() {
var brightvalue = VideoTabController.brightnessOpacityValue
brightnessSlider.value = brightvalue
brightnessValueText.text = Math.round(brightvalue*100)+ "%"
brightnessSlider.value = VideoTabController.brightnessOpacityValue
}
onBrightnessEnabledChanged: {
function onBrightnessEnabledChanged() {
brightnessToggle.checked = VideoTabController.brightnessEnabled
}
onColorOverlayOpacityChanged:{
function onColorOverlayOpacityChanged(){
opacitySlider.value = VideoTabController.colorOverlayOpacity
}
onColorOverlayEnabledChanged:{
function onColorOverlayEnabledChanged(){
colorToggle.checked = VideoTabController.colorOverlayEnabled
}
onColorRedChanged:{
function onColorRedChanged(){
var redValue = VideoTabController.colorRed
colorRedText.text = Math.round(redValue * 100) + "%"
colorRedSlider.value = redValue
}
onColorGreenChanged:{
function onColorGreenChanged(){
var greenValue = VideoTabController.colorGreen
colorGreenText.text = Math.round(greenValue * 100) + "%"
colorGreenSlider.value = greenValue
}
onColorBlueChanged:{
function onColorBlueChanged(){
var blueValue = VideoTabController.colorBlue
colorBlueText.text = Math.round(blueValue * 100) + "%"
colorBlueSlider.value = blueValue
@@ -108,10 +108,10 @@ GroupBox {
}
Connections {
target: VideoTabController
onVideoProfilesUpdated: {
function onVideoProfilesUpdated() {
reloadVideoProfiles()
}
onVideoProfileAdded: {
function onVideoProfileAdded() {
videoProfileComboBox.currentIndex = VideoTabController.getVideoProfileCount()
}
@@ -133,12 +133,12 @@ GroupBox {
Connections {
target: VideoTabController
onSuperSamplingChanged: {
function onSuperSamplingChanged() {
var s1 = VideoTabController.superSampling
videoSupersamplingSlider.value = s1
videoSupersamplingText.text = s1.toFixed(2)
}
onAllowSupersampleOverrideChanged: {
function onAllowSupersampleOverrideChanged() {
videoAllowSupersampleOverrideToggle.checked = VideoTabController.allowSupersampleOverride
var s1 = VideoTabController.superSampling
videoSupersamplingSlider.value = s1
+68 -34
View File
@@ -1,34 +1,68 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/common">
<file alias="backarrow">img/common/backarrow.svg</file>
<file alias="box_checkmark">img/common/check.svg</file>
</qresource>
<qresource prefix="/microphone">
<file alias="on">img/audio/microphone/mic_on.svg</file>
<file alias="off">img/audio/microphone/mic_off.svg</file>
</qresource>
<qresource prefix="/speaker">
<file alias="on">img/audio/speaker/speaker_on.svg</file>
<file alias="off">img/audio/speaker/speaker_off.svg</file>
</qresource>
<qresource prefix="/media_keys">
<file alias="play_pause">img/audio/media_keys/outline_play_pause_white_24dp.svg</file>
<file alias="next">img/audio/media_keys/outline_skip_next_white_24dp.svg</file>
<file alias="previous">img/audio/media_keys/outline_skip_previous_white_24dp.svg</file>
<file alias="stop">img/audio/media_keys/outline_stop_white_24dp.svg</file>
</qresource>
<qresource prefix="/main_menu_icons">
<file alias="audio_tab_icon">img/main_menu_icons/audio_tab_icon.svg</file>
<file alias="bindings_tab_icon">img/main_menu_icons/bindings_tab_icon.svg</file>
<file alias="chaperone_tab_icon">img/main_menu_icons/chaperone_tab_icon.svg</file>
<file alias="motion_tab_icon">img/main_menu_icons/motion_tab_icon.svg</file>
<file alias="offsets_tab_icon">img/main_menu_icons/offsets_tab_icon.svg</file>
<file alias="settings_tab_icon">img/main_menu_icons/settings_tab_icon.svg</file>
<file alias="space_fix_tab_icon">img/main_menu_icons/space_fix_tab_icon.svg</file>
<file alias="statistics_tab_icon">img/main_menu_icons/statistics_tab_icon.svg</file>
<file alias="steamvr_tab_icon">img/main_menu_icons/steamvr_tab_icon.svg</file>
<file alias="utilities_tab_icon">img/main_menu_icons/utilities_tab_icon.svg</file>
<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>
</RCC>
<RCC>
<qresource prefix="/common">
<file alias="backarrow">img/common/backarrow.svg</file>
<file alias="box_checkmark">img/common/check.svg</file>
</qresource>
<qresource prefix="/microphone">
<file alias="on">img/audio/microphone/mic_on.svg</file>
<file alias="off">img/audio/microphone/mic_off.svg</file>
<file alias="ptt_notification.png">img/audio/microphone/ptt_notification.png</file>
<file alias="ptm_notification.png">img/audio/microphone/ptm_notification.png</file>
<file alias="ptt_notification.svg">img/audio/microphone/ptt_notification.svg</file>
</qresource>
<qresource prefix="/speaker">
<file alias="on">img/audio/speaker/speaker_on.svg</file>
<file alias="off">img/audio/speaker/speaker_off.svg</file>
</qresource>
<qresource prefix="/media_keys">
<file alias="play_pause">img/audio/media_keys/outline_play_pause_white_24dp.svg</file>
<file alias="next">img/audio/media_keys/outline_skip_next_white_24dp.svg</file>
<file alias="previous">img/audio/media_keys/outline_skip_previous_white_24dp.svg</file>
<file alias="stop">img/audio/media_keys/outline_stop_white_24dp.svg</file>
</qresource>
<qresource prefix="/main_menu_icons">
<file alias="audio_tab_icon">img/main_menu_icons/audio_tab_icon.svg</file>
<file alias="bindings_tab_icon">img/main_menu_icons/bindings_tab_icon.svg</file>
<file alias="chaperone_tab_icon">img/main_menu_icons/chaperone_tab_icon.svg</file>
<file alias="motion_tab_icon">img/main_menu_icons/motion_tab_icon.svg</file>
<file alias="offsets_tab_icon">img/main_menu_icons/offsets_tab_icon.svg</file>
<file alias="settings_tab_icon">img/main_menu_icons/settings_tab_icon.svg</file>
<file alias="space_fix_tab_icon">img/main_menu_icons/space_fix_tab_icon.svg</file>
<file alias="statistics_tab_icon">img/main_menu_icons/statistics_tab_icon.svg</file>
<file alias="steamvr_tab_icon">img/main_menu_icons/steamvr_tab_icon.svg</file>
<file alias="utilities_tab_icon">img/main_menu_icons/utilities_tab_icon.svg</file>
<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 <array>
#include <vector>
#include <easylogging++.h>
#include <QtLogging>
#include <QtDebug>
#include "../settings.h"
#include "setting_value.h"
#include "../../utils/setup.h"
@@ -64,12 +65,12 @@ void verifySettings( std::array<Value, ArraySize> v ) noexcept
const auto enumSettingNumber = static_cast<int>( currentSetting );
LOG( ERROR ) << enumName << ": at index '" << settingIndex
<< "' is incorrect. Current value: '"
<< enumSettingNumber
<< "'. Exiting "
"with error code "
<< ReturnErrorCode::SETTING_INCORRECT_INDEX << ".";
qCritical() << enumName << ": at index '" << settingIndex
<< "' is incorrect. Current value: '"
<< enumSettingNumber
<< "'. Exiting "
"with error code "
<< ReturnErrorCode::SETTING_INCORRECT_INDEX << ".";
exit( ReturnErrorCode::SETTING_INCORRECT_INDEX );
}
}
+1 -1
View File
@@ -84,7 +84,7 @@ void saveQtSetting( const SettingCategory category,
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();
@@ -1,6 +1,5 @@
#pragma once
#include <list>
#include <easylogging++.h>
namespace settings
{
+4 -3
View File
@@ -1,5 +1,6 @@
#include <utility>
#include <easylogging++.h>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h"
#include "internal/settings_controller.h"
@@ -14,9 +15,9 @@ void saveChangedSettings()
void saveAllSettings()
{
LOG( INFO ) << "Saving all settings.";
qInfo() << "Saving all settings.";
settingController.saveAllSettings();
LOG( INFO ) << "All settings saved.";
qInfo() << "All settings saved.";
}
[[nodiscard]] bool getSetting( const BoolSetting setting )
+98 -106
View File
@@ -1,6 +1,8 @@
#include "AudioTabController.h"
#include <QQuickWindow>
#include <QApplication>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h"
#include "../settings/settings.h"
#include "../settings/settings_object.h"
@@ -39,11 +41,11 @@ void AudioTabController::initStage1()
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qWarning() << "Could not read \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
else
{
@@ -63,8 +65,9 @@ void AudioTabController::initStage1()
eventLoopTick();
}
void AudioTabController::initStage2()
void AudioTabController::initStage2( OverlayController* var_parent )
{
this->parent = var_parent;
const auto pushToTalkOverlayKey
= std::string( application_strings::applicationKey )
+ ".pptnotification";
@@ -75,43 +78,40 @@ void AudioTabController::initStage2()
&m_pushToTalkValues.overlayHandle );
if ( overlayError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Could not create ptt notification overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
qCritical() << "Could not create ptt notification overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
emit defaultProfileDisplay();
return;
}
constexpr auto pushToTalkIconFilepath
= "/res/img/audio/microphone/ptt_notification.png";
constexpr auto pushToMuteIconFilepath
= "/res/img/audio/microphone/ptm_notification.png";
QImage pushToTalkIcon;
Q_ASSERT( pushToTalkIcon.load(
QString( "qrc:/res/img/audio/microphone/ptt_notification.png" ) ) );
QImage pushToMuteIcon;
Q_ASSERT( pushToMuteIcon.load(
QString( "qrc:/res/img/audio/microphone/ptt_notification.png" ) ) );
const auto pushToTalkIconFilePath
= paths::verifyIconFilePath( pushToTalkIconFilepath );
const auto pushToMuteIconFilePath
= paths::verifyIconFilePath( pushToMuteIconFilepath );
emit defaultProfileDisplay();
return;
if ( !pushToTalkIconFilePath.has_value()
|| !pushToMuteIconFilePath.has_value() )
{
emit defaultProfileDisplay();
return;
}
auto* rhi = parent->m_renderControl.rhi();
m_pushToTalkValues.pushToTalkTex.reset(
rhi->newTexture( QRhiTexture::RGBA8, pushToTalkIcon.size(), 1 ) );
m_pushToTalkValues.pushToMuteTex.reset(
rhi->newTexture( QRhiTexture::RGBA8, pushToTalkIcon.size(), 1 ) );
m_pushToTalkValues.pushToTalkPath = *pushToTalkIconFilePath;
m_pushToTalkValues.pushToMutePath = *pushToMuteIconFilePath;
auto pushToPath = m_pushToTalkValues.pushToTalkPath.c_str();
auto* pushToTex = m_pushToTalkValues.pushToTalkTex.get();
if ( settings::getSetting( settings::BoolSetting::AUDIO_micReversePtt ) )
{
pushToPath = m_pushToTalkValues.pushToMutePath.c_str();
pushToTex = m_pushToTalkValues.pushToMuteTex.get();
}
vr::VROverlay()->SetOverlayFromFile( m_pushToTalkValues.overlayHandle,
pushToPath );
auto tex = parent->vrTextureFromRhiTexture( *pushToTex );
vr::VROverlay()->SetOverlayTexture( m_pushToTalkValues.overlayHandle,
&tex );
vr::VROverlay()->SetOverlayWidthInMeters( m_pushToTalkValues.overlayHandle,
0.02f );
vr::HmdMatrix34_t notificationTransform
@@ -196,11 +196,11 @@ void AudioTabController::eventLoopTick()
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qWarning() << "Could not read \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
if ( lastMirrorDevId.compare( mirrorDeviceId ) != 0 )
{
@@ -358,15 +358,11 @@ void AudioTabController::setMicReversePtt( bool value, bool notify )
if ( value )
{
vr::VROverlay()->SetOverlayFromFile(
m_pushToTalkValues.overlayHandle,
m_pushToTalkValues.pushToMutePath.c_str() );
// vr::VROverlay()->SetOverlayFromFile(m_ptt_overlayHandle,/*pt_mute*/);
}
else
{
vr::VROverlay()->SetOverlayFromFile(
m_pushToTalkValues.overlayHandle,
m_pushToTalkValues.pushToTalkPath.c_str() );
// vr::VROverlay()->SetOverlayFromFile(m_ptt_overlayHandle,/*pt_talk*/);
}
if ( pttEnabled() )
@@ -447,17 +443,17 @@ bool indexIsValid( const int index,
{
if ( index < 0 )
{
LOG( ERROR ) << functionName
<< " called with index below zero: " << index;
qCritical() << functionName
<< " called with index below zero: " << index;
return false;
}
if ( static_cast<size_t>( index ) >= devices.size() )
{
LOG( ERROR ) << functionName
<< " called with index greater than size of "
"devices '"
<< devices.size() << "', index '" << index << "'.";
qCritical() << functionName
<< " called with index greater than size of "
"devices '"
<< devices.size() << "', index '" << index << "'.";
return false;
}
@@ -571,12 +567,11 @@ void AudioTabController::setMirrorDeviceIndex( int index, bool notify )
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING )
<< "Could not remove \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qWarning() << "Could not remove \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
else
{
@@ -596,12 +591,11 @@ void AudioTabController::setMirrorDeviceIndex( int index, bool notify )
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING )
<< "Could not write \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qWarning() << "Could not write \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
else
{
@@ -883,12 +877,11 @@ void AudioTabController::deleteAudioProfile( unsigned index )
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING )
<< "Could not remove \""
<< vr::k_pch_audio_PlaybackDeviceOverrideName_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qWarning() << "Could not remove \""
<< vr::k_pch_audio_PlaybackDeviceOverrideName_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
vr::VRSettings()->RemoveKeyInSection(
@@ -897,12 +890,11 @@ void AudioTabController::deleteAudioProfile( unsigned index )
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING )
<< "Could not remove \""
<< vr::k_pch_audio_RecordingDeviceOverrideName_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qWarning() << "Could not remove \""
<< vr::k_pch_audio_RecordingDeviceOverrideName_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
}
audioProfiles.erase( pos );
@@ -936,9 +928,9 @@ void AudioTabController::setPlaybackOverride( bool value, bool notify )
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "Could not set playback override setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qCritical() << "Could not set playback override setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
if ( notify )
{
@@ -959,9 +951,9 @@ void AudioTabController::setRecordingOverride( bool value, bool notify )
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "Could not set recording override setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qCritical() << "Could not set recording override setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
if ( notify )
{
@@ -979,10 +971,10 @@ void AudioTabController::initOverride()
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "Could not get recording override setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
LOG( INFO ) << "Setting recording override to false";
qCritical() << "Could not get recording override setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qInfo() << "Setting recording override to false";
setRecordingOverride( false );
}
else
@@ -995,10 +987,10 @@ void AudioTabController::initOverride()
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "Could not get playback override setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
LOG( INFO ) << "Setting playback override to false";
qCritical() << "Could not get playback override setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qInfo() << "Setting playback override to false";
setPlaybackOverride( false );
}
else
@@ -1091,11 +1083,11 @@ void AudioTabController::setDefaultPlayback( int index, bool notify )
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not write \""
<< vr::k_pch_audio_PlaybackDeviceOverrideName_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qWarning() << "Could not write \""
<< vr::k_pch_audio_PlaybackDeviceOverrideName_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
else
{
@@ -1114,11 +1106,11 @@ void AudioTabController::setDefaultMic( int index, bool notify )
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not write \""
<< vr::k_pch_audio_RecordingDeviceOverrideName_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qWarning() << "Could not write \""
<< vr::k_pch_audio_RecordingDeviceOverrideName_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
else
{
@@ -1138,11 +1130,11 @@ void AudioTabController::setDefaultMirror( int index, bool notify )
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not remove \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qWarning() << "Could not remove \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
else
{
@@ -1159,11 +1151,11 @@ void AudioTabController::setDefaultMirror( int index, bool notify )
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not write \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qWarning() << "Could not write \""
<< vr::k_pch_audio_PlaybackMirrorDevice_String
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
else
{
@@ -1258,7 +1250,7 @@ void AudioTabController::shutdown()
{
setMirrorDeviceIndex( -1 );
}
LOG( INFO ) << "Audio Tab Controller Has Shut Down";
qInfo() << "Audio Tab Controller Has Shut Down";
}
bool AudioTabController::pttEnabled() const
+5 -3
View File
@@ -5,6 +5,7 @@
#include "audiomanager/AudioManager.h"
#include <memory>
#include <rhi/qrhi.h>
#include "../utils/FrameRateUtils.h"
#include "../settings/settings_object.h"
@@ -111,11 +112,12 @@ class AudioTabController : public QObject
setPttShowNotification NOTIFY pttShowNotificationChanged )
private:
OverlayController* parent;
struct
{
vr::VROverlayHandle_t overlayHandle = vr::k_ulOverlayHandleInvalid;
std::string pushToTalkPath;
std::string pushToMutePath;
std::unique_ptr<QRhiTexture> pushToTalkTex;
std::unique_ptr<QRhiTexture> pushToMuteTex;
} m_pushToTalkValues;
int m_playbackDeviceIndex = -1;
@@ -178,7 +180,7 @@ private:
public:
void initStage1();
void initStage2();
void initStage2( OverlayController* var_parent );
void reloadAudioSettings();
+18 -17
View File
@@ -1,5 +1,7 @@
#include "ChaperoneTabController.h"
#include <QQuickWindow>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h"
#include "../settings/settings.h"
#include "../utils/Matrix.h"
@@ -182,7 +184,7 @@ void ChaperoneTabController::handleChaperoneWarnings( float distance )
// Alarm Sound
if ( isChaperoneAlarmSoundEnabled() )
{
// LOG(WARNING) << "In alarm";
qWarning() << "In alarm";
float activationDistance = chaperoneAlarmSoundDistance();
if ( distance <= activationDistance && proxSensorOverrideState )
@@ -763,12 +765,12 @@ void ChaperoneTabController::setChaperoneColorR( int value, bool notify )
if ( 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 )
{
value = 0;
LOG( WARNING ) << "Red Channel smaller than 0, setting to 0";
qWarning() << "Red Channel smaller than 0, setting to 0";
}
m_chaperoneColorR = value;
ovr_settings_wrapper::setInt32(
@@ -791,12 +793,12 @@ void ChaperoneTabController::setChaperoneColorG( int value, bool notify )
if ( 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 )
{
value = 0;
LOG( WARNING ) << "Green Channel smaller than 0, setting to 0";
qWarning() << "Green Channel smaller than 0, setting to 0";
}
m_chaperoneColorG = value;
ovr_settings_wrapper::setInt32(
@@ -819,12 +821,12 @@ void ChaperoneTabController::setChaperoneColorB( int value, bool notify )
if ( 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 )
{
value = 0;
LOG( WARNING ) << "Blue Channel smaller than 0, setting to 0";
qWarning() << "Blue Channel smaller than 0, setting to 0";
}
m_chaperoneColorB = value;
ovr_settings_wrapper::setInt32(
@@ -855,12 +857,12 @@ void ChaperoneTabController::setChaperoneColorA( int value, bool notify )
if ( 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 )
{
value = 0;
LOG( WARNING ) << "Alpha Channel smaller than 0, setting to 0";
qWarning() << "Alpha Channel smaller than 0, setting to 0";
}
m_chaperoneColorA = value;
ovr_settings_wrapper::setInt32(
@@ -926,14 +928,13 @@ void ChaperoneTabController::setCollisionBoundStyle( int value,
if ( vr::COLLISION_BOUNDS_STYLE_COUNT < value )
{
value = 0;
LOG( WARNING )
qWarning()
<< "Invalid Collision Bound Value (>count), set to beginner";
}
else if ( value < 0 )
{
value = 0;
LOG( WARNING )
<< "Invalid Collision Bound Value (<0), set to beginner";
qWarning() << "Invalid Collision Bound Value (<0), set to beginner";
}
if ( !isTemp )
{
@@ -1468,7 +1469,7 @@ void ChaperoneTabController::createNewAutosaveProfile()
}
else
{
LOG( INFO )
qInfo()
<< "[Chaperone Autosave] «Autosaved Profile (previous)» not found";
}
@@ -1484,7 +1485,7 @@ void ChaperoneTabController::createNewAutosaveProfile()
}
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)
@@ -1515,8 +1516,8 @@ void ChaperoneTabController::applyAutosavedProfile()
}
else
{
LOG( WARNING ) << "Failed to apply chaperone Autosaved Profile "
"(autosave doesn't exist)";
qWarning() << "Failed to apply chaperone Autosaved Profile "
"(autosave doesn't exist)";
}
}
@@ -1629,7 +1630,7 @@ void ChaperoneTabController::initCenterMarkerOverlay()
}
else
{
LOG( ERROR ) << "overlay Not initialized";
qCritical() << "overlay Not initialized";
// TODO Set Failure variable.
}
}
+12 -11
View File
@@ -1,5 +1,7 @@
#include "FixFloorTabController.h"
#include <QQuickWindow>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h"
// application namespace
@@ -153,7 +155,7 @@ void FixFloorTabController::dashboardLoopTick(
/*
floorOffsetY = static_cast<float>(tempOffsetY);
LOG(INFO) << "Offset For Knuckles up is: " <<
qInfo() << "Offset For Knuckles up is: " <<
floorOffsetY;
*/
}
@@ -183,7 +185,7 @@ void FixFloorTabController::dashboardLoopTick(
/*
floorOffsetY = static_cast<float>(tempOffsetY);
LOG(INFO) << "Offset For Knuckles up is: " <<
qInfo() << "Offset For Knuckles up is: " <<
floorOffsetY;
*/
}
@@ -196,10 +198,9 @@ void FixFloorTabController::dashboardLoopTick(
floorOffsetX = static_cast<float>( tempOffsetX );
floorOffsetZ = static_cast<float>( tempOffsetZ );
LOG( INFO )
<< "Fix Floor and adjust space center: Floor Offset = ["
<< floorOffsetX << ", " << floorOffsetY << ", "
<< floorOffsetZ << "]";
qInfo() << "Fix Floor and adjust space center: Floor Offset = ["
<< floorOffsetX << ", " << floorOffsetY << ", "
<< floorOffsetZ << "]";
float offset[3] = { 0, 0, 0 };
offset[1] = floorOffsetY;
if ( state == 2 )
@@ -243,12 +244,12 @@ int FixFloorTabController::getControllerType(
&error );
if ( error != vr::TrackedProp_Success )
{
LOG( ERROR ) << "Error With Controller Type: "
<< vr::VRSystem()->GetPropErrorNameFromEnum( error );
qCritical() << "Error With Controller Type: "
<< vr::VRSystem()->GetPropErrorNameFromEnum( error );
}
else if ( stringLength == 0 )
{
LOG( ERROR ) << "Device Index not valid";
qCritical() << "Device Index not valid";
}
else if ( strcmp( controllerTypeString, "knuckles" ) == 0 )
{
@@ -308,8 +309,8 @@ void FixFloorTabController::undoFixFloorClicked()
{
float off[3] = { -floorOffsetX, -floorOffsetY, -floorOffsetZ };
parent->m_moveCenterTabController.addOffset( off );
LOG( INFO ) << "Fix Floor: Undo Floor Offset = [" << -floorOffsetX << ", "
<< -floorOffsetY << ", " << -floorOffsetZ << "]";
qInfo() << "Fix Floor: Undo Floor Offset = [" << -floorOffsetX << ", "
<< -floorOffsetY << ", " << -floorOffsetZ << "]";
floorOffsetY = 0.0f;
statusMessage = "Undo ... OK";
statusMessageTimeout = 1.0;
+91 -97
View File
@@ -1,5 +1,7 @@
#include "MoveCenterTabController.h"
#include <QQuickWindow>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h"
#include "../quaternion/quaternion.h"
#include "../settings/settings.h"
@@ -116,10 +118,10 @@ void MoveCenterTabController::applyOffsetProfile( unsigned index )
emit offsetXChanged( m_offsetX );
emit offsetYChanged( m_offsetY );
emit offsetZChanged( m_offsetZ );
LOG( INFO ) << "Applying Offset Profile:" << profile.profileName
<< " X:" << m_offsetX << " Y:" << m_offsetY
<< " Z:" << m_offsetZ << " Rotation:"
<< ( static_cast<float>( m_rotation ) / 100 );
qInfo() << "Applying Offset Profile:" << profile.profileName
<< " X:" << m_offsetX << " Y:" << m_offsetY
<< " Z:" << m_offsetZ
<< " Rotation:" << ( static_cast<float>( m_rotation ) / 100 );
}
}
@@ -168,10 +170,10 @@ void MoveCenterTabController::outputLogPoses()
vr::HmdMatrix34_t hmdStanding
= devicePosesStanding[0].mDeviceToAbsoluteTracking;
LOG( INFO ) << "";
LOG( INFO ) << " ____Begin Matrices Log Ouput__________";
LOG( INFO ) << "|";
LOG( INFO ) << "HMD POSE (standing universe)";
qInfo() << "";
qInfo() << " ____Begin Matrices Log Ouput__________";
qInfo() << "|";
qInfo() << "HMD POSE (standing universe)";
outputLogHmdMatrix( hmdStanding );
vr::TrackedDevicePose_t devicePosesSeated[vr::k_unMaxTrackedDeviceCount];
@@ -185,7 +187,7 @@ void MoveCenterTabController::outputLogPoses()
vr::HmdMatrix34_t hmdSeated
= devicePosesSeated[0].mDeviceToAbsoluteTracking;
LOG( INFO ) << "HMD POSE (seated universe)";
qInfo() << "HMD POSE (seated universe)";
outputLogHmdMatrix( hmdSeated );
auto leftHand = vr::VRSystem()->GetTrackedDeviceIndexForControllerRole(
@@ -198,70 +200,65 @@ void MoveCenterTabController::outputLogPoses()
vr::HmdMatrix34_t rightHandMatrix
= devicePosesStanding[rightHand].mDeviceToAbsoluteTracking;
LOG( INFO ) << "LEFT Hand Controller Pose (standing universe)";
qInfo() << "LEFT Hand Controller Pose (standing universe)";
outputLogHmdMatrix( leftHandMatrix );
LOG( INFO ) << "RIGHT Hand Controller Pose (standing universe)";
qInfo() << "RIGHT Hand Controller Pose (standing universe)";
outputLogHmdMatrix( rightHandMatrix );
vr::HmdMatrix34_t standingZero;
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
&standingZero );
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose";
qInfo() << "GetWorkingStandingZeroPoseToRawTrackingPose";
outputLogHmdMatrix( standingZero );
vr::HmdMatrix34_t seatedZero;
vr::VRChaperoneSetup()->GetWorkingSeatedZeroPoseToRawTrackingPose(
&seatedZero );
LOG( INFO ) << "GetWorkingSeatedZeroPoseToRawTrackingPose";
qInfo() << "GetWorkingSeatedZeroPoseToRawTrackingPose";
outputLogHmdMatrix( seatedZero );
vr::HmdMatrix34_t seatedZeroLive;
vr::VRChaperoneSetup()->GetLiveSeatedZeroPoseToRawTrackingPose(
&seatedZeroLive );
LOG( INFO ) << "GetLiveSeatedZeroPoseToRawTrackingPose";
qInfo() << "GetLiveSeatedZeroPoseToRawTrackingPose";
outputLogHmdMatrix( seatedZeroLive );
vr::HmdMatrix34_t seatedToStandingAbsolute
= vr::VRSystem()->GetSeatedZeroPoseToStandingAbsoluteTrackingPose();
LOG( INFO ) << "GetSeatedZeroPoseToStandingAbsoluteTrackingPose";
qInfo() << "GetSeatedZeroPoseToStandingAbsoluteTrackingPose";
outputLogHmdMatrix( seatedToStandingAbsolute );
LOG( INFO ) << "m_universeCenterForReset";
qInfo() << "m_universeCenterForReset";
outputLogHmdMatrix( m_universeCenterForReset );
LOG( INFO ) << "m_seatedCenterForReset";
qInfo() << "m_seatedCenterForReset";
outputLogHmdMatrix( m_seatedCenterForReset );
LOG( INFO ) << "|____End Matrices Log Ouput____________";
LOG( INFO ) << "";
qInfo() << "|____End Matrices Log Ouput____________";
qInfo() << "";
}
void MoveCenterTabController::outputLogHmdMatrix( vr::HmdMatrix34_t hmdMatrix )
{
LOG( INFO ) << hmdMatrix.m[0][0] << "\t\t\t" << hmdMatrix.m[0][1]
<< "\t\t\t" << hmdMatrix.m[0][2] << "\t\t\t"
<< hmdMatrix.m[0][3];
LOG( INFO ) << hmdMatrix.m[1][0] << "\t\t\t" << hmdMatrix.m[1][1]
<< "\t\t\t" << hmdMatrix.m[1][2] << "\t\t\t"
<< hmdMatrix.m[1][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];
qInfo() << hmdMatrix.m[0][0] << "\t\t\t" << hmdMatrix.m[0][1] << "\t\t\t"
<< hmdMatrix.m[0][2] << "\t\t\t" << hmdMatrix.m[0][3];
qInfo() << hmdMatrix.m[1][0] << "\t\t\t" << hmdMatrix.m[1][1] << "\t\t\t"
<< hmdMatrix.m[1][2] << "\t\t\t" << hmdMatrix.m[1][3];
qInfo() << 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] );
LOG( INFO ) << "atan2 Yaw Calculation: " << atan2Yaw << "radians "
<< ( ( static_cast<double>( atan2Yaw )
* k_radiansToCentidegrees )
/ 100 )
<< "degrees";
qInfo() << "atan2 Yaw Calculation: " << atan2Yaw << "radians "
<< ( ( static_cast<double>( atan2Yaw ) * k_radiansToCentidegrees )
/ 100 )
<< "degrees";
vr::HmdQuaternion_t hmdQuat = quaternion::fromHmdMatrix34( hmdMatrix );
double hmdQuatYaw = quaternion::getYaw( hmdQuat );
LOG( INFO ) << "Quaternion Yaw Calculation: " << hmdQuatYaw << "radians "
<< ( ( hmdQuatYaw * k_radiansToCentidegrees ) / 100 )
<< "degrees";
LOG( INFO ) << "";
qInfo() << "Quaternion Yaw Calculation: " << hmdQuatYaw << "radians "
<< ( ( hmdQuatYaw * k_radiansToCentidegrees ) / 100 ) << "degrees";
qInfo() << "";
}
int MoveCenterTabController::trackingUniverse() const
@@ -283,7 +280,7 @@ void MoveCenterTabController::setTrackingUniverse( int value, bool notify )
if ( notify )
{
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
// there is an error and apply autosaved profile is hopefully a workaround
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
// we reload chaperone from disk
if ( m_recenterStages < 1 )
{
LOG( INFO ) << "Re-Center Stage 1, reload from disk";
qInfo() << "Re-Center Stage 1, reload from disk";
m_recenterStages++;
if ( calState > 199 && m_initComplete )
{
LOG( INFO ) << "Chaperone calibration state is error, attempting "
"to apply autosaved profile to fix issue";
qInfo() << "Chaperone calibration state is error, attempting "
"to apply autosaved profile to fix issue";
parent->m_chaperoneTabController.applyAutosavedProfile();
}
@@ -940,7 +937,7 @@ void MoveCenterTabController::incomingZeroReset()
// and reseting our stage counter
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(
&m_universeCenterForReset );
vr::VRChaperoneSetup()->GetWorkingSeatedZeroPoseToRawTrackingPose(
@@ -956,12 +953,12 @@ void MoveCenterTabController::reset()
// DO NOT attempt to apply autosaved profile on reset, as it is triggered by
// the apply chaperone profile Side effects are bad!
auto calState = vr::VRChaperone()->GetCalibrationState();
LOG( INFO ) << "Calibration State on Reset is: " << calState;
qInfo() << "Calibration State on Reset is: " << calState;
if ( !m_chaperoneBasisAcquired )
{
LOG( WARNING ) << "WARNING: Attempted reset offsets before chaperone "
"basis is acquired!";
qWarning() << "WARNING: Attempted reset offsets before chaperone "
"basis is acquired!";
return;
}
m_heightToggle = false;
@@ -1035,65 +1032,62 @@ void MoveCenterTabController::zeroOffsets()
- ( m_rotation * k_centidegreesToRadians ) );
if ( abs( currentCenterXyz[0] ) > k_maxOpenvrCommitOffset )
{
LOG( INFO ) << "Attempted Zero Offsets out of commit bounds ( X: "
<< currentCenterXyz[0] << " )";
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose";
qInfo() << "Attempted Zero Offsets out of commit bounds ( X: "
<< currentCenterXyz[0] << " )";
qInfo() << "GetWorkingStandingZeroPoseToRawTrackingPose";
outputLogHmdMatrix( currentCenter );
// if reset happens before init is complete we set the universe
// center to the raw tracking zero point
reset();
if ( !m_chaperoneBasisAcquired )
{
LOG( WARNING )
<< "<[!]><[!]>EXECUTED RESET BEFORE BASIS "
"ACQUIRED<[!]><[!]> "
"Setting universe center to raw tracking zero point.";
qWarning() << "<[!]><[!]>EXECUTED RESET BEFORE BASIS "
"ACQUIRED<[!]><[!]> "
"Setting universe center to raw tracking zero point.";
}
else
{
LOG( INFO ) << "-Resetting offsets-";
qInfo() << "-Resetting offsets-";
}
}
else if ( abs( currentCenterXyz[1] ) > k_maxOpenvrCommitOffset )
{
LOG( INFO ) << "Attempted Zero Offsets out of commit bounds ( Y: "
<< currentCenterXyz[1] << " )";
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose";
qInfo() << "Attempted Zero Offsets out of commit bounds ( Y: "
<< currentCenterXyz[1] << " )";
qInfo() << "GetWorkingStandingZeroPoseToRawTrackingPose";
outputLogHmdMatrix( currentCenter );
// if reset happens before init is complete we set the universe
// center to the raw tracking zero point
reset();
if ( !m_chaperoneBasisAcquired )
{
LOG( WARNING )
<< "<[!]><[!]>EXECUTED RESET BEFORE BASIS "
"ACQUIRED<[!]><[!]> "
"Setting universe center to raw tracking zero point.";
qWarning() << "<[!]><[!]>EXECUTED RESET BEFORE BASIS "
"ACQUIRED<[!]><[!]> "
"Setting universe center to raw tracking zero point.";
}
else
{
LOG( INFO ) << "-Resetting offsets-";
qInfo() << "-Resetting offsets-";
}
}
else if ( abs( currentCenterXyz[2] ) > k_maxOpenvrCommitOffset )
{
LOG( INFO ) << "Attempted Zero Offsets out of commit bounds ( Z: "
<< currentCenterXyz[2] << " )";
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose";
qInfo() << "Attempted Zero Offsets out of commit bounds ( Z: "
<< currentCenterXyz[2] << " )";
qInfo() << "GetWorkingStandingZeroPoseToRawTrackingPose";
outputLogHmdMatrix( currentCenter );
// if reset happens before init is complete we set the universe
// center to the raw tracking zero point
reset();
if ( !m_chaperoneBasisAcquired )
{
LOG( WARNING )
<< "<[!]><[!]>EXECUTED RESET BEFORE BASIS "
"ACQUIRED<[!]><[!]> "
"Setting universe center to raw tracking zero point.";
qWarning() << "<[!]><[!]>EXECUTED RESET BEFORE BASIS "
"ACQUIRED<[!]><[!]> "
"Setting universe center to raw tracking zero point.";
}
else
{
LOG( INFO ) << "-Resetting offsets-";
qInfo() << "-Resetting offsets-";
}
}
m_oldOffsetX = 0.0f;
@@ -1121,7 +1115,7 @@ void MoveCenterTabController::zeroOffsets()
auto calState = vr::VRChaperone()->GetCalibrationState();
if ( calState == 200 )
{
LOG( WARNING )
qWarning()
<< "Chaperone State Does Not Exist Yet, will wait for "
"universe change to finish initialization";
}
@@ -1135,13 +1129,13 @@ void MoveCenterTabController::zeroOffsets()
else
{
// shutdown was unsafe last session!
LOG( WARNING ) << "DETECTED UNSAFE SHUTDOWN FROM LAST SESSION";
qWarning() << "DETECTED UNSAFE SHUTDOWN FROM LAST SESSION";
m_initComplete = false;
if ( !parent->crashRecoveryDisabled() )
{
parent->m_chaperoneTabController.applyAutosavedProfile();
LOG( INFO ) << "Applying last good chaperone "
"profile autosave";
qInfo() << "Applying last good chaperone "
"profile autosave";
}
}
// Now mark previous shutdown as unsafe in case we crash
@@ -1154,11 +1148,11 @@ void MoveCenterTabController::zeroOffsets()
}
if ( m_roomSetupModeDetected )
{
LOG( INFO ) << "room setup EXIT detected";
qInfo() << "room setup EXIT detected";
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()
@@ -1196,8 +1190,8 @@ void MoveCenterTabController::updateChaperoneResetData()
auto cstate = vr::VRChaperone()->GetCalibrationState();
if ( cstate > 199 )
{
LOG( WARNING ) << "Chaperone Calibration State is error: " << cstate
<< " While Trying to Update Reset Data";
qWarning() << "Chaperone Calibration State is error: " << cstate
<< " While Trying to Update Reset Data";
}
else
{
@@ -1905,11 +1899,11 @@ void MoveCenterTabController::resetOffsets( bool resetOffsetsJustPressed )
emit rotationChanged( m_rotation );
updateSpace( true );
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 )
// {
// LOG( INFO ) << "Chaperone calibration state is error,
// qInfo() << "Chaperone calibration state is error,
// attempting "
// "to apply autosaved profile to fix issue";
// parent->m_chaperoneTabController.applyAutosavedProfile();
@@ -2139,8 +2133,8 @@ void MoveCenterTabController::updateHmdRotationCounter(
}
else
{
LOG( WARNING ) << "HMD Was Inverted during a Turn Count, Turn "
"counter may be in-accurate";
qWarning() << "HMD Was Inverted during a Turn Count, Turn "
"counter may be in-accurate";
}
}
@@ -2586,16 +2580,16 @@ void MoveCenterTabController::updateSpace( bool forceUpdate )
> k_maxOvrasUniverseCenteredTurningOffset
&& universeCenteredRotation() ) )
{
LOG( INFO ) << "Raw universe center out of bounds ( X: "
<< offsetUniverseCenterXyz[0] << " )";
qInfo() << "Raw universe center out of bounds ( X: "
<< offsetUniverseCenterXyz[0] << " )";
vr::HmdMatrix34_t standingZero;
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
&standingZero );
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose";
qInfo() << "GetWorkingStandingZeroPoseToRawTrackingPose";
outputLogHmdMatrix( standingZero );
reset();
parent->m_chaperoneTabController.applyAutosavedProfile();
LOG( INFO ) << "-Resetting to autosaved chaperone profile-";
qInfo() << "-Resetting to autosaved chaperone profile-";
return;
}
if ( abs( offsetUniverseCenterXyz[1] ) > k_maxOpenvrWorkingSetOffest
@@ -2603,16 +2597,16 @@ void MoveCenterTabController::updateSpace( bool forceUpdate )
> k_maxOvrasUniverseCenteredTurningOffset
&& universeCenteredRotation() ) )
{
LOG( INFO ) << "Raw universe center out of bounds ( Y: "
<< offsetUniverseCenterXyz[1] << " )";
qInfo() << "Raw universe center out of bounds ( Y: "
<< offsetUniverseCenterXyz[1] << " )";
vr::HmdMatrix34_t standingZero;
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
&standingZero );
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose";
qInfo() << "GetWorkingStandingZeroPoseToRawTrackingPose";
outputLogHmdMatrix( standingZero );
reset();
parent->m_chaperoneTabController.applyAutosavedProfile();
LOG( INFO ) << "-Resetting to autosaved chaperone profile-";
qInfo() << "-Resetting to autosaved chaperone profile-";
return;
}
if ( abs( offsetUniverseCenterXyz[2] ) > k_maxOpenvrWorkingSetOffest
@@ -2620,16 +2614,16 @@ void MoveCenterTabController::updateSpace( bool forceUpdate )
> k_maxOvrasUniverseCenteredTurningOffset
&& universeCenteredRotation() ) )
{
LOG( INFO ) << "Raw universe center out of bounds ( Z: "
<< offsetUniverseCenterXyz[2] << " )";
qInfo() << "Raw universe center out of bounds ( Z: "
<< offsetUniverseCenterXyz[2] << " )";
vr::HmdMatrix34_t standingZero;
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
&standingZero );
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose";
qInfo() << "GetWorkingStandingZeroPoseToRawTrackingPose";
outputLogHmdMatrix( standingZero );
reset();
parent->m_chaperoneTabController.applyAutosavedProfile();
LOG( INFO ) << "-Resetting to autosaved chaperone profile-";
qInfo() << "-Resetting to autosaved chaperone profile-";
return;
}
@@ -2751,7 +2745,7 @@ void MoveCenterTabController::eventLoopTick(
// the middle of room setup.
m_pendingZeroOffsets = false;
LOG( INFO ) << "room setup ENTRY detected";
qInfo() << "room setup ENTRY detected";
vr::VRChaperoneSetup()->HideWorkingSetPreview();
reset();
vr::VRChaperoneSetup()->RevertWorkingCopy();
@@ -2765,7 +2759,7 @@ void MoveCenterTabController::eventLoopTick(
if ( universe == vr::TrackingUniverseSeated && !m_seatedModeDetected )
{
m_seatedModeDetected = true;
LOG( INFO ) << "seated mode ENTRY detected";
qInfo() << "seated mode ENTRY detected";
}
// detect exiting seated mode
@@ -2773,7 +2767,7 @@ void MoveCenterTabController::eventLoopTick(
{
m_seatedModeDetected = false;
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
+22 -20
View File
@@ -1,5 +1,7 @@
#include "RotationTabController.h"
#include <QQuickWindow>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h"
#include "../settings/settings.h"
#include "../utils/Matrix.h"
@@ -17,6 +19,8 @@ void RotationTabController::initStage1()
void RotationTabController::initStage2( OverlayController* var_parent )
{
this->parent = var_parent;
const auto autoturnOverlayKey
= std::string( application_strings::applicationKey )
+ ".autoturnnotification";
@@ -27,9 +31,9 @@ void RotationTabController::initStage2( OverlayController* var_parent )
&m_autoturnValues.overlayHandle );
if ( overlayError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Could not create autoturn notification overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
qCritical() << "Could not create autoturn notification overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
emit defaultProfileDisplay();
@@ -70,8 +74,6 @@ void RotationTabController::initStage2( OverlayController* var_parent )
&notificationTransform );
emit defaultProfileDisplay();
this->parent = var_parent;
}
void RotationTabController::eventLoopTick(
@@ -401,9 +403,9 @@ void RotationTabController::doAutoTurn(
// Ignore if the wall we encountered is behind us
if ( std::abs( hmdToWallYaw ) >= M_PI / 2 )
{
LOG( DEBUG ) << "Ignoring turn in opposite "
"direction (angle "
<< std::abs( hmdToWallYaw ) << ")";
qDebug() << "Ignoring turn in opposite "
"direction (angle "
<< std::abs( hmdToWallYaw ) << ")";
break;
}
@@ -426,7 +428,7 @@ void RotationTabController::doAutoTurn(
// previous wall than the left.
turnLeft = m_autoTurnWallActive[circularIndex(
i, false, chaperoneDistances.size() )];
LOG( DEBUG ) << "turning away from shared corner";
qDebug() << "turning away from shared corner";
}
// If within m_cordDetanglingAngle degrees of
// 'straight at a wall', start in whatever direction
@@ -440,19 +442,19 @@ void RotationTabController::doAutoTurn(
turnLeft = ( parent->m_moveCenterTabController
.getHmdYawTotal()
< 0.0 );
LOG( DEBUG ) << "turning to detangle cord";
qDebug() << "turning to detangle cord";
}
// Turn the closest angle to the wall
else
{
turnLeft = hmdToWallYaw > 0.0;
LOG( DEBUG ) << "turning closest angle to wall";
qDebug() << "turning closest angle to wall";
}
LOG( DEBUG ) << "hmd yaw " << hmdYaw
<< ", hmd position to wall angle "
<< hmdPositionToWallYaw;
LOG( DEBUG ) << "hmd to wall angle " << hmdToWallYaw;
qDebug() << "hmd yaw " << hmdYaw
<< ", hmd position to wall angle "
<< hmdPositionToWallYaw;
qDebug() << "hmd to wall angle " << hmdToWallYaw;
// Positive hmd-to-wall is facing left, negative is
// facing right (relative to the wall)
double delta_degrees
@@ -488,17 +490,17 @@ void RotationTabController::doAutoTurn(
= static_cast<double>( std::atan2(
middleCorner.v[0] - touchingWallCorner.v[0],
middleCorner.v[2] - touchingWallCorner.v[2] ) );
LOG( DEBUG ) << "twa: " << touchingWallAngle
<< ", nwa: " << newWallAngle << ", diff: "
<< ( newWallAngle - touchingWallAngle );
qDebug() << "twa: " << touchingWallAngle
<< ", nwa: " << newWallAngle << ", diff: "
<< ( newWallAngle - touchingWallAngle );
delta_degrees = ( newWallAngle - touchingWallAngle
+ ( turnLeft ? M_PI : -M_PI ) )
* k_radiansToCentidegrees;
delta_degrees
= reduceAngle<>( delta_degrees, -18000.0, 18000.0 );
}
LOG( DEBUG ) << "rotating space " << ( delta_degrees / 100 )
<< " degrees";
qDebug() << "rotating space " << ( delta_degrees / 100 )
<< " degrees";
switch ( RotationTabController::autoTurnModeType() )
{
case AutoTurnModes::SNAP:
+5 -3
View File
@@ -1,5 +1,7 @@
#include "SettingsTabController.h"
#include <QQuickWindow>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h"
#include "../utils/update_rate.h"
@@ -105,9 +107,9 @@ void SettingsTabController::setAutoStartEnabled( bool value, bool notify )
application_strings::applicationKey, m_autoStartEnabled );
if ( apperror != vr::VRApplicationError_None )
{
LOG( ERROR ) << "Could not set auto start: "
<< vr::VRApplications()
->GetApplicationsErrorNameFromEnum( apperror );
qCritical() << "Could not set auto start: "
<< vr::VRApplications()
->GetApplicationsErrorNameFromEnum( apperror );
}
if ( notify )
{
+40 -39
View File
@@ -1,5 +1,7 @@
#include "SteamVRTabController.h"
#include <QQuickWindow>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h"
#include "../utils/update_rate.h"
#include <QDesktopServices>
@@ -504,7 +506,7 @@ void SteamVRTabController::launchBindingUI()
&inputHandle );
if ( error2 != vr::VRInputError_None )
{
LOG( ERROR )
qCritical()
<< "failed to get input handle? is your right controller on?";
}
if ( parent->isDesktopMode() )
@@ -517,7 +519,7 @@ void SteamVRTabController::launchBindingUI()
application_strings::applicationKey, actionHandle, inputHandle, false );
if ( error != vr::VRInputError_None )
{
LOG( ERROR ) << "Input Error: " << error;
qCritical() << "Input Error: " << error;
}
}
void SteamVRTabController::restartSteamVR()
@@ -525,7 +527,7 @@ void SteamVRTabController::restartSteamVR()
QString cmd = QString( "cmd.exe /C restartvrserver.bat \"" )
+ parent->getVRRuntimePathUrl().toLocalFile()
+ QString( "\"" );
LOG( INFO ) << "SteamVR Restart Command: " << cmd;
qInfo() << "SteamVR Restart Command: " << cmd;
QProcess::startDetached( cmd );
}
@@ -561,8 +563,8 @@ Q_INVOKABLE void SteamVRTabController::pairDevice( QString sn )
{
if ( !isSteamVRTracked( sn ) )
{
LOG( WARNING ) << sn.toStdString()
<< " Is Not a SteamVR Dongle, skipping Pair";
qWarning() << sn.toStdString()
<< " Is Not a SteamVR Dongle, skipping Pair";
return;
}
m_last_pair_sn = sn;
@@ -603,26 +605,26 @@ void SteamVRTabController::onConnected()
emit pairStatusChanged( QString( "Pairing..." ) );
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.close();
}
void SteamVRTabController::onDisconnect()
{
LOG( INFO ) << "Pair WS disconnect";
qInfo() << "Pair WS disconnect";
m_webSocket.close();
}
void SteamVRTabController::onMsgRec( QString Msg )
{
if ( Msg.contains( "success" ) )
{
LOG( INFO ) << "Pair Success";
qInfo() << "Pair Success";
emit pairStatusChanged( QString( "Success" ) );
}
if ( Msg.contains( "timeout" ) )
{
LOG( INFO ) << "Pair Timeout";
qInfo() << "Pair Timeout";
emit pairStatusChanged( QString( "Timeout" ) );
}
m_webSocket.close();
@@ -691,15 +693,15 @@ void SteamVRTabController::onGetBindingUrlResponse( QNetworkReply* reply )
std::string controllerName = ovr_system_wrapper::getControllerName();
if ( controllerName == "" )
{
LOG( WARNING ) << "No Controller Detected Skipping Bindings";
qWarning() << "No Controller Detected Skipping Bindings";
return;
}
json jsonfull = json::parse( data.toStdString() );
// LOG( INFO ) << "URL RESPOSNE XXXXXXX";
// LOG( INFO ) << jsonfull.dump().c_str();
// qInfo () << "URL RESPOSNE XXXXXXX";
// qInfo () << jsonfull.dump().c_str();
std::string filepath
= 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?
reply->close();
getBindingDataReq( filepath, m_lastAppID, controllerName );
@@ -738,24 +740,24 @@ void SteamVRTabController::onGetBindingDataResponse( QNetworkReply* reply )
{
return;
}
// LOG( WARNING ) << "DATA RESPONSE";
// LOG( WARNING ) << data.toStdString();
// qWarning () << "DATA RESPONSE";
// qWarning () << data.toStdString();
json jsonfull = json::parse( data.toStdString() );
if ( !jsonfull.contains( "success" ) )
{
LOG( ERROR ) << "Binding Data Packet Mal-Formed?";
qCritical() << "Binding Data Packet Mal-Formed?";
}
if ( !jsonfull["success"].get<bool>() )
{
// TODO better error handling?
LOG( ERROR ) << "Binding Data Request Failed";
qCritical() << "Binding Data Request Failed";
}
reply->close();
output = jsonfull["binding_config"];
std::string sceneAppID = ovr_application_wrapper::getSceneAppID();
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;
}
std::string ctrl = ovr_system_wrapper::getControllerName();
@@ -795,11 +797,11 @@ bool SteamVRTabController::saveBind( std::string appID,
bindFile.close();
if ( bindFile.exists() )
{
LOG( INFO ) << ( def ? "Default " : ( sceneAppID + " " ) )
+ "Binding File saved at:"
<< absPath.toStdString();
qInfo() << ( def ? "Default " : ( sceneAppID + " " ) )
+ "Binding File saved at:"
<< absPath.toStdString();
std::string jsonstring = binds.dump().c_str();
LOG( INFO ) << jsonstring;
qInfo() << jsonstring;
return true;
}
return false;
@@ -861,7 +863,7 @@ void SteamVRTabController::applyBindingReq( std::string appID )
std::string sceneAppID = ovr_application_wrapper::getSceneAppID();
if ( sceneAppID == "" )
{
LOG( ERROR ) << "NO Scene App Detected unable to apply bindings";
qCritical() << "NO Scene App Detected unable to apply bindings";
return;
}
@@ -870,14 +872,14 @@ void SteamVRTabController::applyBindingReq( std::string appID )
+ ctrlType + ".json" );
if ( !QFileInfo::exists( fi.absolutePath() + QString( "/" ) + Fn ) )
{
LOG( INFO ) << "No Specific Binding Detected for: " + appID
+ "for Scene: " + sceneAppID + " Checking Default";
qInfo() << "No Specific Binding Detected for: " + appID
+ "for Scene: " + sceneAppID + " Checking Default";
Fn = QString::fromStdString( "defovl" + appID + "ctrl" + ctrlType
+ ".json" );
if ( !QFileInfo::exists( fi.absolutePath() + QString( "/" ) + Fn ) )
{
LOG( INFO ) << "No Def Binding Detected for: " + appID
+ " Not Adjusting Bindings";
qInfo() << "No Def Binding Detected for: " + appID
+ " Not Adjusting Bindings";
return;
}
}
@@ -886,14 +888,13 @@ void SteamVRTabController::applyBindingReq( std::string appID )
QUrl urlized = QUrl::fromLocalFile( absPath );
// std::string filePath = "file:///" + absPath.toStdString();
std::string url = "http://localhost:27062/input/selectconfig.action";
// LOG( INFO ) << urlized.toEncoded().toStdString();
// qInfo () << urlized.toEncoded().toStdString();
QUrl urls = QUrl( url.c_str() );
QNetworkRequest request;
request.setUrl( urls );
LOG( INFO ) << "Attempting to Apply Binding at: "
<< urlized
.toEncoded( QUrl::EncodeSpaces | QUrl::EncodeReserved )
.toStdString();
qInfo() << "Attempting to Apply Binding at: "
<< urlized.toEncoded( QUrl::EncodeSpaces | QUrl::EncodeReserved )
.toStdString();
// This is Important as otherwise Valve's VRWebServerWillIgnore the Request
// If referrer is wrong
request.setHeader( QNetworkRequest::ContentTypeHeader,
@@ -909,8 +910,8 @@ void SteamVRTabController::applyBindingReq( std::string appID )
.toStdString()
+ "\"}" )
.c_str();
// LOG( INFO ) << "Sending Binding Set Request";
// LOG( INFO ) << data.toStdString();
// qInfo () << "Sending Binding Set Request";
// qInfo () << data.toStdString();
connect( &m_networkManagerApply,
SIGNAL( finished( QNetworkReply* ) ),
this,
@@ -926,21 +927,21 @@ void SteamVRTabController::onApplyBindingResponse( QNetworkReply* reply )
{
return;
}
// LOG( INFO ) << "APPLY RESPONSE";
// LOG( INFO ) << data.toStdString();
// qInfo () << "APPLY RESPONSE";
// qInfo () << data.toStdString();
reply->close();
json jsonfull = json::parse( data.toStdString() );
if ( !jsonfull.contains( "success" ) )
{
LOG( ERROR ) << "Apply Binding Packet Mal-Formed?";
qCritical() << "Apply Binding Packet Mal-Formed?";
return;
}
if ( !jsonfull["success"].get<bool>() )
{
// 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;
}
+18 -17
View File
@@ -1,6 +1,8 @@
#include "UtilitiesTabController.h"
#include <QQuickWindow>
#include <QApplication>
#include <QtLogging>
#include <QtDebug>
#include "../overlaycontroller.h"
#include "../keyboard_input/input_sender.h"
#include "../settings/settings.h"
@@ -236,8 +238,8 @@ QString getBatteryIconPath( int batteryState )
if ( !batteryPath.has_value() )
{
LOG( ERROR ) << "Unable to find battery image number '" << batteryState
<< "'.";
qCritical() << "Unable to find battery image number '" << batteryState
<< "'.";
return "";
}
@@ -276,19 +278,19 @@ vr::VROverlayHandle_t UtilitiesTabController::createBatteryOverlay(
}
vr::VROverlay()->SetOverlayTransformTrackedDeviceRelative(
handle, index, &notificationTransform );
LOG( INFO ) << "Created battery overlay for device " << index;
qInfo() << "Created battery overlay for device " << index;
}
else
{
LOG( ERROR ) << "Could not find battery icon \"" << batteryIconPath
<< "\"";
qCritical() << "Could not find battery icon \"" << batteryIconPath
<< "\"";
}
}
else
{
LOG( ERROR ) << "Could not create ptt notification overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
qCritical() << "Could not create ptt notification overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
}
return handle;
@@ -306,8 +308,8 @@ void UtilitiesTabController::destroyBatteryOverlays()
el = 0;
if ( err != vr::VROverlayError_None )
{
LOG( ERROR ) << "Could not Delete Battery Overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( err );
qCritical() << "Could not Delete Battery Overlay: "
<< 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_batteryVisible[i] = true;
}
@@ -373,10 +375,9 @@ void UtilitiesTabController::handleTrackerBatOvl()
if ( batteryState != m_batteryState[i] )
{
LOG( INFO )
<< "Updating battery overlay for device " << i << " to "
<< batteryState << "(" << battery << ")"
<< QString::number( m_batteryOverlayHandles[i] );
qInfo() << "Updating battery overlay for device " << i
<< " to " << batteryState << "(" << battery << ")"
<< QString::number( m_batteryOverlayHandles[i] );
QString batteryIconPath
= getBatteryIconPath( batteryState );
if ( QFile::exists( batteryIconPath ) )
@@ -387,8 +388,8 @@ void UtilitiesTabController::handleTrackerBatOvl()
}
else
{
LOG( ERROR ) << "Could not find battery icon \""
<< batteryIconPath << "\"";
qCritical() << "Could not find battery icon \""
<< batteryIconPath << "\"";
}
m_batteryState[i] = batteryState;
}
+72 -71
View File
@@ -1,6 +1,8 @@
#include "VideoTabController.h"
#include <QQuickWindow>
#include <QApplication>
#include <QtLogging>
#include <QtDebug>
#include "../settings/settings.h"
#include "../overlaycontroller.h"
#include "../utils/update_rate.h"
@@ -71,15 +73,15 @@ void VideoTabController::initBrightnessOverlay()
}
else
{
LOG( ERROR ) << "Could not find brightness overlay \""
<< video_keys::k_brightnessOverlayFilename << "\"";
qCritical() << "Could not find brightness overlay \""
<< video_keys::k_brightnessOverlayFilename << "\"";
}
}
else
{
LOG( ERROR ) << "Could not create brightness overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
qCritical() << "Could not create brightness overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
}
setBrightnessOpacityValue( brightnessOpacityValue(), false );
}
@@ -116,15 +118,15 @@ void VideoTabController::initColorOverlay()
}
else
{
LOG( ERROR ) << "Could not find Base color overlay: \""
<< video_keys::k_colorOverlayFilename << "\"";
qCritical() << "Could not find Base color overlay: \""
<< video_keys::k_colorOverlayFilename << "\"";
}
}
else
{
LOG( ERROR ) << "Could not create color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
qCritical() << "Could not create color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
}
}
@@ -134,18 +136,18 @@ void VideoTabController::loadColorOverlay()
m_colorOverlayHandle, colorRed(), colorGreen(), colorBlue() );
if ( overlayError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Could not set Colors for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
qCritical() << "Could not set Colors for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
}
overlayError = vr::VROverlay()->SetOverlayAlpha( m_colorOverlayHandle,
colorOverlayOpacity() );
if ( overlayError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Could not set alpha: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
qCritical() << "Could not set alpha: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
}
emit colorOverlayOpacityChanged( true );
}
@@ -214,7 +216,7 @@ void VideoTabController::setBrightnessEnabled( bool value,
setBrightnessOpacityValue( brightnessOpacityValue(), false );
ovr_overlay_wrapper::showOverlay(
getBrightnessOverlayHandle() );
LOG( INFO ) << "Brightness Overlay toggled on";
qInfo() << "Brightness Overlay toggled on";
}
}
else
@@ -223,7 +225,7 @@ void VideoTabController::setBrightnessEnabled( bool value,
{
ovr_overlay_wrapper::hideOverlay(
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 )
{
LOG( WARNING ) << "alpha value is invalid setting to 1.0";
qWarning() << "alpha value is invalid setting to 1.0";
settings::setSetting(
settings::DoubleSetting::VIDEO_brightnessOpacityValue, 1.0 );
realvalue = 0;
@@ -346,7 +348,7 @@ void VideoTabController::setColorOverlayEnabled( bool value,
if ( overlayHandle != vr::k_ulOverlayHandleInvalid )
{
ovr_overlay_wrapper::showOverlay( getColorOverlayHandle() );
LOG( INFO ) << "Color Overlay toggled on";
qInfo() << "Color Overlay toggled on";
}
}
else
@@ -354,7 +356,7 @@ void VideoTabController::setColorOverlayEnabled( bool value,
if ( overlayHandle != vr::k_ulOverlayHandleInvalid )
{
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 );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_HmdDisplayColorGainR_Float
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qWarning() << "Could not read \""
<< vr::k_pch_SteamVR_HmdDisplayColorGainR_Float
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
else
{
@@ -418,11 +420,11 @@ void VideoTabController::synchGain( bool setValue )
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_HmdDisplayColorGainB_Float
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qWarning() << "Could not read \""
<< vr::k_pch_SteamVR_HmdDisplayColorGainB_Float
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
else
{
@@ -439,11 +441,11 @@ void VideoTabController::synchGain( bool setValue )
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_HmdDisplayColorGainG_Float
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qWarning() << "Could not read \""
<< vr::k_pch_SteamVR_HmdDisplayColorGainG_Float
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
else
{
@@ -473,9 +475,9 @@ void VideoTabController::setColorRed( float value, bool notify, bool keepValue )
m_colorOverlayHandle, colorRed(), colorGreen(), colorBlue() );
if ( overlayError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Could not set Red for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
qCritical() << "Could not set Red for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
}
}
else
@@ -489,13 +491,13 @@ void VideoTabController::setColorRed( float value, bool notify, bool keepValue )
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "could not set Red Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qCritical() << "could not set Red Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
}
LOG( DEBUG ) << "Changed Red Value to: " << colorRed();
qDebug() << "Changed Red Value to: " << colorRed();
if ( notify )
{
@@ -523,9 +525,9 @@ void VideoTabController::setColorGreen( float value,
m_colorOverlayHandle, colorRed(), colorGreen(), colorBlue() );
if ( overlayError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Could not set Green for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
qCritical() << "Could not set Green for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
}
}
else
@@ -539,13 +541,13 @@ void VideoTabController::setColorGreen( float value,
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "could not set Green Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qCritical() << "could not set Green Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
}
LOG( DEBUG ) << "Changed Green Value to: " << colorGreen();
qDebug() << "Changed Green Value to: " << colorGreen();
if ( notify )
{
@@ -572,9 +574,9 @@ void VideoTabController::setColorBlue( float value,
m_colorOverlayHandle, colorRed(), colorGreen(), colorBlue() );
if ( overlayError != vr::VROverlayError_None )
{
LOG( ERROR ) << "Could not set Blue for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
qCritical() << "Could not set Blue for color overlay: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError );
}
}
else
@@ -588,13 +590,13 @@ void VideoTabController::setColorBlue( float value,
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "could not set Blue Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qCritical() << "could not set Blue Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
}
LOG( DEBUG ) << "Changed Blue Value to: " << colorBlue();
qDebug() << "Changed Blue Value to: " << colorBlue();
if ( notify )
{
@@ -613,9 +615,9 @@ void VideoTabController::resetGain()
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "could not set Red Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qCritical() << "could not set Red Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
vr::VRSettings()->SetFloat( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_HmdDisplayColorGainG_Float,
@@ -624,9 +626,9 @@ void VideoTabController::resetGain()
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "could not set Green Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qCritical() << "could not set Green Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
vr::VRSettings()->SetFloat( vr::k_pch_SteamVR_Section,
@@ -636,9 +638,9 @@ void VideoTabController::resetGain()
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( ERROR ) << "could not set Blue Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
qCritical() << "could not set Blue Gain Value, Error: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
}
@@ -691,13 +693,12 @@ void VideoTabController::setSuperSampling( float value, const bool notify )
// Mirrors Desktop Clamp
if ( value < 0.2f )
{
LOG( WARNING )
<< "Encountered a supersampling value <= 0.2, setting "
"supersampling to 1.0";
qWarning() << "Encountered a supersampling value <= 0.2, setting "
"supersampling to 1.0";
value = 1.0f;
}
LOG( DEBUG ) << "Supersampling value changed: " << m_superSampling
<< " => " << value;
qDebug() << "Supersampling value changed: " << m_superSampling << " => "
<< value;
m_superSampling = value;
ovr_settings_wrapper::setFloat(
vr::k_pch_SteamVR_Section,
@@ -1,4 +1,3 @@
#include <easylogging++.h>
#include "AudioManagerPulse.h"
#include "AudioManagerPulse_internal.h"
#include "../AudioTabController.h"
@@ -1,7 +1,8 @@
#pragma once
#include <pulse/pulseaudio.h>
#include <string>
#include <easylogging++.h>
#include <QtLogging>
#include <QtDebug>
#include "AudioManager.h"
// Used to get the compiler to shut up about C4100: unreferenced formal
@@ -66,58 +67,58 @@ void customPulseLoop()
// Error function
void dumpPulseAudioState()
{
LOG( ERROR ) << "____";
qCritical() << "____";
LOG( ERROR ) << "Dumping PulseAudio state: ";
LOG( ERROR ) << "mainLoop: " << pulseAudioPointers.mainLoop;
LOG( ERROR ) << "api: " << pulseAudioPointers.api;
LOG( ERROR ) << "context: " << pulseAudioPointers.context;
qCritical() << "Dumping PulseAudio state: ";
qCritical() << "mainLoop: " << pulseAudioPointers.mainLoop;
qCritical() << "api: " << pulseAudioPointers.api;
qCritical() << "context: " << pulseAudioPointers.context;
LOG( ERROR ) << "";
qCritical() << "";
LOG( ERROR ) << "Data:";
LOG( ERROR ) << "\tdefaultSinkOutputDeviceId: "
<< pulseAudioData.defaultSinkOutputDeviceId;
LOG( ERROR ) << "\tdefaultSourceInputDeviceId: "
<< pulseAudioData.defaultSourceInputDeviceId;
qCritical() << "Data:";
qCritical() << "\tdefaultSinkOutputDeviceId: "
<< pulseAudioData.defaultSinkOutputDeviceId;
qCritical() << "\tdefaultSourceInputDeviceId: "
<< pulseAudioData.defaultSourceInputDeviceId;
LOG( ERROR ) << "";
qCritical() << "";
LOG( ERROR ) << "\tcurrentDefaultSinkInfo name: "
<< pulseAudioData.currentDefaultSinkInfo.name;
LOG( ERROR ) << "\tcurrentDefaultSourceInfo name: "
<< pulseAudioData.currentDefaultSourceInfo.name;
qCritical() << "\tcurrentDefaultSinkInfo name: "
<< pulseAudioData.currentDefaultSinkInfo.name;
qCritical() << "\tcurrentDefaultSourceInfo name: "
<< pulseAudioData.currentDefaultSourceInfo.name;
LOG( ERROR ) << "";
qCritical() << "";
LOG( ERROR ) << "sinkOutputDevices: ";
LOG_IF( pulseAudioData.sinkOutputDevices.size() == 0, ERROR )
<< "\tOutput devices size zero.";
qCritical() << "sinkOutputDevices: ";
if ( pulseAudioData.sinkOutputDevices.size() == 0 )
qCritical() << "\tOutput devices size zero.";
for ( const auto& device : pulseAudioData.sinkOutputDevices )
{
LOG( ERROR ) << "\tDevice Name: " << device.name();
LOG( ERROR ) << "\tDevice Id: " << device.id();
qCritical() << "\tDevice Name: " << device.name();
qCritical() << "\tDevice Id: " << device.id();
}
LOG( ERROR ) << "";
qCritical() << "";
LOG( ERROR ) << "sourceInputDevices: ";
LOG_IF( pulseAudioData.sourceInputDevices.size() == 0, ERROR )
<< "\tInput devices size zero.";
qCritical() << "sourceInputDevices: ";
if ( pulseAudioData.sourceInputDevices.size() == 0 )
qCritical() << "\tInput devices size zero.";
for ( const auto& device : pulseAudioData.sourceInputDevices )
{
LOG( ERROR ) << "\tDevice Name: " << device.name();
LOG( ERROR ) << "\tDevice Id: " << device.id();
qCritical() << "\tDevice Name: " << device.name();
qCritical() << "\tDevice Id: " << device.id();
}
LOG( ERROR ) << "____";
qCritical() << "____";
}
PulseAudioIsLastMeaning getIsLastMeaning( const int isLast ) noexcept
{
if ( isLast < 0 )
{
LOG( ERROR ) << "Error in isLast.";
qCritical() << "Error in isLast.";
dumpPulseAudioState();
return PulseAudioIsLastMeaning::Error;
}
@@ -134,14 +135,14 @@ std::string getDeviceName( pa_proplist* p )
{
if ( !p )
{
LOG( ERROR ) << "proplist not valid.";
qCritical() << "proplist not valid.";
}
constexpr auto deviceDescription = "device.description";
if ( !pa_proplist_contains( p, deviceDescription ) )
{
LOG( ERROR ) << "proplist does not contain '" << deviceDescription
<< "'.";
qCritical() << "proplist does not contain '" << deviceDescription
<< "'.";
return "ERROR";
}
@@ -166,7 +167,7 @@ template <class T> void deviceCallback( const T* i, const int isLast )
}
else if ( deviceState == PulseAudioIsLastMeaning::Error )
{
LOG( ERROR ) << "Error in deviceCallback function.";
qCritical() << "Error in deviceCallback function.";
dumpPulseAudioState();
loopControl = PulseAudioLoopControl::Stop;
return;
@@ -179,8 +180,10 @@ template <class T> void deviceCallback( const T* i, const int isLast )
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(
AudioDevice( i->name, getDeviceName( i->proplist ) ) );
}
@@ -192,8 +195,10 @@ template <class T> void deviceCallback( const T* i, const int isLast )
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(
AudioDevice( i->name, getDeviceName( i->proplist ) ) );
}
@@ -230,7 +235,7 @@ void getDefaultDevicesCallback( pa_context* c,
if ( !i )
{
LOG( ERROR ) << "i == 0";
qCritical() << "i == 0";
pulseAudioData.defaultSinkOutputDeviceId = "DDO:ERROR";
pulseAudioData.defaultSourceInputDeviceId = "DDI:ERROR";
return;
@@ -242,10 +247,12 @@ void getDefaultDevicesCallback( pa_context* c,
loopControl = PulseAudioLoopControl::Stop;
LOG( DEBUG ) << "getDefaultDevicesCallback done with sink output device: '"
<< pulseAudioData.defaultSinkOutputDeviceId
<< "' and source input '"
<< pulseAudioData.defaultSourceInputDeviceId << "'.";
/*
qDebug() << "getDefaultDevicesCallback done with sink output device: '"
<< pulseAudioData.defaultSinkOutputDeviceId
<< "' and source input '"
<< pulseAudioData.defaultSourceInputDeviceId << "'.";
*/
}
void stateCallbackFunction( pa_context* c, void* userdata )
@@ -256,27 +263,27 @@ void stateCallbackFunction( pa_context* c, void* userdata )
switch ( pa_context_get_state( c ) )
{
case PA_CONTEXT_TERMINATED:
LOG( ERROR ) << "PA_CONTEXT_TERMINATED in stateCallbackFunction";
qCritical() << "PA_CONTEXT_TERMINATED in stateCallbackFunction";
dumpPulseAudioState();
return;
case PA_CONTEXT_CONNECTING:
LOG( DEBUG ) << "PA_CONTEXT_CONNECTING";
qDebug() << "PA_CONTEXT_CONNECTING";
return;
case PA_CONTEXT_AUTHORIZING:
LOG( DEBUG ) << "PA_CONTEXT_AUTHORIZING";
qDebug() << "PA_CONTEXT_AUTHORIZING";
return;
case PA_CONTEXT_SETTING_NAME:
LOG( DEBUG ) << "PA_CONTEXT_SETTING_NAME";
qDebug() << "PA_CONTEXT_SETTING_NAME";
return;
case PA_CONTEXT_UNCONNECTED:
LOG( DEBUG ) << "PA_CONTEXT_UNCONNECTED";
qDebug() << "PA_CONTEXT_UNCONNECTED";
return;
case PA_CONTEXT_FAILED:
LOG( DEBUG ) << "PA_CONTEXT_FAILED";
qDebug() << "PA_CONTEXT_FAILED";
return;
case PA_CONTEXT_READY:
LOG( DEBUG ) << "PA_CONTEXT_READY";
qDebug() << "PA_CONTEXT_READY";
loopControl = PulseAudioLoopControl::Stop;
return;
}
@@ -302,7 +309,7 @@ void updateAllPulseData()
pulseAudioPointers.context, setInputDevicesCallback, noCustomUserdata );
customPulseLoop();
LOG( DEBUG ) << "updateAllPulseData done.";
qDebug() << "updateAllPulseData done.";
}
void successCallback( pa_context* c, int success, void* successVariable )
@@ -316,7 +323,7 @@ void successCallback( pa_context* c, int success, void* successVariable )
if ( !success )
{
LOG( ERROR ) << "Non successful callback operation.";
qCritical() << "Non successful callback operation.";
dumpPulseAudioState();
}
@@ -335,12 +342,12 @@ void setPlaybackDeviceInternal( const std::string& id )
if ( !success )
{
LOG( ERROR ) << "setPlaybackDeviceInternal failed to set default sink "
"for device '"
<< id << "'.";
qCritical() << "setPlaybackDeviceInternal failed to set default sink "
"for device '"
<< id << "'.";
}
LOG( DEBUG ) << "setPlaybackDeviceInternal done with id: " << id;
qDebug() << "setPlaybackDeviceInternal done with id: " << id;
}
std::string getCurrentDefaultPlaybackDeviceName()
@@ -351,12 +358,12 @@ std::string getCurrentDefaultPlaybackDeviceName()
{
if ( dev.id() == pulseAudioData.defaultSinkOutputDeviceId )
{
LOG( DEBUG ) << "getCurrentDefaultPlaybackDeviceName done with "
<< dev.name();
qDebug() << "getCurrentDefaultPlaybackDeviceName done with "
<< dev.name();
return dev.name();
}
}
LOG( ERROR ) << "Unable to find default playback device.";
qCritical() << "Unable to find default playback device.";
return "ERROR";
}
@@ -365,8 +372,8 @@ std::string getCurrentDefaultPlaybackDeviceId()
{
updateAllPulseData();
LOG( DEBUG ) << "getCurrentDefaultPlaybackDeviceId done with "
<< pulseAudioData.defaultSinkOutputDeviceId;
qDebug() << "getCurrentDefaultPlaybackDeviceId done with "
<< pulseAudioData.defaultSinkOutputDeviceId;
return pulseAudioData.defaultSinkOutputDeviceId;
}
@@ -379,12 +386,12 @@ std::string getCurrentDefaultRecordingDeviceName()
{
if ( dev.id() == pulseAudioData.defaultSourceInputDeviceId )
{
LOG( DEBUG ) << "getCurrentDefaultRecordingDeviceName done with: "
<< dev.name();
qDebug() << "getCurrentDefaultRecordingDeviceName done with: "
<< dev.name();
return dev.name();
}
}
LOG( ERROR ) << "Unable to find default playback device.";
qCritical() << "Unable to find default playback device.";
return "ERROR";
}
@@ -393,8 +400,8 @@ std::string getCurrentDefaultRecordingDeviceId()
{
updateAllPulseData();
LOG( DEBUG ) << "getCurrentDefaultRecordingDeviceId done with "
<< pulseAudioData.defaultSourceInputDeviceId;
qDebug() << "getCurrentDefaultRecordingDeviceId done with "
<< pulseAudioData.defaultSourceInputDeviceId;
return pulseAudioData.defaultSourceInputDeviceId;
}
@@ -452,7 +459,7 @@ void sourceOutputCallback( pa_context* c,
}
else if ( deviceState == PulseAudioIsLastMeaning::Error )
{
LOG( ERROR ) << "Error in sourceOutputCallback function.";
qCritical() << "Error in sourceOutputCallback function.";
dumpPulseAudioState();
return;
}
@@ -460,9 +467,9 @@ void sourceOutputCallback( pa_context* c,
const auto sourceOutputIndex = i->index;
const auto sourceIndex = pulseAudioData.currentDefaultSourceInfo.index;
LOG( DEBUG ) << "Attempting to move sourceOutputIndex: '"
<< sourceOutputIndex << "' to sourceIndex '" << sourceIndex
<< "' with source output name " << i->name << ".";
qDebug() << "Attempting to move sourceOutputIndex: '" << sourceOutputIndex
<< "' to sourceIndex '" << sourceIndex
<< "' with source output name " << i->name << ".";
pa_context_move_source_output_by_index(
c, sourceOutputIndex, sourceIndex, successCallback, &success );
@@ -470,7 +477,7 @@ void sourceOutputCallback( pa_context* c,
void setMicrophoneDevice( const std::string& id )
{
LOG( DEBUG ) << "setMicrophoneDevice called with 'id': " << id;
qDebug() << "setMicrophoneDevice called with 'id': " << id;
updateAllPulseData();
@@ -482,7 +489,7 @@ void setMicrophoneDevice( const std::string& id )
if ( !success )
{
LOG( ERROR ) << "Error setting microphone device for '" << id << "'.";
qCritical() << "Error setting microphone device for '" << id << "'.";
}
updateAllPulseData();
@@ -494,17 +501,17 @@ void setMicrophoneDevice( const std::string& id )
if ( !success )
{
LOG( ERROR ) << "Error in moving source outputs to new source.";
qCritical() << "Error in moving source outputs to new source.";
}
updateAllPulseData();
LOG( DEBUG ) << "setMicrophoneDevice done.";
qDebug() << "setMicrophoneDevice done.";
}
bool setPlaybackVolume( const float volume )
{
LOG( DEBUG ) << "setPlaybackVolume called with 'volume': " << volume;
qDebug() << "setPlaybackVolume called with 'volume': " << volume;
updateAllPulseData();
@@ -525,19 +532,19 @@ bool setPlaybackVolume( const float volume )
if ( !success )
{
LOG( ERROR ) << "setPlaybackVolume failed to set volume '" << volume
<< "' for device '"
<< pulseAudioData.defaultSinkOutputDeviceId << "'.";
qCritical() << "setPlaybackVolume failed to set volume '" << volume
<< "' for device '"
<< pulseAudioData.defaultSinkOutputDeviceId << "'.";
}
LOG( DEBUG ) << "setPlaybackVolume done with 'success': " << success;
qDebug() << "setPlaybackVolume done with 'success': " << success;
return success;
}
bool setMicrophoneVolume( const float volume )
{
LOG( DEBUG ) << "setMicrophoneVolume called with 'volume': " << volume;
qDebug() << "setMicrophoneVolume called with 'volume': " << volume;
updateAllPulseData();
@@ -558,19 +565,19 @@ bool setMicrophoneVolume( const float volume )
if ( !success )
{
LOG( ERROR ) << "seMicrophoneVolume failed to set volume '" << volume
<< "' for device '"
<< pulseAudioData.defaultSourceInputDeviceId << "'.";
qCritical() << "seMicrophoneVolume failed to set volume '" << volume
<< "' for device '"
<< pulseAudioData.defaultSourceInputDeviceId << "'.";
}
LOG( DEBUG ) << "setMicrophoneVolume done with 'success': " << success;
qDebug() << "setMicrophoneVolume done with 'success': " << success;
return success;
}
bool setMicMuteState( const bool muted )
{
LOG( DEBUG ) << "setMicMuteState called with 'muted': " << muted;
qDebug() << "setMicMuteState called with 'muted': " << muted;
bool success = false;
pa_context_set_source_mute_by_name(
@@ -584,19 +591,19 @@ bool setMicMuteState( const bool muted )
if ( !success )
{
LOG( ERROR ) << "setMicMuteState failed to set muted '" << muted
<< "' for device '"
<< pulseAudioData.defaultSourceInputDeviceId << "'.";
qCritical() << "setMicMuteState failed to set muted '" << muted
<< "' for device '"
<< pulseAudioData.defaultSourceInputDeviceId << "'.";
}
LOG( DEBUG ) << "setMicMuteState done with 'success': " << success;
qDebug() << "setMicMuteState done with 'success': " << success;
return success;
}
void restorePulseAudioState()
{
LOG( DEBUG ) << "restorePulseAudioState called.";
qDebug() << "restorePulseAudioState called.";
setPlaybackDeviceInternal( pulseAudioData.originalDefaultOutputDeviceId );
setPlaybackVolume( pulseAudioData.originalDefaultOutputDeviceVolume );
@@ -604,12 +611,12 @@ void restorePulseAudioState()
setMicrophoneDevice( pulseAudioData.originalDefaultInputDeviceId );
setMicrophoneVolume( pulseAudioData.originalDefaultInputDeviceVolume );
LOG( DEBUG ) << "restorePulseAudioState done.";
qDebug() << "restorePulseAudioState done.";
}
void initializePulseAudio()
{
LOG( DEBUG ) << "initializePulseAudio called.";
qDebug() << "initializePulseAudio called.";
pulseAudioPointers.mainLoop = pa_mainloop_new();
@@ -644,6 +651,6 @@ void initializePulseAudio()
= static_cast<float>( pa_sw_volume_to_linear(
pa_cvolume_avg( &pulseAudioData.currentDefaultSinkInfo.volume ) ) );
LOG( DEBUG ) << "initializePulseAudio finished.";
qDebug() << "initializePulseAudio finished.";
}
} // namespace advsettings

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