8 Commits
Author SHA1 Message Date
ykeara 2d4db7ef4b merge changes 2026-09-25 15:12:25 -05:00
ykeara 8d661d2b31 merge mainline changes into qt6 2026-09-25 15:06:43 -05:00
ykeara 9ecdda1572 misc 2026-04-27 10:49:13 -05:00
ykeara 93c0851055 fix dx11 rendering in vr, fix various qrc references 2026-03-27 15:57:21 -05:00
ykeara 1152cfee1f compiling and various updates 2025-10-09 18:45:53 -05:00
ykeara 44a05dfd57 fix cast error, change cmake to c++ 20 for some uses, add headers to cmake for better vs project generation 2024-05-08 18:20:19 -05:00
RTUnrealandykeara 383f153c54 draft: upgrade codebase to qt6 and cmake (#657)
* 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

* use getter instead of directly accessing class members

* use QImage as a base to set overlay textures

* use native  logging

* add more QImage Overlays

* implement faulty vulkan implementation

---------

Co-authored-by: ykeara <ykeara1@gmail.com>
2024-05-01 15:19:36 -05:00
ykearaandRTUnreal ca0ec3e07d Qt6 (#669)
* 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>
2024-04-03 22:49:24 -05:00
126 changed files with 2071 additions and 9631 deletions
+1
View File
@@ -16,3 +16,4 @@ build_scripts/win/__pycache__
build_scripts/win/current_build.bat build_scripts/win/current_build.bat
AdvancedSettings_resource.rc AdvancedSettings_resource.rc
.qtc_clangd/ .qtc_clangd/
out/
+543
View File
@@ -0,0 +1,543 @@
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 20)
#set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
#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)
find_package(Qt6 REQUIRED COMPONENTS Gui Multimedia Qml Quick WebSockets Widgets QuickControls2 QuickDialogs2 Svg Qml Core5Compat)
find_package(Vulkan REQUIRED)
qt_standard_project_setup(REQUIRES 6.8)
#qt_standard_project_setup should cover these
#include(GNUInstallDirs)
#set(CMAKE_AUTOMOC ON)
#set(CMAKE_AUTOUIC ON)
qt6_policy(SET QTP0001 NEW)
qt6_policy(SET QTP0004 NEW)
list(APPEND QML_IMPORT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/res/qml")
message(STATUS "QML_IMPORT_PATH ${QML_IMPORT_PATH}")
# 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(HEADERS
src/alarm_clock/vr_alarm.h
src/keyboard_input/input_parser.h
src/keyboard_input/keyboard_input.h
#TODO, check if we need this
#src/keyboard_input/keyboard_sender.h
src/openvr/ivrinput.h
src/openvr/ivrinput_action.h
src/openvr/ivrinput_input_source.h
src/openvr/ivrinput_manifest.h
src/openvr/lh_console_util.h
src/openvr/openvr_init.h
src/openvr/ovr_application_wrapper.h
src/openvr/ovr_overlay_wrapper.h
src/openvr/ovr_settings_wrapper.h
src/openvr/ovr_system_wrapper.h
src/overlaycontroller.h
src/settings/settings.h
src/settings/settings_object.h
src/settings/internal/bool_setting_value.h
src/settings/internal/double_setting_value.h
src/settings/internal/setting_value.h
src/settings/internal/settings_controller.h
src/settings/internal/settings_object_data.h
src/settings/internal/specific_setting_value.h
src/tabcontrollers/AudioTabController.h
src/tabcontrollers/ChaperoneTabController.h
src/tabcontrollers/FixFloorTabController.h
src/tabcontrollers/MoveCenterTabController.h
src/tabcontrollers/RotationTabController.h
src/tabcontrollers/SettingsTabController.h
src/tabcontrollers/StatisticsTabController.h
src/tabcontrollers/SteamVRTabController.h
src/tabcontrollers/UtilitiesTabController.h
src/tabcontrollers/VideoTabController.h
src/utils/ChaperoneUtils.h
src/utils/FrameRateUtils.h
src/utils/paths.h
src/utils/setup.h
src/utils/update_rate.h
src/utils/Matrix.h
src/quaternion/quaternion.h
)
set(QML_FILERC
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(ResourcesRC
src/res/img/alarm/alarm_activated.png
src/res/img/audio/media_keys/outline_play_pause_white_24dp.svg
src/res/img/audio/media_keys/outline_skip_next_white_24dp.svg
src/res/img/audio/media_keys/outline_skip_previous_white_24dp.svg
src/res/img/audio/media_keys/outline_stop_white_24dp.svg
src/res/img/audio/microphone/mic_off.svg
src/res/img/audio/microphone/mic_on.svg
src/res/img/audio/microphone/ptm_notification.png
src/res/img/audio/microphone/ptt_notification.png
src/res/img/audio/microphone/ptt_notification.svg
src/res/img/audio/speaker/speaker_off.svg
src/res/img/audio/speaker/speaker_on.svg
src/res/img/battery/battery_0.png
src/res/img/battery/battery_1.png
src/res/img/battery/battery_2.png
src/res/img/battery/battery_3.png
src/res/img/battery/battery_4.png
src/res/img/battery/battery_5.png
src/res/img/chaperone/centermark.png
src/res/img/chaperone/centermarkl1.png
src/res/img/chaperone/centermarkl2.png
src/res/img/chaperone/centermarkl3.png
src/res/img/chaperone/centermarkr1.png
src/res/img/chaperone/centermarkr2.png
src/res/img/chaperone/centermarkr3.png
src/res/img/common/backarrow.svg
src/res/img/common/check.svg
src/res/img/icons/advicon256px.ico
src/res/img/icons/thumbicon.png
src/res/img/main_menu_icons/audio_tab_icon.svg
src/res/img/main_menu_icons/bindings_tab_icon.svg
src/res/img/main_menu_icons/chaperone_tab_icon.svg
src/res/img/main_menu_icons/motion_tab_icon.svg
src/res/img/main_menu_icons/offsets_tab_icon.svg
src/res/img/main_menu_icons/rotation_tab_icon.svg
src/res/img/main_menu_icons/settings_tab_icon.svg
src/res/img/main_menu_icons/space_fix_tab_icon.svg
src/res/img/main_menu_icons/statistics_tab_icon.svg
src/res/img/main_menu_icons/steamvr_tab_icon.svg
src/res/img/main_menu_icons/utilities_tab_icon.svg
src/res/img/main_menu_icons/video_tab_icon.svg
src/res/img/rotation/autoturn.png
src/res/img/rotation/noautoturn.png
src/res/img/rotation/noautoturn.svg
src/res/img/video/color.png
src/res/img/video/dimmer.png
src/res/sounds/alarm01.wav
src/res/sounds/click.wav
src/res/sounds/focus.wav
)
#set_source_files_properties(src/res/qml/common/MyResources.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE)
#qt_add_executable(AdvancedSettings WIN32 MACOSX_BUNDLE ${SRCS} ${HEADERS})
qt_add_executable(AdvancedSettings
${SRCS}
${HEADERS}
)
#src/res/resources.qrc
qt_add_qml_module(AdvancedSettings
URI AdvancedSettings
QML_FILES
${QML_FILERC}
RESOURCES
${ResourcesRC}
VERSION ${PROJECT_VERSION}
)
target_include_directories(AdvancedSettings PUBLIC
third-party/nlohmann
third-party/openvr/headers
${Vulkan_INCLUDE_DIR}
)
# 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)
if (WIN32)
target_link_directories(AdvancedSettings PRIVATE
${CMAKE_SOURCE_DIR}/third-party/openvr/lib/win64
)
endif ()
target_link_libraries(AdvancedSettings PRIVATE
Qt::Gui
Qt6::Core5Compat
# For QRhi
Qt::GuiPrivate
Qt::Multimedia
Qt::Qml
Qt::Quick
Qt::WebSockets
Qt::Widgets
Qt::QuickControls2
Qt::QuickDialogs2
Qt::Svg
Qt::Qml
openvr_api
)
#${OPENVR_LIBRARIES}
#qt6_add_resources(RESOURCES src/res/resources.qrc)
#target_sources(AdvancedSettings PRIVATE ${RESOURCES})
#qt_add_qml_module(AdvancedSettings
# URI AdvancedSettings
# VERSION ${PROJECT_VERSION}
# QML_FILES ${QML_FILES}
#)
set(COPY_DEST_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
set_target_properties(AdvancedSettings PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${COPY_DEST_DIR}"
)
# resCopy
add_custom_command(TARGET AdvancedSettings POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_SOURCE_DIR}/src/res" "${COPY_DEST_DIR}/res"
)
# readmeCopy
add_custom_command(TARGET AdvancedSettings POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_SOURCE_DIR}/Readme.md" "${COPY_DEST_DIR}/Readme.md"
)
# licenseCopy
add_custom_command(TARGET AdvancedSettings POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/LICENSE" "${COPY_DEST_DIR}/LICENSE"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/third-party/openvr/LICENSE-VALVE" "${COPY_DEST_DIR}/LICENSE-VALVE"
#COMMAND ${CMAKE_COMMAND} -E copy_if_different
#"${CMAKE_SOURCE_DIR}/third-party/magic_enum/LICENSE" "${COPY_DEST_DIR}/LICENSE-MAGIC-ENUM"
)
# packageFoldersCopy
add_custom_command(TARGET AdvancedSettings POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_SOURCE_DIR}/src/package_files/default_action_manifests"
"${COPY_DEST_DIR}/default_action_manifests"
)
# packageFilesCopy
add_custom_command(TARGET AdvancedSettings POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/src/package_files/action_manifest.json" "${COPY_DEST_DIR}/action_manifest.json"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/src/package_files/manifest.vrmanifest" "${COPY_DEST_DIR}/manifest.vrmanifest"
)
if (WIN32)
add_custom_command(TARGET AdvancedSettings POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/src/package_files/qt.conf" "${COPY_DEST_DIR}/qt.conf"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/src/package_files/restartvrserver.bat" "${COPY_DEST_DIR}/restartvrserver.bat"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/src/package_files/startdesktopmode.bat" "${COPY_DEST_DIR}/startdesktopmode.bat"
)
endif ()
# openvrApiCopy
if (WIN32)
add_custom_command(TARGET AdvancedSettings POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/third-party/openvr/bin/win64/openvr_api.dll" "${COPY_DEST_DIR}/openvr_api.dll"
)
else ()
add_custom_command(TARGET AdvancedSettings POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/third-party/openvr/lib/linux64/libopenvr_api.so" "${COPY_DEST_DIR}/libopenvr_api.so"
)
endif ()
# opensslCopy
if (WIN32)
add_custom_command(TARGET AdvancedSettings POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/third-party/openssl/libcrypto-1_1-x64.dll" "${COPY_DEST_DIR}/libcrypto-1_1-x64.dll"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/third-party/openssl/libssl-1_1-x64.dll" "${COPY_DEST_DIR}/libssl-1_1-x64.dll"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/third-party/openssl/LICENSE-OPENSSL" "${COPY_DEST_DIR}/LICENSE-OPENSSL"
)
endif ()
target_include_directories(AdvancedSettings PRIVATE
third-party/openvr/headers
third-party/policyconfig
)
if (WIN32)
target_sources(AdvancedSettings PRIVATE
src/keyboard_input/input_sender_win.cpp
src/media_keys/media_keys_win.cpp
src/tabcontrollers/audiomanager/AudioManagerWindows.cpp
src/tabcontrollers/audiomanager/AudioManagerWindows.h
)
target_link_libraries(AdvancedSettings PRIVATE
ole32
user32
)
if (MSVC)
target_compile_definitions(AdvancedSettings PRIVATE
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
)
target_compile_options(AdvancedSettings PRIVATE
/GL /Gw /W4 /permissive- /w14254 /w14263 /w14265 /w14287 /w14296 /w14311
/w14545 /w14546 /w14547 /w14549 /w14555 /w14640 /w14826 /w14905 /w14906
/w14928 /wd4127 /we4289 /Zc:__cplusplus
)
if (warnings_as_errors)
target_compile_options(AdvancedSettings PRIVATE /WX)
endif ()
endif ()
elseif (UNIX)
if (NOT APPLE AND NOT noX11)
target_sources(AdvancedSettings PRIVATE
src/keyboard_input/input_sender_X11.cpp
)
find_package(X11 REQUIRED)
target_link_libraries(AdvancedSettings PRIVATE ${X11_LIBRARIES})
elseif (NOT APPLE AND noX11)
target_sources(AdvancedSettings PRIVATE
src/keyboard_input/input_sender_dummy.cpp
)
endif ()
if (NOT APPLE AND NOT noDBUS)
target_sources(AdvancedSettings PRIVATE
src/media_keys/media_keys_dbus.cpp
)
find_package(Qt6 OPTIONAL_COMPONENTS DBus)
target_link_libraries(AdvancedSettings PRIVATE Qt6::DBus)
elseif (NOT APPLE AND noDBUS)
target_sources(AdvancedSettings PRIVATE
src/media_keys/media_keys_dummy.cpp
)
endif ()
if (NOT APPLE AND NOT noPulse)
target_sources(AdvancedSettings PRIVATE
src/tabcontrollers/audiomanager/AudioManagerPulse.cpp
src/tabcontrollers/audiomanager/AudioManagerPulse.h
src/tabcontrollers/audiomanager/AudioManagerPulse_internal.h
)
target_link_libraries(AdvancedSettings PRIVATE pulse)
elseif (NOT APPLE AND noPulse)
target_sources(AdvancedSettings PRIVATE
src/tabcontrollers/audiomanager/AudioManagerDummy.cpp
src/tabcontrollers/audiomanager/AudioManagerDummy.h
)
endif ()
if (APPLE)
target_sources(AdvancedSettings PRIVATE
src/keyboard_input/input_sender_dummy.cpp
src/media_keys/media_keys_dummy.cpp
src/tabcontrollers/audiomanager/AudioManagerDummy.cpp
src/tabcontrollers/audiomanager/AudioManagerDummy.h
)
endif ()
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(AdvancedSettings PRIVATE
-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 PRIVATE -Werror)
endif ()
endif ()
endif ()
if (debugSymbolsAndLogs)
target_compile_definitions(AdvancedSettings PRIVATE ENABLE_DEBUG_LOGGING)
endif ()
install(TARGETS AdvancedSettings
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
#qt_generate_deploy_qml_app_script(
# TARGET AdvancedSettings
# OUTPUT_SCRIPT deploy_script
#)
#install(SCRIPT ${deploy_script})
if (WIN32)
qt_generate_deploy_qml_app_script(
TARGET AdvancedSettings
OUTPUT_SCRIPT deploy_script
MACOS_BUNDLE_POST_BUILD
NO_UNSUPPORTED_PLATFORM_ERROR
DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM
)
install(SCRIPT ${deploy_script})
message(STATUS "Deploy Script ${deploy_script}")
install(SCRIPT ${deploy_script})
# message(STATUS "Path to qml: ${CMAKE_SOURCE_DIR}/src/res/qml")
#This should be re-dundant but for some reason Visual Studio really wants this
#set(WINDEPLOYQT_BUILD_TARGET "$<$<CONFIG:Debug>:--debug>$<$<NOT:$<CONFIG:Debug>>:--release>")
#add_custom_command(TARGET AdvancedSettings POST_BUILD
# COMMAND "${Qt6_DIR}/../../../bin/windeployqt6.exe"
# --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 "${CMAKE_SOURCE_DIR}/src/res/qml"
# "${COPY_DEST_DIR}/AdvancedSettings.exe"
#)
endif ()
+33
View File
@@ -0,0 +1,33 @@
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"variables": [
{
"name": "CMAKE_INSTALL_PREFIX",
"value": "D:/Code/ovras/OpenVR-AdvancedSettings/out/build/x64-Debug/Debug",
"type": "PATH"
}
]
},
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ]
}
]
}
-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
-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
+16 -9
View File
@@ -1,8 +1,12 @@
#include <easylogging++.h>
#include "../tabcontrollers/UtilitiesTabController.h" #include "../tabcontrollers/UtilitiesTabController.h"
#include "vr_alarm.h" #include "vr_alarm.h"
#include "../openvr/ovr_overlay_wrapper.h" #include "../openvr/ovr_overlay_wrapper.h"
#include "../utils/update_rate.h" #include "../utils/update_rate.h"
#include <thread>
#include <QtLogging>
#include <QtDebug>
#include <QImage>
namespace alarm_clock namespace alarm_clock
{ {
@@ -20,8 +24,10 @@ VrAlarm::VrAlarm()
ovr_overlay_wrapper::hideOverlay( m_alarmOverlayHandle ); ovr_overlay_wrapper::hideOverlay( m_alarmOverlayHandle );
const auto filename = "/res/img/alarm/alarm_activated.png"; // Only need to set it once, no need to keep it in memory
ovr_overlay_wrapper::setOverlayFromFile( m_alarmOverlayHandle, filename ); QImage alarmIcon( ":qt/qml/AdvancedSettings/src/res/img/alarm/alarm_activated.png" );
ovr_overlay_wrapper::setOverlayFromQImage( m_alarmOverlayHandle,
alarmIcon );
ovr_overlay_wrapper::setOverlayWidthInMeters( m_alarmOverlayHandle, 0.3f ); ovr_overlay_wrapper::setOverlayWidthInMeters( m_alarmOverlayHandle, 0.3f );
@@ -76,13 +82,14 @@ void VrAlarm::checkAlarmStatus()
&& timeToAlarmActivation > 0; && timeToAlarmActivation > 0;
if ( activateAlarm ) if ( activateAlarm )
{ {
LOG( INFO ) << "Alarm fired at " << m_alarm.hour() << ":" qInfo() << "Alarm fired at " << m_alarm.hour() << ":"
<< m_alarm.minute() << ":" << m_alarm.second() << "."; << m_alarm.minute() << ":" << m_alarm.second() << ".";
showAlarmNotification(); showAlarmNotification();
setAlarmEnabled( false ); setAlarmEnabled( false );
std::thread t( std::thread t(
[]( vr::VROverlayHandle_t overlayHandle ) { []( vr::VROverlayHandle_t overlayHandle )
{
// This will freeze the overlay for 3 seconds // This will freeze the overlay for 3 seconds
std::this_thread::sleep_for( std::chrono::seconds( 3 ) ); std::this_thread::sleep_for( std::chrono::seconds( 3 ) );
ovr_overlay_wrapper::hideOverlay( overlayHandle ); ovr_overlay_wrapper::hideOverlay( overlayHandle );
@@ -102,7 +109,7 @@ void VrAlarm::setAlarmTime( const int hour, const int minute, const int second )
{ {
if ( !QTime::isValid( hour, minute, second ) ) if ( !QTime::isValid( hour, minute, second ) )
{ {
LOG( ERROR ) << "setAlarmTime passed invalid time values: '" << hour qCritical() << "setAlarmTime passed invalid time values: '" << hour
<< "' hours, '" << minute << "' minutes, '" << second << "' hours, '" << minute << "' minutes, '" << second
<< "' seconds."; << "' seconds.";
} }
@@ -119,19 +126,19 @@ void VrAlarm::modAlarmTime( const int hour, const int minute, const int second )
{ {
if ( hour > 22 || hour < -22 ) if ( hour > 22 || hour < -22 )
{ {
LOG( ERROR ) << "modAlarmTime called with incorrect hour value: '" qCritical() << "modAlarmTime called with incorrect hour value: '"
<< hour << "'. Values not applied."; << hour << "'. Values not applied.";
return; return;
} }
if ( minute > 58 || minute < -58 ) if ( minute > 58 || minute < -58 )
{ {
LOG( ERROR ) << "modAlarmTime called with incorrect minute value: '" qCritical() << "modAlarmTime called with incorrect minute value: '"
<< minute << "'. Values not applied."; << minute << "'. Values not applied.";
return; return;
} }
if ( second > 58 || minute < -58 ) if ( second > 58 || minute < -58 )
{ {
LOG( ERROR ) << "modAlarmTime called with incorrect second value: '" qCritical() << "modAlarmTime called with incorrect second value: '"
<< second << "'. Values not applied."; << second << "'. Values not applied.";
return; return;
} }
+6 -3
View File
@@ -1,5 +1,8 @@
#include "input_parser.h" #include "input_parser.h"
#include <QtLogging>
#include <QtDebug>
std::optional<Token> getModifier( const char& character ) noexcept std::optional<Token> getModifier( const char& character ) noexcept
{ {
switch ( character ) switch ( character )
@@ -50,7 +53,7 @@ std::optional<Token> getFunctionNumber( const char& character ) noexcept
return Token::KEY_F9; return Token::KEY_F9;
default: default:
LOG( INFO ) << "Unknown function key number: " << character; qInfo() << "Unknown function key number: " << character;
return std::nullopt; return std::nullopt;
} }
} }
@@ -80,7 +83,7 @@ std::optional<Token> getFunctionNumberExtended( const char& character ) noexcept
case '9': case '9':
return Token::KEY_F19; return Token::KEY_F19;
default: default:
LOG( INFO ) << "Unknown function key number: " << character; qInfo() << "Unknown function key number: " << character;
return std::nullopt; return std::nullopt;
} }
} }
@@ -210,7 +213,7 @@ std::vector<Token>
if ( !isupper( *ch ) || isspace( *ch ) ) if ( !isupper( *ch ) || isspace( *ch ) )
{ {
LOG( INFO ) << "Unknown character found in sequence: " << *ch; qInfo() << "Unknown character found in sequence: " << *ch;
continue; continue;
} }
// Everything below is upper case // Everything below is upper case
-1
View File
@@ -3,7 +3,6 @@
#include <vector> #include <vector>
#include <cctype> #include <cctype>
#include <optional> #include <optional>
#include <easylogging++.h>
enum class Token enum class Token
{ {
-1
View File
@@ -1,6 +1,5 @@
#pragma once #pragma once
#include "input_parser.h" #include "input_parser.h"
#include <easylogging++.h>
enum class KeyStatus enum class KeyStatus
{ {
+4 -2
View File
@@ -2,6 +2,8 @@
#include <vector> #include <vector>
#include <Windows.h> #include <Windows.h>
#include <cctype> #include <cctype>
#include <QtLogging>
#include <QtDebug>
WORD convertToVirtualKeycode( const Token token ) WORD convertToVirtualKeycode( const Token token )
{ {
@@ -183,13 +185,13 @@ void sendKeyboardInputRaw( std::vector<INPUT> inputs )
0, 0,
nullptr ) ) nullptr ) )
{ {
LOG( ERROR ) qCritical()
<< "Error calling SendInput(): Could not get error message (" << "Error calling SendInput(): Could not get error message ("
<< errCode << ")"; << errCode << ")";
} }
else else
{ {
LOG( ERROR ) << "Error calling SendInput(): " << err; qCritical() << "Error calling SendInput(): " << err;
} }
} }
} }
+37 -39
View File
@@ -1,6 +1,11 @@
#include "utils/setup.h" #include "utils/setup.h"
#include "settings/settings.h" #include "settings/settings.h"
#include "openvr/ovr_settings_wrapper.h" #include "openvr/ovr_settings_wrapper.h"
#include <QtLogging>
#include <QtDebug>
#include <memory>
#ifdef _WIN64 #ifdef _WIN64
# include <windows.h> # include <windows.h>
extern "C" __declspec( dllexport ) DWORD NvOptimusEnablement = 0x00000001; extern "C" __declspec( dllexport ) DWORD NvOptimusEnablement = 0x00000001;
@@ -8,16 +13,13 @@ extern "C" __declspec( dllexport ) DWORD AmdPowerXpressRequestHighPerformance
= 0x00000001; = 0x00000001;
#endif #endif
INITIALIZE_EASYLOGGINGPP
int main( int argc, char* argv[] ) int main( int argc, char* argv[] )
{ {
setUpLogging(); setUpLogging();
LOG( INFO ) << "Settings File: " qInfo() << "Settings File: " << settings::initializeAndGetSettingsPath();
<< settings::initializeAndGetSettingsPath();
LOG( INFO ) << settings::getSettingsAndValues(); qInfo() << settings::getSettingsAndValues();
QCoreApplication::setAttribute( Qt::AA_Use96Dpi ); QCoreApplication::setAttribute( Qt::AA_Use96Dpi );
QCoreApplication::setAttribute( Qt::AA_UseDesktopOpenGL ); QCoreApplication::setAttribute( Qt::AA_UseDesktopOpenGL );
@@ -30,8 +32,6 @@ int main( int argc, char* argv[] )
mainEventLoop.setApplicationVersion( mainEventLoop.setApplicationVersion(
application_strings::applicationVersionString ); application_strings::applicationVersionString );
qInstallMessageHandler( mainQtMessageHandler );
const auto commandLineArgs const auto commandLineArgs
= argument::returnCommandLineParser( mainEventLoop ); = argument::returnCommandLineParser( mainEventLoop );
@@ -46,37 +46,33 @@ int main( int argc, char* argv[] )
openvr_init::initializeOpenVR( openvr_init::initializeOpenVR(
openvr_init::OpenVrInitializationType::Overlay ); openvr_init::OpenVrInitializationType::Overlay );
try try
{ {
QQmlEngine qmlEngine; QQmlEngine qmlEngine;
advsettings::OverlayController controller( commandLineArgs.desktopMode, // Just error checking to ensure QRC works properly
commandLineArgs.forceNoSound, qDebug() << "list of qmldirs";
qmlEngine ); QDirIterator it( ":", QDirIterator::Subdirectories );
while ( it.hasNext() )
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 << "'."; qDebug() << it.next();
throw std::runtime_error(
"Unable to find critical file. See log for more information." );
} }
const auto url std::unique_ptr<advsettings::OverlayController> controller(
= QUrl::fromLocalFile( QString::fromStdString( ( *path ) ) ); new advsettings::OverlayController( commandLineArgs.desktopMode,
commandLineArgs.forceNoSound,
QQmlComponent component( &qmlEngine, url ); qmlEngine ) );
//const auto url
// = QUrl( ":/qt/qml/AdvancedSettings/src/res/qml/common/mainwidget.qml" );
QQmlComponent component( &qmlEngine, ":/qt/qml/AdvancedSettings/src/res/qml/common/mainwidget.qml" );
auto errors = component.errors(); auto errors = component.errors();
for ( auto& e : errors ) for ( auto& e : errors )
{ {
LOG( ERROR ) << "QML Error: " << e.toString().toStdString() qCritical() << "QML Error: "
<< std::endl; << e.toString().toStdString(); //<< std::endl;
} }
auto quickObj = component.create(); auto quickObj = component.create();
controller.SetWidget( qobject_cast<QQuickItem*>( quickObj ), controller->SetWidget( qobject_cast<QQuickItem*>( quickObj ),
application_strings::applicationDisplayName, application_strings::applicationDisplayName,
application_strings::applicationKey ); application_strings::applicationKey );
@@ -99,7 +95,7 @@ int main( int argc, char* argv[] )
} }
catch ( std::exception& e ) catch ( std::exception& e )
{ {
LOG( ERROR ) << e.what(); qCritical() << e.what();
} }
} }
@@ -107,17 +103,19 @@ int main( int argc, char* argv[] )
|| settings::getSetting( || settings::getSetting(
settings::BoolSetting::APPLICATION_desktopModeToggle ) ) settings::BoolSetting::APPLICATION_desktopModeToggle ) )
{ {
auto m_pWindow = new QQuickWindow(); //TODO TEMP
qobject_cast<QQuickItem*>( quickObj ) //qDebug() << "Desktop MODE!";
->setParentItem( m_pWindow->contentItem() ); //auto m_pWindow = new QQuickWindow();
m_pWindow->setGeometry( //qobject_cast<QQuickItem*>( quickObj )
0, // ->setParentItem( m_pWindow->contentItem() );
0, //m_pWindow->setGeometry(
static_cast<int>( // 0,
qobject_cast<QQuickItem*>( quickObj )->width() ), // 0,
static_cast<int>( // static_cast<int>(
qobject_cast<QQuickItem*>( quickObj )->height() ) ); // qobject_cast<QQuickItem*>( quickObj )->width() ),
m_pWindow->show(); // static_cast<int>(
// qobject_cast<QQuickItem*>( quickObj )->height() ) );
//m_pWindow->show();
} }
if ( commandLineArgs.resetSettings ) if ( commandLineArgs.resetSettings )
{ {
@@ -129,7 +127,7 @@ int main( int argc, char* argv[] )
} }
catch ( const std::exception& e ) catch ( const std::exception& e )
{ {
LOG( FATAL ) << e.what(); qFatal() << e.what();
return ReturnErrorCode::GENERAL_FAILURE; return ReturnErrorCode::GENERAL_FAILURE;
} }
} }
-1
View File
@@ -1,5 +1,4 @@
#pragma once #pragma once
#include <easylogging++.h>
#include <vector> #include <vector>
#include <QString> #include <QString>
+5 -3
View File
@@ -3,6 +3,8 @@
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtDBus/QtDBus> #include <QtDBus/QtDBus>
#include <QtLogging>
#include <QtDebug>
namespace keyboardinput namespace keyboardinput
{ {
@@ -10,7 +12,7 @@ void callMethodForAllMediaPlayerAvailableServices( const QString& method )
{ {
if ( !QDBusConnection::sessionBus().isConnected() ) if ( !QDBusConnection::sessionBus().isConnected() )
{ {
LOG( ERROR ) << "Media Keys: Unable to connect to DBUS session bus."; qCritical() << "Media Keys: Unable to connect to DBUS session bus.";
return; return;
} }
@@ -18,9 +20,9 @@ void callMethodForAllMediaPlayerAvailableServices( const QString& method )
= QDBusConnection::sessionBus().interface()->registeredServiceNames(); = QDBusConnection::sessionBus().interface()->registeredServiceNames();
if ( !names.isValid() ) if ( !names.isValid() )
{ {
LOG( ERROR ) qCritical()
<< "Media Keys: Error getting DBUS registered service names:"; << "Media Keys: Error getting DBUS registered service names:";
LOG( ERROR ) << names.error().message(); qCritical() << names.error().message();
} }
foreach ( QString name, names.value() ) foreach ( QString name, names.value() )
+4 -2
View File
@@ -1,6 +1,8 @@
#include "media_keys.h" #include "media_keys.h"
#include "src/keyboard_input/input_sender.h" #include "src/keyboard_input/input_sender.h"
#include <Windows.h> #include <Windows.h>
#include <QtLogging>
#include <QtDebug>
namespace keyboardinput namespace keyboardinput
{ {
@@ -45,13 +47,13 @@ void sendKeyboardInputRaw( std::vector<INPUT> inputs )
0, 0,
nullptr ) ) nullptr ) )
{ {
LOG( ERROR ) qCritical()
<< "Error calling SendInput(): Could not get error message (" << "Error calling SendInput(): Could not get error message ("
<< errCode << ")"; << errCode << ")";
} }
else else
{ {
LOG( ERROR ) << "Error calling SendInput(): " << err; qCritical() << "Error calling SendInput(): " << err;
} }
} }
} }
+5 -4
View File
@@ -3,7 +3,8 @@
#include <openvr.h> #include <openvr.h>
#include <iostream> #include <iostream>
#include <array> #include <array>
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
namespace input namespace input
{ {
@@ -30,7 +31,7 @@ vr::InputDigitalActionData_t getDigitalActionData( DigitalAction& action )
if ( error != vr::EVRInputError::VRInputError_None ) if ( error != vr::EVRInputError::VRInputError_None )
{ {
LOG( ERROR ) << "Error getting IVRInput Digital Action Data for handle " qCritical() << "Error getting IVRInput Digital Action Data for handle "
<< action.name() << ". SteamVR Error: " << error; << action.name() << ". SteamVR Error: " << error;
} }
@@ -60,7 +61,7 @@ vr::InputAnalogActionData_t getAnalogActionData( AnalogAction& action )
if ( error != vr::EVRInputError::VRInputError_None ) if ( error != vr::EVRInputError::VRInputError_None )
{ {
LOG( ERROR ) << "Error getting IVRInput Digital Action Data for handle " qCritical() << "Error getting IVRInput Digital Action Data for handle "
<< action.name() << ". SteamVR Error: " << error; << action.name() << ". SteamVR Error: " << error;
} }
@@ -454,7 +455,7 @@ void SteamIVRInput::UpdateStates()
if ( error != vr::EVRInputError::VRInputError_None ) if ( error != vr::EVRInputError::VRInputError_None )
{ {
LOG( ERROR ) qCritical()
<< "Error during IVRInput action state update. OpenVR Error: " << "Error during IVRInput action state update. OpenVR Error: "
<< error; << error;
} }
+3 -2
View File
@@ -1,6 +1,7 @@
#pragma once #pragma once
#include <openvr.h> #include <openvr.h>
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
namespace input namespace input
{ {
@@ -30,7 +31,7 @@ public:
if ( error != vr::EVRInputError::VRInputError_None ) if ( error != vr::EVRInputError::VRInputError_None )
{ {
LOG( ERROR ) << "Error getting handle for '" << actionName qCritical() << "Error getting handle for '" << actionName
<< "'. OpenVR Error: " << error; << "'. OpenVR Error: " << error;
} }
} }
+3 -2
View File
@@ -1,6 +1,7 @@
#pragma once #pragma once
#include <openvr.h> #include <openvr.h>
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
namespace input namespace input
{ {
@@ -16,7 +17,7 @@ public:
auto error = vr::VRInput()->GetActionSetHandle( setName, &handle ); auto error = vr::VRInput()->GetActionSetHandle( setName, &handle );
if ( error != vr::EVRInputError::VRInputError_None ) if ( error != vr::EVRInputError::VRInputError_None )
{ {
LOG( ERROR ) << "Error getting handle for '" << setName qCritical() << "Error getting handle for '" << setName
<< "'. OpenVR Error: " << error; << "'. OpenVR Error: " << error;
} }
+3 -3
View File
@@ -1,6 +1,7 @@
#pragma once #pragma once
#include <openvr.h> #include <openvr.h>
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
namespace input namespace input
{ {
@@ -17,8 +18,7 @@ public:
if ( error != vr::EVRInputError::VRInputError_None ) if ( error != vr::EVRInputError::VRInputError_None )
{ {
LOG( ERROR ) << "Error getting input handle for '" qCritical() << "Error getting input handle for '" << inputSourceName
<< inputSourceName
<< "'. OpenVR Input Error: " << error; << "'. OpenVR Input Error: " << error;
} }
} }
+4 -3
View File
@@ -1,6 +1,7 @@
#pragma once #pragma once
#include <openvr.h> #include <openvr.h>
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
#include "../utils/paths.h" #include "../utils/paths.h"
namespace input namespace input
@@ -19,7 +20,7 @@ public:
if ( !actionManifestPath.has_value() ) if ( !actionManifestPath.has_value() )
{ {
LOG( ERROR ) << "Could not find action manifest. Action manifests " qCritical() << "Could not find action manifest. Action manifests "
"not initialized."; "not initialized.";
return; return;
} }
@@ -29,7 +30,7 @@ public:
auto error = vr::VRInput()->SetActionManifestPath( validManifestPath ); auto error = vr::VRInput()->SetActionManifestPath( validManifestPath );
if ( error != vr::EVRInputError::VRInputError_None ) if ( error != vr::EVRInputError::VRInputError_None )
{ {
LOG( ERROR ) << "Error setting action manifest path: " qCritical() << "Error setting action manifest path: "
<< validManifestPath << ". OpenVR Error: " << error; << validManifestPath << ". OpenVR Error: " << error;
} }
} }
+12 -9
View File
@@ -1,4 +1,7 @@
#include "lh_console_util.h" #include "lh_console_util.h"
#include <QtLogging>
#include <QtDebug>
#include <QRegularExpression>
namespace lh_con_util namespace lh_con_util
{ {
@@ -6,12 +9,12 @@ bool LHCUtil::FindAll()
{ {
if ( !FindAllRX() ) if ( !FindAllRX() )
{ {
LOG( ERROR ) << "Find All Recievers Failed"; qCritical() << "Find All Recievers Failed";
return false; return false;
} }
if ( !FindAllTX() ) if ( !FindAllTX() )
{ {
LOG( ERROR ) << "Find All Transmitters Failed"; qCritical() << "Find All Transmitters Failed";
return false; return false;
} }
return true; return true;
@@ -26,7 +29,7 @@ bool LHCUtil::FindAllRX()
QString output = QString( lhProcess->readAllStandardOutput() ); QString output = QString( lhProcess->readAllStandardOutput() );
QStringList outputLines QStringList outputLines
= output.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts ); = output.split( QRegularExpression( "[\r\n]" ), Qt::SkipEmptyParts );
bool RecieverStart = false; bool RecieverStart = false;
for ( auto OutputLine : outputLines ) for ( auto OutputLine : outputLines )
@@ -44,7 +47,7 @@ bool LHCUtil::FindAllRX()
} }
OutputLine.simplified().remove( " " ); OutputLine.simplified().remove( " " );
OutputLine.remove( 0, 1 ); OutputLine.remove( 0, 1 );
// LOG( WARNING ) << OutputLine << std::endl; // qWarning() << OutputLine << std::endl;
RXTX_Pairs_.push_back( RXTX_Pair{ OutputLine, " ", true, false } ); RXTX_Pairs_.push_back( RXTX_Pair{ OutputLine, " ", true, false } );
} }
} }
@@ -53,21 +56,21 @@ bool LHCUtil::FindAllRX()
bool LHCUtil::FindConnectedTX( QString RXSerial ) bool LHCUtil::FindConnectedTX( QString RXSerial )
{ {
LOG( WARNING ) << RXSerial; qWarning() << RXSerial;
QProcess* lhProcess = new QProcess(); QProcess* lhProcess = new QProcess();
lhProcess->start( path_, QStringList() << "/serial" << RXSerial << "exit" ); lhProcess->start( path_, QStringList() << "/serial" << RXSerial << "exit" );
lhProcess->waitForFinished(); lhProcess->waitForFinished();
QString output = QString( lhProcess->readAllStandardOutput() ); QString output = QString( lhProcess->readAllStandardOutput() );
QStringList outputLines QStringList outputLines
= output.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts ); = output.split( QRegularExpression( "[\r\n]" ), Qt::SkipEmptyParts );
// std::vector<std::string> OutputLines // std::vector<std::string> OutputLines
// = exec( ( "\"" + path_ + "\" /serial " + RXSerial + " exit" ).c_str() // = exec( ( "\"" + path_ + "\" /serial " + RXSerial + " exit" ).c_str()
// ); // );
bool lhConFound = false; bool lhConFound = false;
for ( auto outputLine : outputLines ) for ( auto outputLine : outputLines )
{ {
// LOG( WARNING ) << outputLine; // qWarning() << outputLine;
if ( outputLine.contains( "Connected to receiver" ) ) if ( outputLine.contains( "Connected to receiver" ) )
{ {
auto splitList = outputLine.split( ":" ); auto splitList = outputLine.split( ":" );
@@ -84,7 +87,7 @@ bool LHCUtil::FindConnectedTX( QString RXSerial )
rxtx.TX_Serial = TXSerial; rxtx.TX_Serial = TXSerial;
rxtx.Is_Paired = true; rxtx.Is_Paired = true;
rxtx.Is_Init = true; rxtx.Is_Init = true;
LOG( WARNING ) qWarning()
<< "tx serial stored: " << TXSerial.toStdString(); << "tx serial stored: " << TXSerial.toStdString();
return true; return true;
} }
@@ -102,7 +105,7 @@ bool LHCUtil::FindConnectedTX( QString RXSerial )
rxtx.TX_Serial = ""; rxtx.TX_Serial = "";
rxtx.Is_Paired = false; rxtx.Is_Paired = false;
rxtx.Is_Init = true; rxtx.Is_Init = true;
LOG( WARNING ) << "tx oops"; qWarning() << "tx oops";
return true; return true;
} }
} }
-1
View File
@@ -12,7 +12,6 @@
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
#include <QRegularExpression> #include <QRegularExpression>
#include <easylogging++.h>
namespace lh_con_util namespace lh_con_util
{ {
+10 -8
View File
@@ -1,8 +1,10 @@
#include <string> #include <string>
#include <thread>
#include <openvr.h> #include <openvr.h>
#include <QMessageBox> #include <QMessageBox>
#include "openvr_init.h" #include "openvr_init.h"
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
#include "../openvr/ivrinput_manifest.h" #include "../openvr/ivrinput_manifest.h"
namespace openvr_init namespace openvr_init
@@ -29,14 +31,14 @@ bool initializeProperly( const OpenVrInitializationType initType )
// In particular in some setups these errors are thrown while // In particular in some setups these errors are thrown while
// nothing is wrong with their setup presumably this is some sort of // nothing is wrong with their setup presumably this is some sort of
// race condition // race condition
LOG( WARNING ) << "HMD not Found During Startup"; qWarning() << "HMD not Found During Startup";
LOG( WARNING ) << "steamvr error: " qWarning() << "steamvr error: "
+ std::string( + std::string(
vr::VR_GetVRInitErrorAsEnglishDescription( vr::VR_GetVRInitErrorAsEnglishDescription(
initError ) ); initError ) );
return false; return false;
} }
LOG( ERROR ) << "Failed to initialize OpenVR: " qCritical() << "Failed to initialize OpenVR: "
+ std::string( + std::string(
vr::VR_GetVRInitErrorAsEnglishDescription( vr::VR_GetVRInitErrorAsEnglishDescription(
initError ) ); initError ) );
@@ -48,7 +50,7 @@ bool initializeProperly( const OpenVrInitializationType initType )
return false; return false;
} }
LOG( INFO ) << "OpenVR initialized successfully."; qInfo() << "OpenVR initialized successfully.";
return true; return true;
} }
@@ -65,7 +67,7 @@ void initializeOpenVR( const OpenVrInitializationType initType, int count )
// as of 5.8.1 Based on some information from valve, if ANY interface // as of 5.8.1 Based on some information from valve, if ANY interface
// fails to load we should have issues. we will re-initialize a few // fails to load we should have issues. we will re-initialize a few
// times if that is the case and hope that fixes things // times if that is the case and hope that fixes things
LOG( WARNING ) << "OpenVR version is invalid: Interface version " qWarning() << "OpenVR version is invalid: Interface version "
<< interfaceAndVersion << " not found. attempt number: " << interfaceAndVersion << " not found. attempt number: "
<< std::to_string( trynumber ); << std::to_string( trynumber );
}; };
@@ -121,7 +123,7 @@ void initializeOpenVR( const OpenVrInitializationType initType, int count )
} }
if ( !success && count < 3 ) if ( !success && count < 3 )
{ {
LOG( WARNING ) << "An error occured on initialization of " qWarning() << "An error occured on initialization of "
"openvr/steamvr attempting again " "openvr/steamvr attempting again "
<< std::to_string( count + 1 ) << " of 3 Attempts"; << std::to_string( count + 1 ) << " of 3 Attempts";
std::this_thread::sleep_for( std::chrono::seconds( 5 ) ); std::this_thread::sleep_for( std::chrono::seconds( 5 ) );
@@ -130,7 +132,7 @@ void initializeOpenVR( const OpenVrInitializationType initType, int count )
} }
if ( count >= 3 ) if ( count >= 3 )
{ {
LOG( ERROR ) << "initialization errors persist proceeding anyways"; qCritical() << "initialization errors persist proceeding anyways";
} }
} }
+7 -6
View File
@@ -1,4 +1,6 @@
#include "ovr_application_wrapper.h" #include "ovr_application_wrapper.h"
#include <QtLogging>
#include <QtDebug>
constexpr uint32_t bufferLen = 4096; constexpr uint32_t bufferLen = 4096;
namespace ovr_application_wrapper namespace ovr_application_wrapper
{ {
@@ -12,9 +14,8 @@ std::string getSceneAppID()
std::string keys = key; std::string keys = key;
if ( error != vr::VRApplicationError_None ) if ( error != vr::VRApplicationError_None )
{ {
LOG( WARNING ) << "Could not Get App ID by PID: " qWarning() << "Could not Get App ID by PID: " + std::to_string( error );
+ std::to_string( error ); qWarning() << "Attempting to find through Enumeration";
LOG( WARNING ) << "Attempting to find through Enumeration";
auto appCount = vr::VRApplications()->GetApplicationCount(); auto appCount = vr::VRApplications()->GetApplicationCount();
const uint32_t bufferMax = vr::k_unMaxApplicationKeyLength; const uint32_t bufferMax = vr::k_unMaxApplicationKeyLength;
char cStringOut[bufferMax]; char cStringOut[bufferMax];
@@ -25,17 +26,17 @@ std::string getSceneAppID()
std::string appID( cStringOut ); std::string appID( cStringOut );
if ( appID.find( "steam.app" ) != std::string::npos ) if ( appID.find( "steam.app" ) != std::string::npos )
{ {
LOG( WARNING ) << "Found App ID through Enumeration (only " qWarning() << "Found App ID through Enumeration (only "
"steam apps caught): " "steam apps caught): "
<< appID; << appID;
if ( error2 == vr::VRApplicationError_None ) if ( error2 == vr::VRApplicationError_None )
{ {
return appID; return appID;
} }
LOG( WARNING ) << "Error getting app id via Enum: " << error2; qWarning() << "Error getting app id via Enum: " << error2;
} }
} }
LOG( ERROR ) << "Unable to Find App ID by PID or by Enumeration"; qCritical() << "Unable to Find App ID by PID or by Enumeration";
return "error"; return "error";
} }
return keys; return keys;
-1
View File
@@ -3,7 +3,6 @@
#include <openvr.h> #include <openvr.h>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <easylogging++.h>
#include <utility> #include <utility>
#include <map> #include <map>
+30 -10
View File
@@ -1,4 +1,7 @@
#include "ovr_overlay_wrapper.h" #include "ovr_overlay_wrapper.h"
#include <QtLogging>
#include <QtDebug>
#include <QImage>
namespace ovr_overlay_wrapper namespace ovr_overlay_wrapper
{ {
@@ -11,8 +14,7 @@ OverlayError createOverlay( const std::string overlayKey,
overlayKey.c_str(), overlayName.c_str(), overlayHandle ); overlayKey.c_str(), overlayName.c_str(), overlayHandle );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Could not create overlay: " << overlayName qCritical() << "Could not create overlay: " << overlayName << "because "
<< "because "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg; << " " << customErrorMsg;
return OverlayError::UndefinedError; return OverlayError::UndefinedError;
@@ -30,7 +32,7 @@ OverlayError setOverlayColor( vr::VROverlayHandle_t overlayHandle,
= vr::VROverlay()->SetOverlayColor( overlayHandle, red, green, blue ); = vr::VROverlay()->SetOverlayColor( overlayHandle, red, green, blue );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Error setting Overlay Color For " qCritical() << "Error setting Overlay Color For "
<< getOverlayKey( overlayHandle ) << " with error: " << getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg; << " " << customErrorMsg;
@@ -47,7 +49,7 @@ OverlayError setOverlayAlpha( vr::VROverlayHandle_t overlayHandle,
= vr::VROverlay()->SetOverlayAlpha( overlayHandle, alpha ); = vr::VROverlay()->SetOverlayAlpha( overlayHandle, alpha );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Error setting Overlay Alpha For " qCritical() << "Error setting Overlay Alpha For "
<< getOverlayKey( overlayHandle ) << " with error: " << getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg; << " " << customErrorMsg;
@@ -64,7 +66,7 @@ OverlayError setOverlayWidthInMeters( vr::VROverlayHandle_t overlayHandle,
overlayHandle, widthInMeters ); overlayHandle, widthInMeters );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Error setting overlay width For " qCritical() << "Error setting overlay width For "
<< getOverlayKey( overlayHandle ) << " with error: " << getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg; << " " << customErrorMsg;
@@ -81,14 +83,14 @@ OverlayError setOverlayFromFile( vr::VROverlayHandle_t overlayHandle,
const auto overlayPath = paths::binaryDirectoryFindFile( fileName ); const auto overlayPath = paths::binaryDirectoryFindFile( fileName );
if ( !overlayPath.has_value() ) if ( !overlayPath.has_value() )
{ {
LOG( ERROR ) << "File not Found: " << fileName << customErrorMsg; qCritical() << "File not Found: " << fileName << customErrorMsg;
return OverlayError::UndefinedError; return OverlayError::UndefinedError;
} }
vr::VROverlayError oError = vr::VROverlay()->SetOverlayFromFile( vr::VROverlayError oError = vr::VROverlay()->SetOverlayFromFile(
overlayHandle, overlayPath->c_str() ); overlayHandle, overlayPath->c_str() );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Error setting Overlay from file For " qCritical() << "Error setting Overlay from file For "
<< getOverlayKey( overlayHandle ) << " with error: " << getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( << vr::VROverlay()->GetOverlayErrorNameFromEnum(
oError ) oError )
@@ -99,13 +101,31 @@ OverlayError setOverlayFromFile( vr::VROverlayHandle_t overlayHandle,
} }
} }
OverlayError setOverlayFromQImage( vr::VROverlayHandle_t overlayHandle,
QImage& image,
std::string customErrorMsg )
{
image.convertTo( QImage::Format_RGBA8888 );
vr::VROverlayError oError = vr::VROverlay()->SetOverlayRaw(
overlayHandle, image.bits(), image.width(), image.height(), 4 );
if ( oError != vr::VROverlayError_None )
{
qCritical() << "Error setting Overlay from" << image << "For"
<< getOverlayKey( overlayHandle ) << "with error:"
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< customErrorMsg;
return OverlayError::UndefinedError;
}
return OverlayError::NoError;
}
OverlayError showOverlay( vr::VROverlayHandle_t overlayHandle, OverlayError showOverlay( vr::VROverlayHandle_t overlayHandle,
std::string customErrorMsg ) std::string customErrorMsg )
{ {
vr::VROverlayError oError = vr::VROverlay()->ShowOverlay( overlayHandle ); vr::VROverlayError oError = vr::VROverlay()->ShowOverlay( overlayHandle );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Error showing overlay For " qCritical() << "Error showing overlay For "
<< getOverlayKey( overlayHandle ) << " with error: " << getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg; << " " << customErrorMsg;
@@ -120,7 +140,7 @@ OverlayError hideOverlay( vr::VROverlayHandle_t overlayHandle,
vr::VROverlayError oError = vr::VROverlay()->HideOverlay( overlayHandle ); vr::VROverlayError oError = vr::VROverlay()->HideOverlay( overlayHandle );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Error hiding overlay For " qCritical() << "Error hiding overlay For "
<< getOverlayKey( overlayHandle ) << " with error: " << getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg; << " " << customErrorMsg;
@@ -139,7 +159,7 @@ OverlayError setOverlayTransformAbsolute(
overlayHandle, trackingOrigin, trackingOriginToOverlayTransform ); overlayHandle, trackingOrigin, trackingOriginToOverlayTransform );
if ( oError != vr::VROverlayError_None ) if ( oError != vr::VROverlayError_None )
{ {
LOG( ERROR ) << "Error setting Overlay Position For " qCritical() << "Error setting Overlay Position For "
<< getOverlayKey( overlayHandle ) << " with error: " << getOverlayKey( overlayHandle ) << " with error: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError )
<< " " << customErrorMsg; << " " << customErrorMsg;
+4 -1
View File
@@ -3,9 +3,9 @@
#include <openvr.h> #include <openvr.h>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <easylogging++.h>
#include <utility> #include <utility>
#include <string> #include <string>
#include <QImage>
#include "../utils/paths.h" #include "../utils/paths.h"
/* Wrapper For OpenVR's IVR settings class, allows us to do our error logging /* Wrapper For OpenVR's IVR settings class, allows us to do our error logging
@@ -43,6 +43,9 @@ OverlayError setOverlayWidthInMeters( vr::VROverlayHandle_t overlayHandle,
OverlayError setOverlayFromFile( vr::VROverlayHandle_t overlayHandle, OverlayError setOverlayFromFile( vr::VROverlayHandle_t overlayHandle,
std::string fileName, std::string fileName,
std::string customErrorMsg = "" ); std::string customErrorMsg = "" );
OverlayError setOverlayFromQImage( vr::VROverlayHandle_t overlayHandle,
QImage& image,
std::string customErrorMsg = "" );
OverlayError showOverlay( vr::VROverlayHandle_t overlayHandle, OverlayError showOverlay( vr::VROverlayHandle_t overlayHandle,
std::string customErrorMsg = "" ); std::string customErrorMsg = "" );
OverlayError hideOverlay( vr::VROverlayHandle_t overlayHandle, OverlayError hideOverlay( vr::VROverlayHandle_t overlayHandle,
+3 -1
View File
@@ -1,4 +1,6 @@
#include "ovr_settings_wrapper.h" #include "ovr_settings_wrapper.h"
#include <QtLogging>
#include <QtDebug>
namespace ovr_settings_wrapper namespace ovr_settings_wrapper
{ {
@@ -19,7 +21,7 @@ SettingsError handleErrors( std::string settingsKey,
{ {
return SettingsError::UndefinedError; return SettingsError::UndefinedError;
} }
LOG( ERROR ) << "Could not access \"" << settingsKey << "\" setting: " qCritical() << "Could not access \"" << settingsKey << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum( error ) << vr::VRSettings()->GetSettingsErrorNameFromEnum( error )
<< " " << customErrorMsg; << " " << customErrorMsg;
if ( error if ( error
-1
View File
@@ -3,7 +3,6 @@
#include <openvr.h> #include <openvr.h>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <easylogging++.h>
#include <utility> #include <utility>
/* Wrapper For OpenVR's IVR settings class, allows us to do our error logging /* Wrapper For OpenVR's IVR settings class, allows us to do our error logging
+9 -6
View File
@@ -1,4 +1,7 @@
#include "ovr_system_wrapper.h" #include "ovr_system_wrapper.h"
#include <QtLogging>
#include <QtDebug>
#include <vector>
namespace ovr_system_wrapper namespace ovr_system_wrapper
{ {
@@ -8,7 +11,7 @@ SystemError handleTrackedPropertyErrors( vr::TrackedDeviceProperty tdp,
{ {
if ( error != vr::TrackedProp_Success ) if ( error != vr::TrackedProp_Success )
{ {
LOG( ERROR ) << "Could not get Property with error \"" qCritical() << "Could not get Property with error \""
<< vr::VRSystem()->GetPropErrorNameFromEnum( error ) << vr::VRSystem()->GetPropErrorNameFromEnum( error )
<< "\" property: " << "\" property: "
<< "todo" << "todo"
@@ -295,7 +298,7 @@ std::string getControllerName()
} }
if ( !isLeftCon && !isRightCon && hasHMD ) if ( !isLeftCon && !isRightCon && hasHMD )
{ {
LOG( WARNING ) << "WARNING: No Controllers assuming based on HMD"; qWarning() << "WARNING: No Controllers assuming based on HMD";
auto hmdName auto hmdName
= getStringTrackedProperty( hmdIdx, vr::Prop_ControllerType_String ) = getStringTrackedProperty( hmdIdx, vr::Prop_ControllerType_String )
.second; .second;
@@ -309,26 +312,26 @@ std::string getControllerName()
} }
if ( hmdName == "vive_pro" ) if ( hmdName == "vive_pro" )
{ {
LOG( WARNING ) qWarning()
<< "Vive Pro Detected, Assuming Knuckles this may be wrong"; << "Vive Pro Detected, Assuming Knuckles this may be wrong";
return "knuckles"; return "knuckles";
} }
if ( hmdName == "holographic_hmd" ) if ( hmdName == "holographic_hmd" )
{ {
LOG( WARNING ) << "WMR detected, Assuming HP CONTROLLERS"; qWarning() << "WMR detected, Assuming HP CONTROLLERS";
return "hpmotioncontroller"; return "hpmotioncontroller";
} }
if ( hmdName == "rift" ) if ( hmdName == "rift" )
{ {
return "oculus_touch"; return "oculus_touch";
} }
LOG( WARNING ) << "Headset Not recognized Assuming touch controllers " qWarning() << "Headset Not recognized Assuming touch controllers "
+ hmdName; + hmdName;
return "oculus_touch"; return "oculus_touch";
} }
if ( right != left ) if ( right != left )
{ {
LOG( WARNING ) << "WARNING: Left and Right Controllers are Different, " qWarning() << "WARNING: Left and Right Controllers are Different, "
"Prioritizing right"; "Prioritizing right";
} }
if ( rightIdx == 999 ) if ( rightIdx == 999 )
+1 -1
View File
@@ -3,9 +3,9 @@
#include <openvr.h> #include <openvr.h>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <easylogging++.h>
#include <utility> #include <utility>
#include <map> #include <map>
#include <vector>
/* Wrapper For OpenVR's IVR settings class, allows us to do our error logging /* Wrapper For OpenVR's IVR settings class, allows us to do our error logging
* while also minimizing code * while also minimizing code
+150 -138
View File
@@ -11,17 +11,26 @@
#include <QtWidgets/QGraphicsSceneMouseEvent> #include <QtWidgets/QGraphicsSceneMouseEvent>
#include <QtWidgets/QApplication> #include <QtWidgets/QApplication>
#include <QtWidgets/QGraphicsEllipseItem> #include <QtWidgets/QGraphicsEllipseItem>
#include <QQuickGraphicsConfiguration>
#include <QOpenGLExtraFunctions> #include <QOpenGLExtraFunctions>
#include <QCursor> #include <QCursor>
#include <QProcess> #include <QProcess>
#include <QMessageBox> #include <QMessageBox>
#include <QtLogging>
#include <QtDebug>
#include <iostream> #include <iostream>
#include <cmath> #include <cmath>
#include <openvr.h> #include <openvr.h>
#include <easylogging++.h> #include "openvr/ovr_overlay_wrapper.h"
#include "utils/Matrix.h" #include "utils/Matrix.h"
#include "keyboard_input/input_sender.h" #include "keyboard_input/input_sender.h"
#include "settings/settings.h" #include "settings/settings.h"
#include <qapplication.h>
#include <qlogging.h>
#include <qnamespace.h>
#include <rhi/qrhi.h>
#include <stdexcept>
#include <d3d11.h>
// application namespace // application namespace
namespace advsettings namespace advsettings
@@ -60,61 +69,23 @@ OverlayController::OverlayController( bool desktopMode,
// Throw Error If over 16k characters in path string // Throw Error If over 16k characters in path string
if ( !pathIsGood ) if ( !pathIsGood )
{ {
LOG( ERROR ) << "Error Finding VR Runtime Path, Attempting Recovery: "; qCritical() << "Error Finding VR Runtime Path, Attempting Recovery: ";
uint32_t maxLengthRe = requiredLength; uint32_t maxLengthRe = requiredLength;
LOG( INFO ) << "Open VR reporting Required path length of: " qInfo() << "Open VR reporting Required path length of: " << maxLengthRe;
<< maxLengthRe;
} }
m_runtimePathUrl = QUrl::fromLocalFile( tempRuntimePath ); m_runtimePathUrl = QUrl::fromLocalFile( tempRuntimePath );
LOG( INFO ) << "VR Runtime Path: " << m_runtimePathUrl.toLocalFile(); qInfo() << "VR Runtime Path: " << m_runtimePathUrl.toLocalFile();
const double initVol = soundVolume(); const double initVol = soundVolume();
constexpr auto clickSoundURL = "res/sounds/click.wav"; m_activationSoundEffect.setSource( QUrl( ":/qt/qml/AdvancedSettings/src/res/sounds/click.wav" ) );
const auto activationSoundFile
= paths::binaryDirectoryFindFile( clickSoundURL );
if ( activationSoundFile.has_value() )
{
m_activationSoundEffect.setSource( QUrl::fromLocalFile(
QString::fromStdString( ( *activationSoundFile ) ) ) );
m_activationSoundEffect.setVolume( initVol ); m_activationSoundEffect.setVolume( initVol );
}
else
{
LOG( ERROR ) << "Could not find activation sound file "
<< clickSoundURL;
}
constexpr auto focusChangedSoundURL = "res/sounds/focus.wav";
const auto focusChangedSoundFile
= paths::binaryDirectoryFindFile( focusChangedSoundURL );
if ( focusChangedSoundFile.has_value() ) m_focusChangedSoundEffect.setSource( QUrl( ":/qt/qml/AdvancedSettings/src/res/sounds/focus.wav" ) );
{
m_focusChangedSoundEffect.setSource( QUrl::fromLocalFile(
QString::fromStdString( ( *focusChangedSoundFile ) ) ) );
m_focusChangedSoundEffect.setVolume( initVol ); m_focusChangedSoundEffect.setVolume( initVol );
}
else
{
LOG( ERROR ) << "Could not find focus Changed sound file "
<< focusChangedSoundURL;
}
constexpr auto alarmFileName = "res/sounds/alarm01.wav"; m_alarm01SoundEffect.setSource( QUrl( ":/qt/qml/AdvancedSettings/src/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 ); m_alarm01SoundEffect.setVolume( 1.0 );
}
else
{
LOG( ERROR ) << "Could not find alarm01 sound file " << alarmFileName;
}
// If we have desktop mode flag ignore waht toggle says otherwise we use // If we have desktop mode flag ignore waht toggle says otherwise we use
// toggle // toggle
@@ -122,28 +93,7 @@ OverlayController::OverlayController( bool desktopMode,
{ {
m_desktopMode = desktopModeToggle(); m_desktopMode = desktopModeToggle();
} }
m_desktopMode = false;
QSurfaceFormat format;
// Qt's QOpenGLPaintDevice is not compatible with OpenGL versions >= 3.0
// NVIDIA does not care, but unfortunately AMD does
// Are subtle changes to the semantics of OpenGL functions actually covered
// by the compatibility profile, and this is an AMD bug?
format.setVersion( 2, 1 );
// format.setProfile( QSurfaceFormat::CompatibilityProfile );
format.setDepthBufferSize( 16 );
format.setStencilBufferSize( 8 );
format.setSamples( 16 );
m_openGLContext.setFormat( format );
if ( !m_openGLContext.create() )
{
throw std::runtime_error( "Could not create OpenGL context" );
}
// create an offscreen surface to attach the context and FBO to
m_offscreenSurface.setFormat( m_openGLContext.format() );
m_offscreenSurface.create();
m_openGLContext.makeCurrent( &m_offscreenSurface );
if ( !vr::VROverlay() ) if ( !vr::VROverlay() )
{ {
@@ -344,10 +294,10 @@ OverlayController::OverlayController( bool desktopMode,
} }
else else
{ {
LOG( INFO ) << "Version Check: Feature disabled. Not checking version."; qInfo() << "Version Check: Feature disabled. Not checking version.";
} }
LOG( INFO ) << "OPENSSL VERSION: " qInfo() << "OPENSSL VERSION: "
<< QSslSocket::sslLibraryBuildVersionString(); << QSslSocket::sslLibraryBuildVersionString();
} }
@@ -373,7 +323,7 @@ void OverlayController::exitApp()
Shutdown(); Shutdown();
QApplication::exit(); QApplication::exit();
LOG( INFO ) << "All systems exited."; qInfo() << "All systems exited.";
exit( EXIT_SUCCESS ); exit( EXIT_SUCCESS );
// Does not fallthrough // Does not fallthrough
} }
@@ -403,7 +353,9 @@ void OverlayController::Shutdown()
m_pRenderTimer->stop(); m_pRenderTimer->stop();
m_pRenderTimer.reset(); m_pRenderTimer.reset();
} }
m_pFbo.reset(); m_render_pass_descriptor.reset();
m_render_target.reset();
m_pFBTexture.reset();
} }
void OverlayController::SetWidget( QQuickItem* quickItem, void OverlayController::SetWidget( QQuickItem* quickItem,
@@ -412,6 +364,7 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
{ {
if ( !m_desktopMode ) if ( !m_desktopMode )
{ {
qDebug() << "not desktop mode";
vr::VROverlayError overlayError vr::VROverlayError overlayError
= vr::VROverlay()->CreateDashboardOverlay( = vr::VROverlay()->CreateDashboardOverlay(
key.c_str(), key.c_str(),
@@ -439,24 +392,17 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
vr::VROverlayFlags_SendVRSmoothScrollEvents, vr::VROverlayFlags_SendVRSmoothScrollEvents,
true ); true );
constexpr auto thumbiconFilename = "res/img/icons/thumbicon.png";
const auto thumbIconPath
= paths::binaryDirectoryFindFile( thumbiconFilename );
if ( thumbIconPath.has_value() )
{ {
vr::VROverlay()->SetOverlayFromFile( m_ulOverlayThumbnailHandle, QImage thumbiconImg( ":qt/qml/AdvancedSettings/src/res/img/icons/thumbicon.png");
thumbIconPath->c_str() ); ovr_overlay_wrapper::setOverlayFromQImage(
} m_ulOverlayThumbnailHandle, thumbiconImg );
else
{
LOG( ERROR ) << "Could not find thumbnail icon \""
<< thumbiconFilename << "\"";
} }
// Too many render calls in too short time overwhelm Qt and an // Too many render calls in too short time overwhelm Qt and an
// assertion gets thrown. Therefore we use an timer to delay render // assertion gets thrown. Therefore we use an timer to delay render
// calls // calls
m_pRenderTimer.reset( new QTimer() ); m_pRenderTimer.reset( new QTimer() );
m_pRenderTimer->moveToThread( qApp->thread() );
m_pRenderTimer->setSingleShot( true ); m_pRenderTimer->setSingleShot( true );
m_pRenderTimer->setInterval( 5 ); m_pRenderTimer->setInterval( 5 );
connect( m_pRenderTimer.get(), connect( m_pRenderTimer.get(),
@@ -464,22 +410,51 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
this, this,
SLOT( renderOverlay() ) ); SLOT( renderOverlay() ) );
QOpenGLFramebufferObjectFormat fboFormat; #if QT_CONFIG( vulkan )
fboFormat.setAttachment( if ( m_window.graphicsApi() == QSGRendererInterface::Vulkan )
QOpenGLFramebufferObject::CombinedDepthStencil ); {
fboFormat.setTextureTarget( GL_TEXTURE_2D ); m_vulkanInstance.reset( new QVulkanInstance );
m_pFbo.reset( new QOpenGLFramebufferObject( m_vulkanInstance->setExtensions(
static_cast<int>( quickItem->width() ), QQuickGraphicsConfiguration::preferredInstanceExtensions() );
static_cast<int>( quickItem->height() ), if ( !m_vulkanInstance->create() )
fboFormat ) ); throw std::runtime_error( "Cannot create vulkan instance" );
m_window.setRenderTarget( m_pFbo.get() ); m_window.setVulkanInstance( m_vulkanInstance.get() );
}
#endif
if ( !m_renderControl.initialize() )
throw std::runtime_error( "could not initialize m_renderControl" );
QRhi* rhi = this->rhi();
qInfo() << "Started with" << rhi->backendName();
m_pFBTexture.reset( rhi->newTexture(
QRhiTexture::RGBA8,
quickItem->size().toSize(),
1,
QRhiTexture::RenderTarget | QRhiTexture::UsedAsTransferSource ) );
if ( !m_pFBTexture->create() )
throw std::runtime_error( "RhiTexture not created" );
m_render_target.reset(
rhi->newTextureRenderTarget( { m_pFBTexture.get() } ) );
m_render_pass_descriptor.reset(
m_render_target->newCompatibleRenderPassDescriptor() );
m_render_target->setRenderPassDescriptor(
m_render_pass_descriptor.get() );
if ( !m_render_target->create() )
throw std::runtime_error( "failed to create render target" );
auto qqrt
= QQuickRenderTarget::fromRhiRenderTarget( m_render_target.get() );
m_window.setRenderTarget( qqrt );
quickItem->setParentItem( m_window.contentItem() ); quickItem->setParentItem( m_window.contentItem() );
m_window.setGeometry( 0, m_window.setGeometry( 0,
0, 0,
static_cast<int>( quickItem->width() ), static_cast<int>( quickItem->width() ),
static_cast<int>( quickItem->height() ) ); static_cast<int>( quickItem->height() ) );
m_renderControl.initialize( &m_openGLContext );
vr::HmdVector2_t vecWindowSize vr::HmdVector2_t vecWindowSize
= { static_cast<float>( quickItem->width() ), = { static_cast<float>( quickItem->width() ),
@@ -510,7 +485,7 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
m_steamVRTabController.initStage2( this ); m_steamVRTabController.initStage2( this );
m_chaperoneTabController.initStage2( this ); m_chaperoneTabController.initStage2( this );
m_fixFloorTabController.initStage2( this ); m_fixFloorTabController.initStage2( this );
m_audioTabController.initStage2(); m_audioTabController.initStage2( this );
m_statisticsTabController.initStage2( this ); m_statisticsTabController.initStage2( this );
m_settingsTabController.initStage2( this ); m_settingsTabController.initStage2( this );
m_utilitiesTabController.initStage2( this ); m_utilitiesTabController.initStage2( this );
@@ -526,7 +501,7 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
autoApplyChaperoneName() ); autoApplyChaperoneName() );
if ( chapindex.first ) if ( chapindex.first )
{ {
LOG( INFO ) << "Auto Applying Chaperone"; qInfo() << "Auto Applying Chaperone";
m_chaperoneTabController.applyChaperoneProfile( chapindex.second ); m_chaperoneTabController.applyChaperoneProfile( chapindex.second );
// This should be the way to stop room-setup from starting... as it // This should be the way to stop room-setup from starting... as it
// sends steamvr a signal that it is completed // sends steamvr a signal that it is completed
@@ -534,7 +509,7 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
vr::EChaperoneConfigFile_Live ); vr::EChaperoneConfigFile_Live );
return; return;
} }
LOG( WARNING ) << "Profile Not Found for Auto Apply Chaperone!"; qWarning() << "Profile Not Found for Auto Apply Chaperone!";
} }
auto indexList = ovr_system_wrapper::getAllConnectedDevices(); auto indexList = ovr_system_wrapper::getAllConnectedDevices();
@@ -571,6 +546,59 @@ void OverlayController::OnRenderRequest()
} }
} }
void OverlayController::SetOverlayFromQRhiTexture( QRhiTexture& tex )
{
vr::Texture_t vrTex = {};
QRhi* rhi = this->rhi();
switch ( rhi->backend() )
{
case QRhi::OpenGLES2:
{
vrTex.handle = reinterpret_cast<void*>( tex.nativeTexture().object );
vrTex.eType = vr::TextureType_OpenGL;
vrTex.eColorSpace = vr::ColorSpace_Auto;
}
break;
case QRhi::D3D11:
{
vrTex.handle = reinterpret_cast<ID3D11Texture2D *>( tex.nativeTexture().object );
vrTex.eType = vr::TextureType_DirectX;
vrTex.eColorSpace = vr::ColorSpace_Auto;
}
break;
#if QT_CONFIG( vulkan )
case QRhi::Vulkan:
{
const QRhiVulkanNativeHandles* vulkan_handles
= reinterpret_cast<const QRhiVulkanNativeHandles*>(
rhi->nativeHandles() );
vr::VRVulkanTextureData_t vulkan = {
.m_nImage = tex.nativeTexture().object,
.m_pDevice = vulkan_handles->dev,
.m_pPhysicalDevice = vulkan_handles->physDev,
.m_pInstance = vulkan_handles->inst->vkInstance(),
.m_pQueue = vulkan_handles->gfxQueue,
.m_nQueueFamilyIndex = vulkan_handles->gfxQueueIdx,
.m_nWidth = static_cast<uint32_t>( tex.pixelSize().width() ),
.m_nHeight = static_cast<uint32_t>( tex.pixelSize().height() ),
.m_nFormat = static_cast<uint32_t>(tex.format()),
.m_nSampleCount = static_cast<uint32_t>( tex.sampleCount() ),
};
vrTex.handle = &vulkan;
vrTex.eType = vr::TextureType_Vulkan;
vrTex.eColorSpace = vr::ColorSpace_Auto;
}
break;
#endif
default:
qFatal() << "unimplemented backend:" << rhi->backend();
throw std::runtime_error( "unimplemented backend" );
}
vr::VROverlay()->SetOverlayTexture( m_ulOverlayHandle, &vrTex );
}
void OverlayController::renderOverlay() void OverlayController::renderOverlay()
{ {
if ( !m_desktopMode ) if ( !m_desktopMode )
@@ -582,28 +610,12 @@ void OverlayController::renderOverlay()
m_ulOverlayThumbnailHandle ) ) ) m_ulOverlayThumbnailHandle ) ) )
return; return;
m_renderControl.polishItems(); m_renderControl.polishItems();
m_renderControl.beginFrame();
m_renderControl.sync(); m_renderControl.sync();
m_renderControl.render(); m_renderControl.render();
m_renderControl.endFrame();
GLuint unTexture = m_pFbo->texture(); SetOverlayFromQRhiTexture( *m_pFBTexture );
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 );
}
m_openGLContext.functions()->glFlush(); // We need to flush otherwise
// the texture may be empty.*/
} }
} }
@@ -621,14 +633,15 @@ 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; //TODO temp mouse is negative??
float y = m_window.height() - mouse.y;
#ifdef __linux__ #ifdef __linux__
float h = static_cast<float>( m_window.height() ); float h = static_cast<float>( m_window.height() );
y = h - y; y = h - y;
#endif #endif
return QPoint( static_cast<int>( mouse.x ), static_cast<int>( y ) ); return { mouse.x, y };
} }
void OverlayController::processMediaKeyBindings() void OverlayController::processMediaKeyBindings()
@@ -1013,7 +1026,7 @@ QString OverlayController::versionCheckText() const
void OverlayController::setVersionCheckText( QString value, bool notify ) void OverlayController::setVersionCheckText( QString value, bool notify )
{ {
m_versionCheckText = value; m_versionCheckText = value;
LOG( INFO ) << "m_versionCheckText = " << m_versionCheckText; qInfo() << "m_versionCheckText = " << m_versionCheckText;
if ( notify ) if ( notify )
{ {
emit versionCheckTextChanged( m_versionCheckText ); emit versionCheckTextChanged( m_versionCheckText );
@@ -1134,7 +1147,7 @@ void OverlayController::mainEventLoop()
{ {
case vr::VREvent_MouseMove: case vr::VREvent_MouseMove:
{ {
QPoint ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse ); QPointF ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse );
if ( ptNewMouse != m_ptLastMouse ) if ( ptNewMouse != m_ptLastMouse )
{ {
QMouseEvent mouseEvent( QEvent::MouseMove, QMouseEvent mouseEvent( QEvent::MouseMove,
@@ -1142,7 +1155,7 @@ void OverlayController::mainEventLoop()
m_window.mapToGlobal( ptNewMouse ), m_window.mapToGlobal( ptNewMouse ),
Qt::NoButton, Qt::NoButton,
m_lastMouseButtons, m_lastMouseButtons,
nullptr ); Qt::NoModifier );
m_ptLastMouse = ptNewMouse; m_ptLastMouse = ptNewMouse;
QCoreApplication::sendEvent( &m_window, &mouseEvent ); QCoreApplication::sendEvent( &m_window, &mouseEvent );
OnRenderRequest(); OnRenderRequest();
@@ -1152,7 +1165,7 @@ void OverlayController::mainEventLoop()
case vr::VREvent_MouseButtonDown: case vr::VREvent_MouseButtonDown:
{ {
QPoint ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse ); QPointF ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse );
Qt::MouseButton button Qt::MouseButton button
= vrEvent.data.mouse.button == vr::VRMouseButton_Right = vrEvent.data.mouse.button == vr::VRMouseButton_Right
? Qt::RightButton ? Qt::RightButton
@@ -1163,14 +1176,14 @@ void OverlayController::mainEventLoop()
m_window.mapToGlobal( ptNewMouse ), m_window.mapToGlobal( ptNewMouse ),
button, button,
m_lastMouseButtons, m_lastMouseButtons,
nullptr ); Qt::NoModifier );
QCoreApplication::sendEvent( &m_window, &mouseEvent ); QCoreApplication::sendEvent( &m_window, &mouseEvent );
} }
break; break;
case vr::VREvent_MouseButtonUp: case vr::VREvent_MouseButtonUp:
{ {
QPoint ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse ); QPointF ptNewMouse = getMousePositionForEvent( vrEvent.data.mouse );
Qt::MouseButton button Qt::MouseButton button
= vrEvent.data.mouse.button == vr::VRMouseButton_Right = vrEvent.data.mouse.button == vr::VRMouseButton_Right
? Qt::RightButton ? Qt::RightButton
@@ -1181,7 +1194,7 @@ void OverlayController::mainEventLoop()
m_window.mapToGlobal( ptNewMouse ), m_window.mapToGlobal( ptNewMouse ),
button, button,
m_lastMouseButtons, m_lastMouseButtons,
nullptr ); Qt::NoModifier );
QCoreApplication::sendEvent( &m_window, &mouseEvent ); QCoreApplication::sendEvent( &m_window, &mouseEvent );
} }
break; break;
@@ -1197,10 +1210,10 @@ void OverlayController::mainEventLoop()
* ( 360.0f * 8.0f ) ), * ( 360.0f * 8.0f ) ),
static_cast<int>( vrEvent.data.scroll.ydelta static_cast<int>( vrEvent.data.scroll.ydelta
* ( 360.0f * 8.0f ) ) ), * ( 360.0f * 8.0f ) ) ),
0,
Qt::Vertical,
m_lastMouseButtons, m_lastMouseButtons,
nullptr ); Qt::KeyboardModifiers::fromInt( 0 ),
Qt::ScrollPhase::NoScrollPhase,
false );
QCoreApplication::sendEvent( &m_window, &wheelEvent ); QCoreApplication::sendEvent( &m_window, &wheelEvent );
} }
break; break;
@@ -1213,7 +1226,7 @@ void OverlayController::mainEventLoop()
case vr::VREvent_Quit: case vr::VREvent_Quit:
{ {
LOG( INFO ) << "Received quit request."; qInfo() << "Received quit request.";
vr::VRSystem()->AcknowledgeQuit_Exiting(); // Let us buy some vr::VRSystem()->AcknowledgeQuit_Exiting(); // Let us buy some
// time just in case // time just in case
@@ -1225,14 +1238,14 @@ void OverlayController::mainEventLoop()
case vr::VREvent_DashboardActivated: case vr::VREvent_DashboardActivated:
{ {
LOG( DEBUG ) << "Dashboard activated"; qDebug() << "Dashboard activated";
m_dashboardVisible = true; m_dashboardVisible = true;
} }
break; break;
case vr::VREvent_DashboardDeactivated: case vr::VREvent_DashboardDeactivated:
{ {
LOG( DEBUG ) << "Dashboard deactivated"; qDebug() << "Dashboard deactivated";
m_dashboardVisible = false; m_dashboardVisible = false;
settings::saveChangedSettings(); settings::saveChangedSettings();
if(0UL != m_lastTextUID){ if(0UL != m_lastTextUID){
@@ -1709,7 +1722,7 @@ void OverlayController::OnNetworkReply( QNetworkReply* reply )
if ( reply->error() == QNetworkReply::NoError ) if ( reply->error() == QNetworkReply::NoError )
{ {
QByteArray replyByteData = reply->readAll(); QByteArray replyByteData = reply->readAll();
LOG( INFO ) << "Version Check: Recieved Data: " << replyByteData; qInfo() << "Version Check: Recieved Data: " << replyByteData;
QJsonParseError parseError; QJsonParseError parseError;
m_remoteVersionJsonDocument m_remoteVersionJsonDocument
= QJsonDocument::fromJson( replyByteData, &parseError ); = QJsonDocument::fromJson( replyByteData, &parseError );
@@ -1752,10 +1765,9 @@ void OverlayController::OnNetworkReply( QNetworkReply* reply )
+ QString::number( m_remoteVersionPatch ) + QString::number( m_remoteVersionPatch )
+ ") available." ); + ") available." );
} }
LOG( INFO ) qInfo() << "Version Check: Newer version ("
<< "Version Check: Newer version (" << m_remoteVersionMajor << m_remoteVersionMajor << "." << m_remoteVersionMinor
<< "." << m_remoteVersionMinor << "." << "." << m_remoteVersionPatch << ") available.";
<< m_remoteVersionPatch << ") available.";
} }
else else
{ {
@@ -1764,20 +1776,20 @@ void OverlayController::OnNetworkReply( QNetworkReply* reply )
setVersionCheckText( m_optionalMessage ); setVersionCheckText( m_optionalMessage );
} }
setNewVersionDetected( false ); setNewVersionDetected( false );
LOG( INFO ) << "Version Check: Installed version is latest " qInfo() << "Version Check: Installed version is latest "
"release."; "release.";
} }
} }
else else
{ {
LOG( ERROR ) qCritical()
<< "Version Check: Error parsing json. QJsonParseError = " << "Version Check: Error parsing json. QJsonParseError = "
<< parseError.error; << parseError.error;
} }
} }
else else
{ {
LOG( ERROR ) << "Version Check: Error connecting to network. " qCritical() << "Version Check: Error connecting to network. "
"QNetworkReply::NetworkError = " "QNetworkReply::NetworkError = "
<< reply->error(); << reply->error();
} }
+28 -6
View File
@@ -1,9 +1,10 @@
#pragma once #pragma once
#include <algorithm>
#include <openvr.h> #include <openvr.h>
#include <QtCore/QtCore> #include <QtCore/QtCore>
// because of incompatibilities with QtOpenGL and GLEW we need to cherry pick // because of incompatibilities with QtOpenGL and GLEW we need to cherry pick
// includes // includes
#include <QVector2D>
#include <QMatrix4x4> #include <QMatrix4x4>
#include <QVector> #include <QVector>
#include <QVector2D> #include <QVector2D>
@@ -21,8 +22,10 @@
#include <QNetworkAccessManager> #include <QNetworkAccessManager>
#include <QNetworkReply> #include <QNetworkReply>
#include <QNetworkRequest> #include <QNetworkRequest>
#include <QQuickRenderTarget>
#include <memory> #include <memory>
#include <easylogging++.h> #include <optional>
#include <rhi/qrhi.h>
#include "openvr/openvr_init.h" #include "openvr/openvr_init.h"
@@ -105,18 +108,30 @@ private:
vr::VROverlayHandle_t m_ulOverlayThumbnailHandle vr::VROverlayHandle_t m_ulOverlayThumbnailHandle
= vr::k_ulOverlayHandleInvalid; = vr::k_ulOverlayHandleInvalid;
#if QT_CONFIG( vulkan )
std::unique_ptr<QVulkanInstance> m_vulkanInstance = nullptr;
#endif
QQuickRenderControl m_renderControl; QQuickRenderControl m_renderControl;
QQuickWindow m_window{ &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; std::unique_ptr<QOpenGLFramebufferObject> m_pFbo;
QQuickRenderTarget m_pRenderTarget;
QOpenGLContext m_openGLContext; QOpenGLContext m_openGLContext;
QOffscreenSurface m_offscreenSurface; QOffscreenSurface m_offscreenSurface;
*/
QTimer m_pumpEventsTimer; QTimer m_pumpEventsTimer;
std::unique_ptr<QTimer> m_pRenderTimer; std::unique_ptr<QTimer> m_pRenderTimer;
bool m_dashboardVisible = false; bool m_dashboardVisible = false;
QPoint m_ptLastMouse; QPointF m_ptLastMouse;
Qt::MouseButtons m_lastMouseButtons = nullptr; Qt::MouseButtons m_lastMouseButtons;
bool m_desktopMode; bool m_desktopMode;
bool m_noSound; bool m_noSound;
@@ -154,7 +169,8 @@ private:
QJsonDocument m_remoteVersionJsonDocument = QJsonDocument(); QJsonDocument m_remoteVersionJsonDocument = QJsonDocument();
QJsonObject m_remoteVersionJsonObject; QJsonObject m_remoteVersionJsonObject;
public: // I know it's an ugly hack to make them public to enable external public:
// I know it's an ugly hack to make them public to enable external
// access, but I am too lazy to implement getters. // access, but I am too lazy to implement getters.
SteamVRTabController m_steamVRTabController; SteamVRTabController m_steamVRTabController;
ChaperoneTabController m_chaperoneTabController; ChaperoneTabController m_chaperoneTabController;
@@ -169,7 +185,7 @@ public: // I know it's an ugly hack to make them public to enable external
bool m_incomingReset = false; bool m_incomingReset = false;
private: private:
QPoint getMousePositionForEvent( vr::VREvent_Mouse_t mouse ); QPointF getMousePositionForEvent( vr::VREvent_Mouse_t mouse );
void processInputBindings(); void processInputBindings();
void processMediaKeyBindings(); void processMediaKeyBindings();
void processMotionBindings(); void processMotionBindings();
@@ -179,11 +195,17 @@ private:
void processRotationBindings(); void processRotationBindings();
void processExclusiveInputBinding(); void processExclusiveInputBinding();
inline QRhi* rhi()
{
return m_renderControl.rhi();
}
bool m_exclusiveState = false; bool m_exclusiveState = false;
bool m_keyPressOneState = false; bool m_keyPressOneState = false;
bool m_keyPressTwoState = false; bool m_keyPressTwoState = false;
public: public:
void SetOverlayFromQRhiTexture( QRhiTexture& tex );
OverlayController( bool desktopMode, bool noSound, QQmlEngine& qmlEngine ); OverlayController( bool desktopMode, bool noSound, QQmlEngine& qmlEngine );
virtual ~OverlayController(); virtual ~OverlayController();
+10 -10
View File
@@ -1,7 +1,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs
import ovras.advsettings 1.0 import ovras.advsettings 1.0
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
import "common" import "common"
@@ -415,43 +415,43 @@ MyStackViewPage {
Connections { Connections {
target: ChaperoneTabController target: ChaperoneTabController
onChaperoneSwitchToBeginnerEnabledChanged: { function onChaperoneSwitchToBeginnerEnabledChanged() {
switchBeginnerToggle.checked = ChaperoneTabController.chaperoneSwitchToBeginnerEnabled switchBeginnerToggle.checked = ChaperoneTabController.chaperoneSwitchToBeginnerEnabled
} }
onChaperoneSwitchToBeginnerDistanceChanged: { function onChaperoneSwitchToBeginnerDistanceChanged() {
var d = ChaperoneTabController.chaperoneSwitchToBeginnerDistance.toFixed(2) var d = ChaperoneTabController.chaperoneSwitchToBeginnerDistance.toFixed(2)
if (d <= switchBeginnerDistanceSlider.to && Math.abs(switchBeginnerDistanceSlider.value - d) > 0.0008) { if (d <= switchBeginnerDistanceSlider.to && Math.abs(switchBeginnerDistanceSlider.value - d) > 0.0008) {
switchBeginnerDistanceSlider.value = d switchBeginnerDistanceSlider.value = d
} }
switchBeginnerDistanceText.text = d switchBeginnerDistanceText.text = d
} }
onChaperoneHapticFeedbackEnabledChanged: { function onChaperoneHapticFeedbackEnabledChanged() {
hapticFeedbackToggle.checked = ChaperoneTabController.chaperoneHapticFeedbackEnabled hapticFeedbackToggle.checked = ChaperoneTabController.chaperoneHapticFeedbackEnabled
} }
onChaperoneHapticFeedbackDistanceChanged: { function onChaperoneHapticFeedbackDistanceChanged() {
var d = ChaperoneTabController.chaperoneHapticFeedbackDistance.toFixed(2) var d = ChaperoneTabController.chaperoneHapticFeedbackDistance.toFixed(2)
if (d <= hapticFeedbackDistanceSlider.to && Math.abs(hapticFeedbackDistanceSlider.value - d) > 0.0008) { if (d <= hapticFeedbackDistanceSlider.to && Math.abs(hapticFeedbackDistanceSlider.value - d) > 0.0008) {
hapticFeedbackDistanceSlider.value = d hapticFeedbackDistanceSlider.value = d
} }
hapticFeedbackDistanceText.text = d hapticFeedbackDistanceText.text = d
} }
onChaperoneAlarmSoundEnabledChanged: { function onChaperoneAlarmSoundEnabledChanged() {
audioWarningToggle.checked = ChaperoneTabController.chaperoneAlarmSoundEnabled audioWarningToggle.checked = ChaperoneTabController.chaperoneAlarmSoundEnabled
} }
onChaperoneAlarmSoundLoopingChanged: { function onChaperoneAlarmSoundLoopingChanged() {
audioWarningLoopingToggle.checked = ChaperoneTabController.chaperoneAlarmSoundLooping audioWarningLoopingToggle.checked = ChaperoneTabController.chaperoneAlarmSoundLooping
} }
onChaperoneAlarmSoundDistanceChanged: { function onChaperoneAlarmSoundDistanceChanged() {
var d = ChaperoneTabController.chaperoneAlarmSoundDistance.toFixed(2) var d = ChaperoneTabController.chaperoneAlarmSoundDistance.toFixed(2)
if (d <= audioWarningDistanceSlider.to && Math.abs(audioWarningDistanceSlider.value - d) > 0.0008) { if (d <= audioWarningDistanceSlider.to && Math.abs(audioWarningDistanceSlider.value - d) > 0.0008) {
audioWarningDistanceSlider.value = d audioWarningDistanceSlider.value = d
} }
audioWarningDistanceText.text = d audioWarningDistanceText.text = d
} }
onChaperoneShowDashboardEnabledChanged: { function onChaperoneShowDashboardEnabledChanged() {
openDashboardToggle.checked = ChaperoneTabController.chaperoneShowDashboardEnabled openDashboardToggle.checked = ChaperoneTabController.chaperoneShowDashboardEnabled
} }
onChaperoneShowDashboardDistanceChanged: { function onChaperoneShowDashboardDistanceChanged() {
var d = ChaperoneTabController.chaperoneShowDashboardDistance.toFixed(2) var d = ChaperoneTabController.chaperoneShowDashboardDistance.toFixed(2)
if (d <= openDashboardDistanceSlider.to && Math.abs(openDashboardDistanceSlider.value - d) > 0.0008) { if (d <= openDashboardDistanceSlider.to && Math.abs(openDashboardDistanceSlider.value - d) > 0.0008) {
openDashboardDistanceSlider.value = d openDashboardDistanceSlider.value = d
+4 -4
View File
@@ -140,7 +140,7 @@ MyStackViewPage {
Connections { Connections {
target: FixFloorTabController target: FixFloorTabController
onStatusMessageSignal: { function onStatusMessageSignal() {
if (statusMessageTimer.running) { if (statusMessageTimer.running) {
statusMessageTimer.stop() statusMessageTimer.stop()
} }
@@ -148,15 +148,15 @@ MyStackViewPage {
statusMessageTimer.interval = FixFloorTabController.currentStatusMessageTimeout() * 1000 statusMessageTimer.interval = FixFloorTabController.currentStatusMessageTimeout() * 1000
statusMessageTimer.start() statusMessageTimer.start()
} }
onMeasureStartSignal: { function onMeasureStartSignal() {
fixButton.enabled = false fixButton.enabled = false
undoFixButton.enabled = false undoFixButton.enabled = false
} }
onMeasureEndSignal: { function onMeasureEndSignal() {
fixButton.enabled = true fixButton.enabled = true
// undoFixButton.enabled = FixFloorTabController.canUndo // undoFixButton.enabled = FixFloorTabController.canUndo
} }
onCanUndoChanged: { function onCanUndoChanged() {
//undoFixButton.enabled = FixFloorTabController.canUndo //undoFixButton.enabled = FixFloorTabController.canUndo
// revert below to this -^ // revert below to this -^
undoFixButton.enabled = false undoFixButton.enabled = false
+10 -10
View File
@@ -524,33 +524,33 @@ MyStackViewPage {
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onOffsetXChanged: { function onOffsetXChanged() {
spaceMoveXText.text = MoveCenterTabController.offsetX.toFixed(2) spaceMoveXText.text = MoveCenterTabController.offsetX.toFixed(2)
} }
onOffsetYChanged: { function onOffsetYChanged() {
spaceMoveYText.text = MoveCenterTabController.offsetY.toFixed(2) spaceMoveYText.text = MoveCenterTabController.offsetY.toFixed(2)
} }
onOffsetZChanged: { function onOffsetZChanged() {
spaceMoveZText.text = MoveCenterTabController.offsetZ.toFixed(2) spaceMoveZText.text = MoveCenterTabController.offsetZ.toFixed(2)
} }
onRotationChanged: { function onRotationChanged() {
spaceRotationSlider.value = ( MoveCenterTabController.rotation / 100 ) spaceRotationSlider.value = ( MoveCenterTabController.rotation / 100 )
} }
onTempRotationChanged: { function onTempRotationChanged() {
var intTempRotation = MoveCenterTabController.tempRotation var intTempRotation = MoveCenterTabController.tempRotation
spaceRotationSlider.value = ( intTempRotation / 100 ) spaceRotationSlider.value = ( intTempRotation / 100 )
spaceRotationText.text = ( intTempRotation / 100 ) + "°" spaceRotationText.text = ( intTempRotation / 100 ) + "°"
} }
onLockXToggleChanged: { function onLockXToggleChanged() {
lockXToggle.checked = MoveCenterTabController.lockXToggle lockXToggle.checked = MoveCenterTabController.lockXToggle
} }
onLockYToggleChanged: { function onLockYToggleChanged() {
lockYToggle.checked = MoveCenterTabController.lockYToggle lockYToggle.checked = MoveCenterTabController.lockYToggle
} }
onLockZToggleChanged: { function onLockZToggleChanged() {
lockZToggle.checked = MoveCenterTabController.lockZToggle lockZToggle.checked = MoveCenterTabController.lockZToggle
} }
onTrackingUniverseChanged: { function onTrackingUniverseChanged() {
if (MoveCenterTabController.trackingUniverse === 0) { if (MoveCenterTabController.trackingUniverse === 0) {
spaceModeText.text = "Sitting" spaceModeText.text = "Sitting"
spaceSeatedRecenter.visible = true spaceSeatedRecenter.visible = true
@@ -560,7 +560,7 @@ MyStackViewPage {
spaceModeText.text = "Unknown(" + MoveCenterTabController.trackingUniverse + ")" spaceModeText.text = "Unknown(" + MoveCenterTabController.trackingUniverse + ")"
} }
} }
onOffsetProfilesUpdated: { function onOffsetProfilesUpdated() {
reloadOffsetProfiles() reloadOffsetProfiles()
} }
} }
+37 -38
View File
@@ -1,7 +1,7 @@
import QtQuick 2.7 import QtQuick
import QtQuick.Controls 2.0 import QtQuick.Controls
import QtQuick.Layouts 1.3 import QtQuick.Layouts
import ovras.advsettings 1.0 import ovras.advsettings
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
import "common" import "common"
import "utilities_page" import "utilities_page"
@@ -28,107 +28,107 @@ MyStackViewPage {
spacing: 10 spacing: 10
MyPushButton { MyPushButton {
id: steamVRButton id: steamVRButton
iconPath: "qrc:/main_menu_icons/steamvr_tab_icon" iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/steamvr_tab_icon.svg"
activationSoundEnabled: false activationSoundEnabled: false
text: " SteamVR" text: " SteamVR"
Layout.fillWidth: true Layout.fillWidth: true
onClicked: { onClicked: {
MyResources.playFocusChangedSound() OverlayController.playFocusChangedSound()
mainView.push(steamVRPage) mainView.push(steamVRPage)
} }
} }
MyPushButton { MyPushButton {
id: chaperoneButton id: chaperoneButton
iconPath: "qrc:/main_menu_icons/chaperone_tab_icon" iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/chaperone_tab_icon.svg"
activationSoundEnabled: false activationSoundEnabled: false
text: " Chaperone" text: " Chaperone"
Layout.fillWidth: true Layout.fillWidth: true
onClicked: { onClicked: {
MyResources.playFocusChangedSound() OverlayController.playFocusChangedSound()
mainView.push(chaperonePage) mainView.push(chaperonePage)
} }
} }
MyPushButton { MyPushButton {
id: playSpaceButton id: playSpaceButton
iconPath: "qrc:/main_menu_icons/offsets_tab_icon" iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/offsets_tab_icon.svg"
activationSoundEnabled: false activationSoundEnabled: false
text: " Offsets" text: " Offsets"
Layout.fillWidth: true Layout.fillWidth: true
onClicked: { onClicked: {
MyResources.playFocusChangedSound() OverlayController.playFocusChangedSound()
mainView.push(playspacePage) mainView.push(playspacePage)
} }
} }
MyPushButton { MyPushButton {
id: motionButton id: motionButton
iconPath: "qrc:/main_menu_icons/motion_tab_icon" iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/motion_tab_icon.svg"
activationSoundEnabled: false activationSoundEnabled: false
text: " Motion" text: " Motion"
Layout.fillWidth: true Layout.fillWidth: true
onClicked: { onClicked: {
MyResources.playFocusChangedSound() OverlayController.playFocusChangedSound()
mainView.push(motionPage) mainView.push(motionPage)
} }
} }
MyPushButton { MyPushButton {
id: rotationButton id: rotationButton
iconPath: "qrc:/main_menu_icons/rotation_tab_icon" iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/rotation_tab_icon.svg"
activationSoundEnabled: false activationSoundEnabled: false
text: " Rotation" text: " Rotation"
Layout.fillWidth: true Layout.fillWidth: true
onClicked: { onClicked: {
MyResources.playFocusChangedSound() OverlayController.playFocusChangedSound()
mainView.push(rotationPage) mainView.push(rotationPage)
} }
} }
MyPushButton { MyPushButton {
id: fixFloorButton id: fixFloorButton
iconPath: "qrc:/main_menu_icons/space_fix_tab_icon" iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/space_fix_tab_icon.svg"
activationSoundEnabled: false activationSoundEnabled: false
text: " Space Fix" text: " Space Fix"
Layout.fillWidth: true Layout.fillWidth: true
onClicked: { onClicked: {
MyResources.playFocusChangedSound() OverlayController.playFocusChangedSound()
mainView.push(fixFloorPage) mainView.push(fixFloorPage)
} }
} }
MyPushButton { MyPushButton {
id: audioButton id: audioButton
iconPath: "qrc:/main_menu_icons/audio_tab_icon" iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/audio_tab_icon.svg"
activationSoundEnabled: false activationSoundEnabled: false
text: " Audio" text: " Audio"
Layout.fillWidth: true Layout.fillWidth: true
onClicked: { onClicked: {
MyResources.playFocusChangedSound() OverlayController.playFocusChangedSound()
mainView.push(audioPage) mainView.push(audioPage)
} }
} }
MyPushButton { MyPushButton {
id: videoButton id: videoButton
iconPath: "qrc:/main_menu_icons/video_tab_icon" iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/video_tab_icon.svg"
activationSoundEnabled: false activationSoundEnabled: false
text: " Video" text: " Video"
Layout.fillWidth: true Layout.fillWidth: true
onClicked: { onClicked: {
MyResources.playFocusChangedSound() OverlayController.playFocusChangedSound()
mainView.push(videoPage) mainView.push(videoPage)
} }
} }
MyPushButton { MyPushButton {
id: utilitiesButton id: utilitiesButton
iconPath: "qrc:/main_menu_icons/utilities_tab_icon" iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/utilities_tab_icon.svg"
activationSoundEnabled: false activationSoundEnabled: false
text: " Utilities" text: " Utilities"
Layout.fillWidth: true Layout.fillWidth: true
onClicked: { onClicked: {
MyResources.playFocusChangedSound() OverlayController.playFocusChangedSound()
mainView.push(utilitiesPage) mainView.push(utilitiesPage)
} }
} }
@@ -136,12 +136,12 @@ MyStackViewPage {
MyPushButton { MyPushButton {
id: statisticsButton id: statisticsButton
iconPath: "qrc:/main_menu_icons/statistics_tab_icon" iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/statistics_tab_icon.svg"
activationSoundEnabled: false activationSoundEnabled: false
text: " Statistics" text: " Statistics"
Layout.fillWidth: true Layout.fillWidth: true
onClicked: { onClicked: {
MyResources.playFocusChangedSound() OverlayController.playFocusChangedSound()
mainView.push(statisticsPage) mainView.push(statisticsPage)
} }
} }
@@ -153,7 +153,7 @@ MyStackViewPage {
MyPushButton { MyPushButton {
id: bindingsButton id: bindingsButton
iconPath: "qrc:/main_menu_icons/bindings_tab_icon" iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/bindings_tab_icon.svg"
activationSoundEnabled: false activationSoundEnabled: false
text: " Bindings" text: " Bindings"
Layout.fillWidth: true Layout.fillWidth: true
@@ -164,12 +164,12 @@ MyStackViewPage {
MyPushButton { MyPushButton {
id: settingsButton id: settingsButton
iconPath: "qrc:/main_menu_icons/settings_tab_icon" iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/settings_tab_icon.svg"
activationSoundEnabled: false activationSoundEnabled: false
text: " Settings" text: " Settings"
Layout.fillWidth: true Layout.fillWidth: true
onClicked: { onClicked: {
MyResources.playFocusChangedSound() OverlayController.playFocusChangedSound()
mainView.push(settingsPage) mainView.push(settingsPage)
} }
} }
@@ -379,7 +379,7 @@ MyStackViewPage {
Layout.leftMargin: 12 Layout.leftMargin: 12
checkable: true checkable: true
contentItem: Image { contentItem: Image {
source: parent.checked ? "qrc:/microphone/off" : "qrc:/microphone/on" source: parent.checked ? "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/microphone/mic_off.svg" : "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/microphone/mic_on.svg"
sourceSize.width: 32 sourceSize.width: 32
sourceSize.height: 32 sourceSize.height: 32
anchors.fill: parent anchors.fill: parent
@@ -470,10 +470,9 @@ MyStackViewPage {
summaryMicMuteToggle.checked = AudioTabController.micMuted summaryMicMuteToggle.checked = AudioTabController.micMuted
summaryPttToggle.checked = AudioTabController.pttEnabled summaryPttToggle.checked = AudioTabController.pttEnabled
} }
Connections { Connections {
target: OverlayController target: OverlayController
onNewVersionDetectedChanged: { function onNewVersionDetectedChanged() {
if (OverlayController.newVersionDetected) if (OverlayController.newVersionDetected)
{ {
summaryVersionCheckTextRect.color = "#ff0000" summaryVersionCheckTextRect.color = "#ff0000"
@@ -481,10 +480,10 @@ MyStackViewPage {
summaryVersionCheckTextRect.color = "#2a2e35" summaryVersionCheckTextRect.color = "#2a2e35"
} }
} }
onVersionCheckTextChanged: { function onVersionCheckTextChanged() {
summaryVersionCheckText.text = OverlayController.versionCheckText summaryVersionCheckText.text = OverlayController.versionCheckText
} }
onDisableVersionCheckChanged: { function onDisableVersionCheckChanged() {
if (OverlayController.disableVersionCheck) if (OverlayController.disableVersionCheck)
{ {
summaryVersionCheckText.visible = false summaryVersionCheckText.visible = false
@@ -503,34 +502,34 @@ MyStackViewPage {
Connections { Connections {
target: ChaperoneTabController target: ChaperoneTabController
onChaperoneProfilesUpdated: { function onChaperoneProfilesUpdated() {
reloadChaperoneProfiles() reloadChaperoneProfiles()
} }
} }
Connections { Connections {
target: VideoTabController target: VideoTabController
onVideoProfilesUpdated: { function onVideoProfilesUpdated() {
reloadVideoProfiles() reloadVideoProfiles()
} }
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onMicVolumeChanged: { function onMicVolumeChanged() {
summaryMicVolumeSlider.value = AudioTabController.micVolume summaryMicVolumeSlider.value = AudioTabController.micVolume
} }
onMicMutedChanged: { function onMicMutedChanged() {
summaryMicMuteToggle.checked = AudioTabController.micMuted summaryMicMuteToggle.checked = AudioTabController.micMuted
} }
onPttEnabledChanged: { function onPttEnabledChanged() {
summaryPttToggle.checked = AudioTabController.pttEnabled summaryPttToggle.checked = AudioTabController.pttEnabled
} }
} }
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onTrackingUniverseChanged: { function onTrackingUniverseChanged() {
if (MoveCenterTabController.trackingUniverse === 0) { if (MoveCenterTabController.trackingUniverse === 0) {
summaryPlaySpaceModeText.text = "Sitting" summaryPlaySpaceModeText.text = "Sitting"
} else if (MoveCenterTabController.trackingUniverse === 1) { } else if (MoveCenterTabController.trackingUniverse === 1) {
+15 -15
View File
@@ -338,66 +338,66 @@ MyStackViewPage {
Connections { Connections {
target: SettingsTabController target: SettingsTabController
onAutoStartEnabledChanged: { function onAutoStartEnabledChanged() {
settingsAutoStartToggle.checked = SettingsTabController.autoStartEnabled settingsAutoStartToggle.checked = SettingsTabController.autoStartEnabled
} }
onNativeChaperoneToggleChanged:{ function onNativeChaperoneToggleChanged(){
nativeChaperoneToggleButton.checked = SettingsTabController.nativeChaperoneToggle nativeChaperoneToggleButton.checked = SettingsTabController.nativeChaperoneToggle
} }
onOculusSdkToggleChanged:{ function onOculusSdkToggleChanged(){
oculusSdkToggleButton.checked = SettingsTabController.oculusSdkToggle oculusSdkToggleButton.checked = SettingsTabController.oculusSdkToggle
} }
} }
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onUniverseCenteredRotationChanged: { function onUniverseCenteredRotationChanged() {
universeCenteredRotationToggle.checked = MoveCenterTabController.universeCenteredRotation universeCenteredRotationToggle.checked = MoveCenterTabController.universeCenteredRotation
} }
} }
Connections { Connections {
target: OverlayController target: OverlayController
onVsyncDisabledChanged: { function onVsyncDisabledChanged() {
vsyncDisabledToggle.checked = OverlayController.vsyncDisabled vsyncDisabledToggle.checked = OverlayController.vsyncDisabled
customTickRateText.visible = vsyncDisabledToggle.checked customTickRateText.visible = vsyncDisabledToggle.checked
customTickRateLabel.visible = vsyncDisabledToggle.checked customTickRateLabel.visible = vsyncDisabledToggle.checked
customTickRateMsLabel.visible = vsyncDisabledToggle.checked customTickRateMsLabel.visible = vsyncDisabledToggle.checked
} }
onCrashRecoveryDisabledChanged: { function onCrashRecoveryDisabledChanged() {
disableCrashRecoveryToggle.checked = !OverlayController.crashRecoveryDisabled disableCrashRecoveryToggle.checked = !OverlayController.crashRecoveryDisabled
} }
onCustomTickRateMsChanged: { function onCustomTickRateMsChanged() {
customTickRateText.text = OverlayController.customTickRateMs customTickRateText.text = OverlayController.customTickRateMs
} }
onEnableDebugChanged: { function onEnableDebugChanged() {
debugStateRow.visible = OverlayController.enableDebug debugStateRow.visible = OverlayController.enableDebug
} }
onDebugStateChanged: { function onDebugStateChanged() {
debugStateText.text = OverlayController.debugState debugStateText.text = OverlayController.debugState
} }
onDisableVersionCheckChanged: { function onDisableVersionCheckChanged() {
disableVersionCheckToggle.checked = OverlayController.disableVersionCheck disableVersionCheckToggle.checked = OverlayController.disableVersionCheck
} }
onExclusiveInputEnabledChanged:{ function onExclusiveInputEnabledChanged(){
exclusiveInputToggleButton.checked = OverlayController.exclusiveInputEnabled exclusiveInputToggleButton.checked = OverlayController.exclusiveInputEnabled
} }
onAutoApplyChaperoneEnabledChanged: { function onAutoApplyChaperoneEnabledChanged() {
autoApplyChaperoneToggleButton.checked = OverlayController.autoApplyChaperoneEnabled autoApplyChaperoneToggleButton.checked = OverlayController.autoApplyChaperoneEnabled
} }
onSoundVolumeChanged:{ function onSoundVolumeChanged(){
volumeSlider.value = OverlayController.soundVolume volumeSlider.value = OverlayController.soundVolume
} }
onDesktopModeToggleChanged:{ function onDesktopModeToggleChanged(){
desktopModeToggleButton.checked = OverlayController.desktopModeToggle desktopModeToggleButton.checked = OverlayController.desktopModeToggle
} }
} }
Connections{ Connections{
target: ChaperoneTabController target: ChaperoneTabController
onChaperoneProfilesUpdated: { function onChaperoneProfilesUpdated() {
reloadChaperoneProfiles() reloadChaperoneProfiles()
} }
} }
@@ -44,14 +44,14 @@ RowLayout {
Connections { Connections {
target: AudioTabController target: AudioTabController
onPlaybackDeviceIndexChanged: { function onPlaybackDeviceIndexChanged() {
setShownAudioDevice(index) setShownAudioDevice(index)
} }
onPlaybackDeviceListChanged: { function onPlaybackDeviceListChanged() {
audioPlaybackNameCombo.devices = getAudioDeviceList() audioPlaybackNameCombo.devices = getAudioDeviceList()
setShownAudioDevice(AudioTabController.playbackDeviceIndex) setShownAudioDevice(AudioTabController.playbackDeviceIndex)
} }
onPlaybackOverrideChanged: { function onPlaybackOverrideChanged() {
playbackOverrideToggle.value = AudioTabController.playbackOverride playbackOverrideToggle.value = AudioTabController.playbackOverride
} }
} }
@@ -63,14 +63,14 @@ RowLayout {
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onMicDeviceIndexChanged: { function onMicDeviceIndexChanged() {
setShownAudioDevice(index) setShownAudioDevice(index)
} }
onRecordingDeviceListChanged: { function onRecordingDeviceListChanged() {
devices = getAudioDeviceList() devices = getAudioDeviceList()
setShownAudioDevice(AudioTabController.micDeviceIndex) setShownAudioDevice(AudioTabController.micDeviceIndex)
} }
onRecordingOverrideChanged: { function onRecordingOverrideChanged() {
recordingOverrideToggle.value = AudioTabController.recordingOverride recordingOverrideToggle.value = AudioTabController.recordingOverride
} }
} }
@@ -61,7 +61,7 @@ ColumnLayout {
Layout.leftMargin: 12 Layout.leftMargin: 12
checkable: true checkable: true
contentItem: Image { contentItem: Image {
source: parent.checked ? "qrc:/microphone/off" : "qrc:/microphone/on" source: parent.checked ? "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/microphone/mic_on.svg" : "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/microphone/mic_off.svg"
sourceSize.width: 32 sourceSize.width: 32
sourceSize.height: 32 sourceSize.height: 32
anchors.fill: parent anchors.fill: parent
@@ -89,7 +89,7 @@ ColumnLayout {
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onMicDeviceIndexChanged: { function onMicDeviceIndexChanged() {
if (index < 0) { if (index < 0) {
audioMicVolumeMinusButton.enabled = false audioMicVolumeMinusButton.enabled = false
audioMicVolumeSlider.enabled = false audioMicVolumeSlider.enabled = false
@@ -102,16 +102,16 @@ ColumnLayout {
audioMicMuteToggle.enabled = true audioMicMuteToggle.enabled = true
} }
} }
onMicVolumeChanged: { function onMicVolumeChanged() {
audioMicVolumeSlider.value = AudioTabController.micVolume audioMicVolumeSlider.value = AudioTabController.micVolume
} }
onMicMutedChanged: { function onMicMutedChanged() {
audioMicMuteToggle.checked = AudioTabController.micMuted audioMicMuteToggle.checked = AudioTabController.micMuted
} }
onPlaybackDeviceListChanged: { function onPlaybackDeviceListChanged() {
} }
onRecordingDeviceListChanged: { function onRecordingDeviceListChanged() {
if (AudioTabController.micDeviceIndex < 0) { if (AudioTabController.micDeviceIndex < 0) {
audioMicVolumeMinusButton.enabled = false audioMicVolumeMinusButton.enabled = false
audioMicVolumeSlider.enabled = false audioMicVolumeSlider.enabled = false
@@ -41,10 +41,10 @@ RowLayout {
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onMirrorDeviceIndexChanged: { function onMirrorDeviceIndexChanged() {
setShownAudioDevice(index) setShownAudioDevice(index)
} }
onPlaybackDeviceListChanged: { function onPlaybackDeviceListChanged() {
audioMirrorNameCombo.devices = getAudioDeviceList() audioMirrorNameCombo.devices = getAudioDeviceList()
setShownAudioDevice(AudioTabController.mirrorDeviceIndex) setShownAudioDevice(AudioTabController.mirrorDeviceIndex)
} }
@@ -62,7 +62,7 @@ ColumnLayout {
Layout.leftMargin: 12 Layout.leftMargin: 12
checkable: true checkable: true
contentItem: Image { contentItem: Image {
source: parent.checked ? "qrc:/speaker/off" : "qrc:/speaker/on" source: parent.checked ? "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/speaker/speaker_off.svg" : "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/speaker/speaker_on.svg"
sourceSize.width: 32 sourceSize.width: 32
sourceSize.height: 32 sourceSize.height: 32
anchors.fill: parent anchors.fill: parent
@@ -89,7 +89,7 @@ ColumnLayout {
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onMirrorDeviceIndexChanged: { function onMirrorDeviceIndexChanged() {
if (index < 0) { if (index < 0) {
audioMirrorNameCombo.deviceIndex = 0 audioMirrorNameCombo.deviceIndex = 0
audioMirrorVolumeMinusButton.enabled = false audioMirrorVolumeMinusButton.enabled = false
@@ -104,13 +104,13 @@ ColumnLayout {
audioMirrorNameCombo.deviceIndex = index + 1 audioMirrorNameCombo.deviceIndex = index + 1
} }
} }
onMirrorVolumeChanged: { function onMirrorVolumeChanged() {
audioMirrorVolumeSlider.value = AudioTabController.mirrorVolume audioMirrorVolumeSlider.value = AudioTabController.mirrorVolume
} }
onMirrorMutedChanged: { function onMirrorMutedChanged() {
audioMirrorMuteToggle.checked = AudioTabController.mirrorMuted audioMirrorMuteToggle.checked = AudioTabController.mirrorMuted
} }
onPlaybackDeviceListChanged: { function onPlaybackDeviceListChanged() {
if (AudioTabController.mirrorDeviceIndex < 0) { if (AudioTabController.mirrorDeviceIndex < 0) {
audioMirrorVolumeMinusButton.enabled = false audioMirrorVolumeMinusButton.enabled = false
audioMirrorVolumeSlider.enabled = false audioMirrorVolumeSlider.enabled = false
@@ -98,13 +98,13 @@ ColumnLayout {
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onAudioProfilesUpdated: { function onAudioProfilesUpdated() {
reloadAudioProfiles() reloadAudioProfiles()
} }
onAudioProfileAdded: { function onAudioProfileAdded() {
audioProfileComboBox.currentIndex = AudioTabController.getAudioProfileCount() audioProfileComboBox.currentIndex = AudioTabController.getAudioProfileCount()
} }
onDefaultProfileDisplay: { function onDefaultProfileDisplay() {
audioProfileComboBox.currentIndex = AudioTabController.getDefaultAudioProfileIndex( audioProfileComboBox.currentIndex = AudioTabController.getDefaultAudioProfileIndex(
) + 1 ) + 1
} }
@@ -21,7 +21,7 @@ MyToggleButton {
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onMicProximitySensorCanMuteChanged: { function onMicProximitySensorCanMuteChanged() {
audioMuteProximitySensorToggle.checked = AudioTabController.micProximitySensorCanMute audioMuteProximitySensorToggle.checked = AudioTabController.micProximitySensorCanMute
} }
} }
@@ -39,13 +39,13 @@ ColumnLayout {
} }
Connections { Connections {
target: AudioTabController target: AudioTabController
onPttEnabledChanged: { function onPttEnabledChanged() {
audioPttEnabledToggle.checked = AudioTabController.pttEnabled audioPttEnabledToggle.checked = AudioTabController.pttEnabled
} }
onMicReversePttChanged: { function onMicReversePttChanged() {
audioPttReverseToggle.checked = AudioTabController.micReversePtt audioPttReverseToggle.checked = AudioTabController.micReversePtt
} }
onPttShowNotificationChanged: { function onPttShowNotificationChanged() {
audioPttShowNotificationToggle.checked = AudioTabController.pttShowNotification audioPttShowNotificationToggle.checked = AudioTabController.pttShowNotification
} }
} }
+11 -11
View File
@@ -1,7 +1,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs
import ovras.advsettings 1.0 import ovras.advsettings 1.0
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
import "../common" import "../common"
@@ -494,7 +494,7 @@ MyStackViewPage {
text: "Proximity Warning Settings" text: "Proximity Warning Settings"
Layout.preferredWidth: 350 Layout.preferredWidth: 350
onClicked: { onClicked: {
MyResources.playFocusChangedSound() OverlayController.playFocusChangedSound()
mainView.push(chaperoneWarningsPage) mainView.push(chaperoneWarningsPage)
} }
} }
@@ -506,7 +506,7 @@ MyStackViewPage {
Layout.preferredWidth: 400 Layout.preferredWidth: 400
onClicked: { onClicked: {
MyResources.playFocusChangedSound() OverlayController.playFocusChangedSound()
mainView.push(chaperoneAdditionalPage) mainView.push(chaperoneAdditionalPage)
} }
} }
@@ -586,26 +586,26 @@ MyStackViewPage {
Connections { Connections {
target: ChaperoneTabController target: ChaperoneTabController
onBoundsVisibilityChanged: { function onBoundsVisibilityChanged() {
if (Math.abs(chaperoneVisibilitySlider.value - ChaperoneTabController.boundsVisibility) > 0.008) { if (Math.abs(chaperoneVisibilitySlider.value - ChaperoneTabController.boundsVisibility) > 0.008) {
chaperoneVisibilitySlider.value = ChaperoneTabController.boundsVisibility chaperoneVisibilitySlider.value = ChaperoneTabController.boundsVisibility
} }
} }
onFadeDistanceChanged: { function onFadeDistanceChanged() {
var d = ChaperoneTabController.fadeDistance.toFixed(1) var d = ChaperoneTabController.fadeDistance.toFixed(1)
if (d <= chaperoneFadeDistanceSlider.to && Math.abs(chaperoneFadeDistanceSlider.value - d) > 0.008) { if (d <= chaperoneFadeDistanceSlider.to && Math.abs(chaperoneFadeDistanceSlider.value - d) > 0.008) {
chaperoneFadeDistanceSlider.value = d chaperoneFadeDistanceSlider.value = d
} }
chaperoneFadeDistanceText.text = d chaperoneFadeDistanceText.text = d
} }
onHeightChanged: { function onHeightChanged() {
var h = ChaperoneTabController.height.toFixed(2) var h = ChaperoneTabController.height.toFixed(2)
if (h <= chaperoneHeightSlider.to && Math.abs(chaperoneHeightSlider.value - h) > 0.008) { if (h <= chaperoneHeightSlider.to && Math.abs(chaperoneHeightSlider.value - h) > 0.008) {
chaperoneHeightSlider.value = h chaperoneHeightSlider.value = h
} }
chaperoneHeightText.text = h chaperoneHeightText.text = h
} }
onChaperoneDimHeightChanged: { function onChaperoneDimHeightChanged() {
var dim = ChaperoneTabController.chaperoneDimHeight var dim = ChaperoneTabController.chaperoneDimHeight
if(dim > 0.0){ if(dim > 0.0){
chaperoneDisableChaperone.enabled = false; chaperoneDisableChaperone.enabled = false;
@@ -625,16 +625,16 @@ MyStackViewPage {
chaperoneFadeDistanceText.enabled = true; chaperoneFadeDistanceText.enabled = true;
} }
} }
onCenterMarkerNewChanged: { function onCenterMarkerNewChanged() {
chaperoneCenterMarkerToggle.checked = ChaperoneTabController.centerMarkerNew chaperoneCenterMarkerToggle.checked = ChaperoneTabController.centerMarkerNew
} }
onPlaySpaceMarkerChanged: { function onPlaySpaceMarkerChanged() {
chaperonePlaySpaceToggle.checked = ChaperoneTabController.playSpaceMarker chaperonePlaySpaceToggle.checked = ChaperoneTabController.playSpaceMarker
} }
onForceBoundsChanged: { function onForceBoundsChanged() {
chaperoneForceBoundsToggle.checked = ChaperoneTabController.forceBounds chaperoneForceBoundsToggle.checked = ChaperoneTabController.forceBounds
} }
onChaperoneProfilesUpdated: { function onChaperoneProfilesUpdated() {
reloadChaperoneProfiles() reloadChaperoneProfiles()
} }
} }
@@ -1,7 +1,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs
import ovras.advsettings 1.0 import ovras.advsettings 1.0
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
import "../../common" import "../../common"
@@ -113,7 +113,7 @@ MyStackViewPage {
Connections { Connections {
target: ChaperoneTabController target: ChaperoneTabController
onChaperoneDimHeightChanged: { function onChaperoneDimHeightChanged() {
var d = ChaperoneTabController.chaperoneDimHeight.toFixed(2) var d = ChaperoneTabController.chaperoneDimHeight.toFixed(2)
if (d <= dimHeightSlider.to && Math.abs(dimHeightSlider.value - d) > 0.0008) { if (d <= dimHeightSlider.to && Math.abs(dimHeightSlider.value - d) > 0.0008) {
dimHeightSlider.value = d dimHeightSlider.value = d
@@ -180,17 +180,17 @@ GroupBox {
Connections { Connections {
target: ChaperoneTabController target: ChaperoneTabController
onChaperoneColorRChanged:{ function onChaperoneColorRChanged(){
var redValue = ChaperoneTabController.chaperoneColorR var redValue = ChaperoneTabController.chaperoneColorR
colorRedText.text = redValue colorRedText.text = redValue
chaperoneColorRedSlider.value = redValue chaperoneColorRedSlider.value = redValue
} }
onChaperoneColorGChanged:{ function onChaperoneColorGChanged(){
var greenValue = ChaperoneTabController.chaperoneColorG var greenValue = ChaperoneTabController.chaperoneColorG
colorGreenText.text = greenValue colorGreenText.text = greenValue
chaperoneColorGreenSlider.value = greenValue chaperoneColorGreenSlider.value = greenValue
} }
onChaperoneColorBChanged:{ function onChaperoneColorBChanged(){
var blueValue = ChaperoneTabController.chaperoneColorB var blueValue = ChaperoneTabController.chaperoneColorB
colorBlueText.text = blueValue colorBlueText.text = blueValue
chaperoneColorBlueSlider.value = blueValue chaperoneColorBlueSlider.value = blueValue
@@ -70,10 +70,10 @@ GroupBox {
Connections { Connections {
target: ChaperoneTabController target: ChaperoneTabController
onChaperoneFloorToggleChanged:{ function onChaperoneFloorToggleChanged(){
chaperoneFloorToggleBtn.checked = ChaperoneTabController.chaperoneFloorToggle chaperoneFloorToggleBtn.checked = ChaperoneTabController.chaperoneFloorToggle
} }
onCenterMarkerChanged:{ function onCenterMarkerChanged(){
legacyCenterMarkerbtn.checked = ChaperoneTabController.centerMarker legacyCenterMarkerbtn.checked = ChaperoneTabController.centerMarker
} }
} }
@@ -40,7 +40,7 @@ GroupBox {
Layout.preferredWidth: 200 Layout.preferredWidth: 200
onCheckedChanged: { onCheckedChanged: {
if(checked){ if(checked){
MyResources.playActivationSound() OverlayController.playActivationSound()
ChaperoneTabController.setCollisionBoundStyle(0) ChaperoneTabController.setCollisionBoundStyle(0)
} }
} }
@@ -52,7 +52,7 @@ GroupBox {
Layout.preferredWidth: 200 Layout.preferredWidth: 200
onCheckedChanged: { onCheckedChanged: {
if(checked){ if(checked){
MyResources.playActivationSound() OverlayController.playActivationSound()
ChaperoneTabController.setCollisionBoundStyle(1) ChaperoneTabController.setCollisionBoundStyle(1)
} }
} }
@@ -64,7 +64,7 @@ GroupBox {
Layout.preferredWidth: 200 Layout.preferredWidth: 200
onCheckedChanged: { onCheckedChanged: {
if(checked){ if(checked){
MyResources.playActivationSound() OverlayController.playActivationSound()
ChaperoneTabController.setCollisionBoundStyle(2) ChaperoneTabController.setCollisionBoundStyle(2)
} }
} }
@@ -76,7 +76,7 @@ GroupBox {
Layout.preferredWidth: 200 Layout.preferredWidth: 200
onCheckedChanged: { onCheckedChanged: {
if(checked){ if(checked){
MyResources.playActivationSound() OverlayController.playActivationSound()
ChaperoneTabController.setCollisionBoundStyle(3) ChaperoneTabController.setCollisionBoundStyle(3)
} }
} }
@@ -88,7 +88,7 @@ GroupBox {
Layout.preferredWidth: 200 Layout.preferredWidth: 200
onCheckedChanged: { onCheckedChanged: {
if(checked){ if(checked){
MyResources.playActivationSound() OverlayController.playActivationSound()
ChaperoneTabController.setCollisionBoundStyle(4) ChaperoneTabController.setCollisionBoundStyle(4)
} }
} }
@@ -112,7 +112,7 @@ GroupBox {
Connections { Connections {
target: ChaperoneTabController target: ChaperoneTabController
onCollisionBoundStyleChanged:{ function onCollisionBoundStyleChanged(){
var collisiontype = ChaperoneTabController.collisionBoundStyle var collisiontype = ChaperoneTabController.collisionBoundStyle
switch(collisiontype){ switch(collisiontype){
case 0: denseRadio.checked = true; break; case 0: denseRadio.checked = true; break;
@@ -124,4 +124,7 @@ GroupBox {
} }
} }
Connections {
target: OverlayController
}
} }
+5 -1
View File
@@ -1,5 +1,6 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import ovras.advsettings
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
@@ -63,11 +64,14 @@ ComboBox {
onActivated: { onActivated: {
if (activeFocus) { if (activeFocus) {
MyResources.playActivationSound() OverlayController.playActivationSound()
} }
} }
Component.onCompleted: { Component.onCompleted: {
popup.background.color = "#2a2e35" popup.background.color = "#2a2e35"
} }
Connections {
target: OverlayController
}
} }
@@ -1,6 +1,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import ovras.advsettings
Popup { Popup {
id: myDialogPopup id: myDialogPopup
+1
View File
@@ -1,6 +1,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import ovras.advsettings
Popup { Popup {
id: myDialogPopup id: myDialogPopup
+5 -1
View File
@@ -1,5 +1,6 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import ovras.advsettings
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
Button { Button {
@@ -35,7 +36,10 @@ Button {
onClicked: { onClicked: {
if (activationSoundEnabled) { if (activationSoundEnabled) {
MyResources.playActivationSound() OverlayController.playActivationSound()
} }
} }
Connections {
target: OverlayController
}
} }
+5 -1
View File
@@ -1,5 +1,6 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import ovras.advsettings
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
Button { Button {
@@ -24,6 +25,9 @@ Button {
} }
onClicked: { onClicked: {
MyResources.playActivationSound() OverlayController.playActivationSound()
}
Connections {
target: OverlayController
} }
} }
+5 -1
View File
@@ -1,5 +1,6 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import ovras.advsettings
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
RadioButton { RadioButton {
@@ -19,6 +20,9 @@ RadioButton {
} }
onClicked: { onClicked: {
MyResources.playActivationSound() OverlayController.playActivationSound()
}
Connections {
target: OverlayController
} }
} }
+3
View File
@@ -10,4 +10,7 @@ QtObject {
function playFocusChangedSound() { function playFocusChangedSound() {
OverlayController.playFocusChangedSound() OverlayController.playFocusChangedSound()
} }
Connections {
target: OverlayController
}
} }
+2 -1
View File
@@ -1,5 +1,6 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import ovras.advsettings
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
@@ -48,7 +49,7 @@ Slider {
onValueChanged: { onValueChanged: {
if (activeFocus) { if (activeFocus) {
//MyResources.playActivationSound() //OverlayController.playActivationSound()
} }
} }
} }
+7 -3
View File
@@ -1,8 +1,9 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.2 import QtQuick.Layouts 1.2
import ovras.advsettings
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
// Needed for MyResources in the default folder. // Needed for OverlayController in the default folder.
import ".." import ".."
Rectangle { Rectangle {
@@ -26,7 +27,7 @@ Rectangle {
enabled: headerShowBackButton enabled: headerShowBackButton
opacity: headerShowBackButton ? 1.0 : 0.0 opacity: headerShowBackButton ? 1.0 : 0.0
contentItem: Image { contentItem: Image {
source: "qrc:/common/backarrow" source: "qrc:/qt/qml/AdvancedSettings/src/res/img/common/backarrow.svg"
sourceSize.width: 50 sourceSize.width: 50
sourceSize.height: 50 sourceSize.height: 50
anchors.fill: parent anchors.fill: parent
@@ -45,7 +46,7 @@ Rectangle {
} }
} }
onClicked: { onClicked: {
MyResources.playFocusChangedSound() OverlayController.playFocusChangedSound()
stackView.pop() stackView.pop()
} }
} }
@@ -90,4 +91,7 @@ Rectangle {
content.Layout.rightMargin = 40 content.Layout.rightMargin = 40
content.Layout.bottomMargin = 40 content.Layout.bottomMargin = 40
} }
Connections {
target: OverlayController
}
} }
+1 -1
View File
@@ -1,6 +1,6 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import ovras.advsettings
Text { Text {
color: "#d9dbe0" color: "#d9dbe0"
+7 -3
View File
@@ -1,7 +1,8 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import ovras.advsettings
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
// Needed for MyResources in the default folder. // Needed for OverlayControllers in the default folder.
import ".." import ".."
CheckBox { CheckBox {
@@ -31,7 +32,7 @@ CheckBox {
height: 28 height: 28
x: (parent.width - width) / 2 x: (parent.width - width) / 2
y: (parent.height - height) / 2 y: (parent.height - height) / 2
source: "qrc:/common/box_checkmark" source: "qrc:/qt/qml/AdvancedSettings/src/res/img/common/check.svg"
sourceSize.width: width sourceSize.width: width
sourceSize.height: height sourceSize.height: height
visible: parent.parent.checked visible: parent.parent.checked
@@ -60,6 +61,9 @@ CheckBox {
} }
onClicked: { onClicked: {
MyResources.playActivationSound() OverlayController.playActivationSound()
}
Connections {
target: OverlayController
} }
} }
+4 -3
View File
@@ -1,6 +1,6 @@
import QtQuick 2.7 import QtQuick
import QtQuick.Controls 2.0 import QtQuick.Controls.Material
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import ".." import ".."
import "../utilities_page" import "../utilities_page"
import "../audio_page" import "../audio_page"
@@ -11,6 +11,7 @@ import "../steamvr_page"
import "../rotation_page" import "../rotation_page"
import "../chaperone_page/chaperone_additional" import "../chaperone_page/chaperone_additional"
import "../steamvr_page/steamvr_additional" import "../steamvr_page/steamvr_additional"
import ovras.advsettings
Rectangle { Rectangle {
id: root id: root
@@ -218,19 +218,19 @@ GroupBox {
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onGravityActiveChanged: { function onGravityActiveChanged() {
gravityToggleButton.checked = MoveCenterTabController.gravityActive gravityToggleButton.checked = MoveCenterTabController.gravityActive
} }
onGravityStrengthChanged: { function onGravityStrengthChanged() {
gravityStrengthText.text = MoveCenterTabController.gravityStrength.toFixed(2) gravityStrengthText.text = MoveCenterTabController.gravityStrength.toFixed(2)
} }
onMomentumSaveChanged: { function onMomentumSaveChanged() {
momentumToggleButton.checked = MoveCenterTabController.momentumSave momentumToggleButton.checked = MoveCenterTabController.momentumSave
} }
onFlingStrengthChanged: { function onFlingStrengthChanged() {
flingStrengthText.text = MoveCenterTabController.flingStrength.toFixed(2) flingStrengthText.text = MoveCenterTabController.flingStrength.toFixed(2)
} }
onFrictionPercentChanged: { function onFrictionPercentChanged() {
frictionPercentText.text = MoveCenterTabController.frictionPercent + "%" frictionPercentText.text = MoveCenterTabController.frictionPercent + "%"
} }
} }
@@ -88,10 +88,10 @@ GroupBox {
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onHeightToggleChanged: { function onHeightToggleChanged() {
heightToggleButton.checked = MoveCenterTabController.heightToggle heightToggleButton.checked = MoveCenterTabController.heightToggle
} }
onHeightToggleOffsetChanged: { function onHeightToggleOffsetChanged() {
heightToggleOffsetText.text = MoveCenterTabController.heightToggleOffset.toFixed(2) heightToggleOffsetText.text = MoveCenterTabController.heightToggleOffset.toFixed(2)
} }
} }
@@ -156,19 +156,19 @@ GroupBox {
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onMoveShortcutLeftChanged: { function onMoveShortcutLeftChanged() {
moveShortcutLeft.checked = MoveCenterTabController.moveShortcutLeft moveShortcutLeft.checked = MoveCenterTabController.moveShortcutLeft
} }
onMoveShortcutRightChanged: { function onMoveShortcutRightChanged() {
moveShortcutRight.checked = MoveCenterTabController.moveShortcutRight moveShortcutRight.checked = MoveCenterTabController.moveShortcutRight
} }
onDragComfortFactorChanged: { function onDragComfortFactorChanged() {
dragComfortSlider.value = MoveCenterTabController.dragComfortFactor dragComfortSlider.value = MoveCenterTabController.dragComfortFactor
} }
onDragBoundsChanged: { function onDragBoundsChanged() {
dragBounds.checked = MoveCenterTabController.dragBounds dragBounds.checked = MoveCenterTabController.dragBounds
} }
onDragMultChanged: { function onDragMultChanged() {
dragMultText.text = MoveCenterTabController.dragMult.toFixed(2) dragMultText.text = MoveCenterTabController.dragMult.toFixed(2)
} }
} }
@@ -312,23 +312,23 @@ GroupBox {
Connections { Connections {
target: RotationTabController target: RotationTabController
onAutoTurnEnabledChanged: { function onAutoTurnEnabledChanged() {
autoTurn.checked = RotationTabController.autoTurnEnabled autoTurn.checked = RotationTabController.autoTurnEnabled
} }
onAutoTurnActivationDistanceChanged: { function onAutoTurnActivationDistanceChanged() {
activationSlider.value = RotationTabController.autoTurnActivationDistance.toFixed(2) activationSlider.value = RotationTabController.autoTurnActivationDistance.toFixed(2)
} }
onAutoTurnDeactivationDistanceChanged:{ function onAutoTurnDeactivationDistanceChanged(){
deactivationSlider.value = RotationTabController.autoTurnDeactivationDistance.toFixed(2) deactivationSlider.value = RotationTabController.autoTurnDeactivationDistance.toFixed(2)
} }
onAutoTurnUseCornerAngleChanged:{ function onAutoTurnUseCornerAngleChanged(){
cornerAngle.checked = RotationTabController.autoTurnUseCornerAngle cornerAngle.checked = RotationTabController.autoTurnUseCornerAngle
} }
onAutoTurnSpeedChanged:{ function onAutoTurnSpeedChanged(){
var val = RotationTabController.autoTurnSpeed var val = RotationTabController.autoTurnSpeed
speedSlider.value = ((val/100).toFixed()) speedSlider.value = ((val/100).toFixed())
} }
onAutoTurnModeChanged:{ function onAutoTurnModeChanged(){
if(RotationTabController.autoTurnMode === 1){ if(RotationTabController.autoTurnMode === 1){
autoTurnModeToggle.checked = true; autoTurnModeToggle.checked = true;
@@ -338,13 +338,13 @@ GroupBox {
autoTurnModeToggle.checked = false; autoTurnModeToggle.checked = false;
} }
} }
onMinCordTangleChanged:{ function onMinCordTangleChanged(){
detangleAngleStartText.text = parseInt(RotationTabController.minCordTangle*(180/Math.PI))+ "°" detangleAngleStartText.text = parseInt(RotationTabController.minCordTangle*(180/Math.PI))+ "°"
} }
onCordDetangleAngleChanged:{ function onCordDetangleAngleChanged(){
detangleAngleAssistText.text = parseInt(RotationTabController.cordDetangleAngle*(180/Math.PI))+ "°" detangleAngleAssistText.text = parseInt(RotationTabController.cordDetangleAngle*(180/Math.PI))+ "°"
} }
onAutoTurnShowNotificationChanged:{ function onAutoTurnShowNotificationChanged(){
autoTurnNotificationToggle.checked = RotationTabController.autoTurnShowNotification autoTurnNotificationToggle.checked = RotationTabController.autoTurnShowNotification
} }
} }
@@ -115,10 +115,10 @@ GroupBox {
Connections { Connections {
target: RotationTabController target: RotationTabController
onVestibularMotionEnabledChanged:{ function onVestibularMotionEnabledChanged(){
redirectedModeToggle.checked = RotationTabController.vestibularMotionEnabled redirectedModeToggle.checked = RotationTabController.vestibularMotionEnabled
} }
onVestibularMotionRadiusChanged:{ function onVestibularMotionRadiusChanged(){
redirectedWalkingRadiusText.text = ((RotationTabController.vestibularMotionRadius).toFixed(2)) redirectedWalkingRadiusText.text = ((RotationTabController.vestibularMotionRadius).toFixed(2))
} }
} }
@@ -103,10 +103,10 @@ GroupBox {
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onSnapTurnAngleChanged: { function onSnapTurnAngleChanged() {
snapTurnAngleText.text = ( Math.round( MoveCenterTabController.snapTurnAngle / 100 ) ) + "°" snapTurnAngleText.text = ( Math.round( MoveCenterTabController.snapTurnAngle / 100 ) ) + "°"
} }
onSmoothTurnRateChanged: { function onSmoothTurnRateChanged() {
smoothTurnRateText.text = MoveCenterTabController.smoothTurnRate + "%" smoothTurnRateText.text = MoveCenterTabController.smoothTurnRate + "%"
} }
} }
@@ -100,16 +100,16 @@ GroupBox {
Connections { Connections {
target: MoveCenterTabController target: MoveCenterTabController
onTurnBindLeftChanged: { function onTurnBindLeftChanged() {
turnBindLeft.checked = MoveCenterTabController.turnBindLeft turnBindLeft.checked = MoveCenterTabController.turnBindLeft
} }
onTurnBindRightChanged: { function onTurnBindRightChanged() {
turnBindRight.checked = MoveCenterTabController.turnBindRight turnBindRight.checked = MoveCenterTabController.turnBindRight
} }
onTurnComfortFactorChanged: { function onTurnComfortFactorChanged() {
turnComfortSlider.value = MoveCenterTabController.turnComfortFactor turnComfortSlider.value = MoveCenterTabController.turnComfortFactor
} }
onTurnBoundsChanged: { function onTurnBoundsChanged() {
turnBounds.checked = MoveCenterTabController.turnBounds turnBounds.checked = MoveCenterTabController.turnBounds
} }
} }
@@ -76,10 +76,10 @@ GroupBox {
Connections { Connections {
target: RotationTabController target: RotationTabController
onViewRatchettingEnabledChanged:{ function onViewRatchettingEnabledChanged(){
viewRatchetToggleBtn.checked = RotationTabController.viewRatchettingEnabled viewRatchetToggleBtn.checked = RotationTabController.viewRatchettingEnabled
} }
onViewRatchettingPercentChanged:{ function onViewRatchettingPercentChanged(){
var ratchetPercVal = RotationTabController.viewRatchettingPercent var ratchetPercVal = RotationTabController.viewRatchettingPercent
viewRatchetSlider.value = ratchetPercVal viewRatchetSlider.value = ratchetPercVal
viewRatchetText.text = ratchetPercVal.toFixed(2) viewRatchetText.text = ratchetPercVal.toFixed(2)
+4 -1
View File
@@ -32,7 +32,7 @@ MyStackViewPage {
Layout.preferredWidth: 350 Layout.preferredWidth: 350
onClicked: { onClicked: {
MyResources.playFocusChangedSound() OverlayController.playFocusChangedSound()
mainView.push(steamVRTXRXPage) mainView.push(steamVRTXRXPage)
SteamVRTabController.updateRXTXList() SteamVRTabController.updateRXTXList()
} }
@@ -50,4 +50,7 @@ MyStackViewPage {
} }
} }
} }
Connections {
target: OverlayController
}
} }
@@ -92,13 +92,13 @@ GroupBox {
Connections { Connections {
target: SteamVRTabController target: SteamVRTabController
onCameraActiveChanged: { function onCameraActiveChanged() {
steamvrCameraActiveToggle.checked = SteamVRTabController.cameraActive steamvrCameraActiveToggle.checked = SteamVRTabController.cameraActive
} }
onCameraContChanged: { function onCameraContChanged() {
steamvrCameraContToggle.checked = SteamVRTabController.cameraCont steamvrCameraContToggle.checked = SteamVRTabController.cameraCont
} }
onCameraBoundsChanged: { function onCameraBoundsChanged() {
steamvrCameraBoundsToggle.checked = SteamVRTabController.cameraBounds steamvrCameraBoundsToggle.checked = SteamVRTabController.cameraBounds
} }
@@ -2,7 +2,7 @@ import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Controls 2.5 import QtQuick.Controls 2.5
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs
import ovras.advsettings 1.0 import ovras.advsettings 1.0
import "." // QTBUG-34418, singletons require explicit import to load qmldir file import "." // QTBUG-34418, singletons require explicit import to load qmldir file
import "../../common" import "../../common"
@@ -185,11 +185,11 @@ MyStackViewPage {
} }
Connections{ Connections{
target: SteamVRTabController target: SteamVRTabController
onPairStatusChanged: { function onPairStatusChanged() {
statusText.text = value; statusText.text = value;
getRXTX() getRXTX()
} }
onUpdateRXTX:{ function onUpdateRXTX(){
getRXTX() getRXTX()
} }
@@ -130,7 +130,7 @@ GroupBox {
Connections { Connections {
target: SteamVRTabController target: SteamVRTabController
onPerformanceGraphChanged:{ function onPerformanceGraphChanged() {
steamvrBindingToggle.checked = SteamVRTabController.perAppBindEnabled steamvrBindingToggle.checked = SteamVRTabController.perAppBindEnabled
} }
@@ -131,25 +131,25 @@ GroupBox {
Connections { Connections {
target: SteamVRTabController target: SteamVRTabController
onPerformanceGraphChanged:{ function onPerformanceGraphChanged(){
steamvrPerformanceGraphToggle.checked = SteamVRTabController.performanceGraph steamvrPerformanceGraphToggle.checked = SteamVRTabController.performanceGraph
} }
onSystemButtonChanged:{ function onSystemButtonChanged(){
steamvrSystemButtonToggle.checked = SteamVRTabController.systemButton steamvrSystemButtonToggle.checked = SteamVRTabController.systemButton
} }
onMultipleDriverChanged:{ function onMultipleDriverChanged(){
steamvrMultipleDriverToggle.checked = SteamVRTabController.multipleDriver steamvrMultipleDriverToggle.checked = SteamVRTabController.multipleDriver
} }
onNoFadeToGridChanged:{ function onNoFadeToGridChanged(){
steamvrNoFadeToGridToggle.checked = SteamVRTabController.noFadeToGrid steamvrNoFadeToGridToggle.checked = SteamVRTabController.noFadeToGrid
} }
onDNDChanged:{ function onDNDChanged(){
steamvrNotificationToggle.checked = SteamVRTabController.dnd steamvrNotificationToggle.checked = SteamVRTabController.dnd
} }
onNoHMDChanged:{ function onNoHMDChanged(){
steamvrNoHMDToggle.checked = SteamVRTabController.noHMD steamvrNoHMDToggle.checked = SteamVRTabController.noHMD
} }
onControllerPowerChanged:{ function onControllerPowerChanged(){
steamvrControllerPowerToggle.checked = SteamVRTabController.controllerPower steamvrControllerPowerToggle.checked = SteamVRTabController.controllerPower
} }
@@ -103,10 +103,10 @@ GroupBox {
} }
Connections { Connections {
target: VrAlarm target: VrAlarm
onAlarmEnabledChanged: { function onAlarmEnabledChanged() {
alarmClockToggle.checked = VrAlarm.alarmEnabled alarmClockToggle.checked = VrAlarm.alarmEnabled
} }
onAlarmTimeChanged: { function onAlarmTimeChanged() {
alarmClockTimeAssembly.changeTimer(VrAlarm.getAlarmHour(), alarmClockTimeAssembly.changeTimer(VrAlarm.getAlarmHour(),
VrAlarm.getAlarmMinute(), VrAlarm.getAlarmMinute(),
VrAlarm.getAlarmSecond()) VrAlarm.getAlarmSecond())
@@ -45,7 +45,7 @@ GroupBox {
} }
Connections { Connections {
target: OverlayController target: OverlayController
onKeyBoardInputSignal: { function onKeyBoardInputSignal() {
if (userValue == 601) { if (userValue == 601) {
UtilitiesTabController.sendKeyboardInput(input) UtilitiesTabController.sendKeyboardInput(input)
} }
@@ -581,7 +581,7 @@ GroupBox {
} }
Connections { Connections {
target: UtilitiesTabController target: UtilitiesTabController
onVrcDebugChanged: { function onVrcDebugChanged() {
vrcDebugRow.visible = UtilitiesTabController.vrcDebug vrcDebugRow.visible = UtilitiesTabController.vrcDebug
} }
} }
@@ -25,10 +25,10 @@ GroupBox {
} }
RowLayout { RowLayout {
property string playPauseButtonPath: "qrc:/media_keys/play_pause" property string playPauseButtonPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/media_keys/outline_play_pause_white_24dp.svg"
property string stopButtonPath: "qrc:/media_keys/stop" property string stopButtonPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/media_keys/outline_stop_white_24dp.svg"
property string previousButtonPath: "qrc:/media_keys/previous" property string previousButtonPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/media_keys/outline_skip_previous_white_24dp.svg"
property string nextButtonPath: "qrc:/media_keys/next" property string nextButtonPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/media_keys/outline_skip_next_white_24dp.svg"
MediaButton { MediaButton {
id: previousSongButton id: previousSongButton
+1 -1
View File
@@ -53,7 +53,7 @@ GroupBox {
Connections { Connections {
target: UtilitiesTabController target: UtilitiesTabController
onTrackerOvlEnabledChanged:{ function onTrackerOvlEnabledChanged(){
trackerOvlToggle.checked = UtilitiesTabController.trackerOvlEnabled trackerOvlToggle.checked = UtilitiesTabController.trackerOvlEnabled
} }
+1 -1
View File
@@ -47,7 +47,7 @@ MyStackViewPage {
Connections { Connections {
target: VideoTabController target: VideoTabController
onIsOverlayMethodActiveChanged:{ function onIsOverlayMethodActiveChanged(){
overlayMethodGroupBox.visible = VideoTabController.isOverlayMethodActive overlayMethodGroupBox.visible = VideoTabController.isOverlayMethodActive
brightnessGroupBox.visible = !(VideoTabController.isOverlayMethodActive); brightnessGroupBox.visible = !(VideoTabController.isOverlayMethodActive);
colorGroupBox.visible = !(VideoTabController.isOverlayMethodActive); colorGroupBox.visible = !(VideoTabController.isOverlayMethodActive);
@@ -95,12 +95,12 @@ GroupBox {
Connections { Connections {
target: VideoTabController target: VideoTabController
onBrightnessOpacityValueChanged: { function onBrightnessOpacityValueChanged() {
var brightvalue = VideoTabController.brightnessOpacityValue var brightvalue = VideoTabController.brightnessOpacityValue
brightnessSlider.value = brightvalue brightnessSlider.value = brightvalue
brightnessValueText.text = Math.round(brightvalue*100)+ "%" brightnessValueText.text = Math.round(brightvalue*100)+ "%"
} }
onBrightnessEnabledChanged: { function onBrightnessEnabledChanged() {
brightnessToggle.checked = VideoTabController.brightnessEnabled brightnessToggle.checked = VideoTabController.brightnessEnabled
} }
} }
@@ -197,17 +197,17 @@ GroupBox {
Connections { Connections {
target: VideoTabController target: VideoTabController
onColorRedChanged:{ function onColorRedChanged(){
var redValue = VideoTabController.colorRed var redValue = VideoTabController.colorRed
colorRedText.text = Math.round(redValue * 100) + "%" colorRedText.text = Math.round(redValue * 100) + "%"
colorRedSlider.value = redValue colorRedSlider.value = redValue
} }
onColorGreenChanged:{ function onColorGreenChanged(){
var greenValue = VideoTabController.colorGreen var greenValue = VideoTabController.colorGreen
colorGreenText.text = Math.round(greenValue * 100) + "%" colorGreenText.text = Math.round(greenValue * 100) + "%"
colorGreenSlider.value = greenValue colorGreenSlider.value = greenValue
} }
onColorBlueChanged:{ function onColorBlueChanged(){
var blueValue = VideoTabController.colorBlue var blueValue = VideoTabController.colorBlue
colorBlueText.text = Math.round(blueValue * 100) + "%" colorBlueText.text = Math.round(blueValue * 100) + "%"
colorBlueSlider.value = blueValue colorBlueSlider.value = blueValue
@@ -73,14 +73,14 @@ GroupBox {
Connections { Connections {
target: VideoTabController target: VideoTabController
onAllowSupersampleFilteringChanged: { function onAllowSupersampleFilteringChanged() {
videoAllowSupersampleFilteringToggle.checked = VideoTabController.allowSupersampleFiltering videoAllowSupersampleFilteringToggle.checked = VideoTabController.allowSupersampleFiltering
} }
onMotionSmoothingChanged: { function onMotionSmoothingChanged() {
videoMotionSmoothingToggle.checked = VideoTabController.motionSmoothing videoMotionSmoothingToggle.checked = VideoTabController.motionSmoothing
} }
onIsOverlayMethodActiveChanged:{ function onIsOverlayMethodActiveChanged(){
videoUseOverlayToggle.checked = VideoTabController.isOverlayMethodActive videoUseOverlayToggle.checked = VideoTabController.isOverlayMethodActive
} }
@@ -298,32 +298,33 @@ GroupBox {
Connections { Connections {
target: VideoTabController target: VideoTabController
onBrightnessOpacityValueChanged: { function onBrightnessOpacityValueChanged() {
var brightvalue = VideoTabController.brightnessOpacityValue var brightvalue = VideoTabController.brightnessOpacityValue
brightnessSlider.value = brightvalue brightnessSlider.value = brightvalue
brightnessValueText.text = Math.round(brightvalue*100)+ "%" brightnessValueText.text = Math.round(brightvalue*100)+ "%"
brightnessSlider.value = VideoTabController.brightnessOpacityValue
} }
onBrightnessEnabledChanged: { function onBrightnessEnabledChanged() {
brightnessToggle.checked = VideoTabController.brightnessEnabled brightnessToggle.checked = VideoTabController.brightnessEnabled
} }
onColorOverlayOpacityChanged:{ function onColorOverlayOpacityChanged(){
opacitySlider.value = VideoTabController.colorOverlayOpacity opacitySlider.value = VideoTabController.colorOverlayOpacity
} }
onColorOverlayEnabledChanged:{ function onColorOverlayEnabledChanged(){
colorToggle.checked = VideoTabController.colorOverlayEnabled colorToggle.checked = VideoTabController.colorOverlayEnabled
} }
onColorRedChanged:{ function onColorRedChanged(){
var redValue = VideoTabController.colorRed var redValue = VideoTabController.colorRed
colorRedText.text = Math.round(redValue * 100) + "%" colorRedText.text = Math.round(redValue * 100) + "%"
colorRedSlider.value = redValue colorRedSlider.value = redValue
} }
onColorGreenChanged:{ function onColorGreenChanged(){
var greenValue = VideoTabController.colorGreen var greenValue = VideoTabController.colorGreen
colorGreenText.text = Math.round(greenValue * 100) + "%" colorGreenText.text = Math.round(greenValue * 100) + "%"
colorGreenSlider.value = greenValue colorGreenSlider.value = greenValue
} }
onColorBlueChanged:{ function onColorBlueChanged(){
var blueValue = VideoTabController.colorBlue var blueValue = VideoTabController.colorBlue
colorBlueText.text = Math.round(blueValue * 100) + "%" colorBlueText.text = Math.round(blueValue * 100) + "%"
colorBlueSlider.value = blueValue colorBlueSlider.value = blueValue
@@ -108,10 +108,10 @@ GroupBox {
} }
Connections { Connections {
target: VideoTabController target: VideoTabController
onVideoProfilesUpdated: { function onVideoProfilesUpdated() {
reloadVideoProfiles() reloadVideoProfiles()
} }
onVideoProfileAdded: { function onVideoProfileAdded() {
videoProfileComboBox.currentIndex = VideoTabController.getVideoProfileCount() videoProfileComboBox.currentIndex = VideoTabController.getVideoProfileCount()
} }
@@ -133,12 +133,12 @@ GroupBox {
Connections { Connections {
target: VideoTabController target: VideoTabController
onSuperSamplingChanged: { function onSuperSamplingChanged() {
var s1 = VideoTabController.superSampling var s1 = VideoTabController.superSampling
videoSupersamplingSlider.value = s1 videoSupersamplingSlider.value = s1
videoSupersamplingText.text = s1.toFixed(2) videoSupersamplingText.text = s1.toFixed(2)
} }
onAllowSupersampleOverrideChanged: { function onAllowSupersampleOverrideChanged() {
videoAllowSupersampleOverrideToggle.checked = VideoTabController.allowSupersampleOverride videoAllowSupersampleOverrideToggle.checked = VideoTabController.allowSupersampleOverride
var s1 = VideoTabController.superSampling var s1 = VideoTabController.superSampling
videoSupersamplingSlider.value = s1 videoSupersamplingSlider.value = s1
+116 -1
View File
@@ -1,11 +1,92 @@
<!DOCTYPE RCC><RCC version="1.0"> <RCC>
<qresource prefix="/qt">
<file>qml/ChaperoneWarningsPage.qml</file>
<file>qml/FixFloorPage.qml</file>
<file>qml/PlayspacePage.qml</file>
<file>qml/RootPage.qml</file>
<file>qml/SettingsPage.qml</file>
<file>qml/StatisticsPage.qml</file>
<file>qml/audio_page/AudioPage.qml</file>
<file>qml/audio_page/device_selector/AudioDeviceSelector.qml</file>
<file>qml/audio_page/device_selector/MicDeviceSelector.qml</file>
<file>qml/audio_page/device_selector/MicVolumeSlider.qml</file>
<file>qml/audio_page/device_selector/MirrorDeviceSelector.qml</file>
<file>qml/audio_page/device_selector/MirrorVolumeSlider.qml</file>
<file>qml/audio_page/dialog_boxes/AudioDeleteProfileDialog.qml</file>
<file>qml/audio_page/dialog_boxes/AudioMessageDialog.qml</file>
<file>qml/audio_page/dialog_boxes/AudioNewProfileDialog.qml</file>
<file>qml/audio_page/profiles/ProfileButtons.qml</file>
<file>qml/audio_page/proximity/ProximityToggle.qml</file>
<file>qml/audio_page/push_to_talk/PttButtons.qml</file>
<file>qml/chaperone_page/ChaperonePage.qml</file>
<file>qml/chaperone_page/change_orientation/ChangeOrientationGroupBox.qml</file>
<file>qml/chaperone_page/chaperone_additional/ChaperoneAdditionalPage.qml</file>
<file>qml/chaperone_page/chaperone_additional/chaperoneboundscolor/ChaperoneBoundsColorGroupBox.qml</file>
<file>qml/chaperone_page/chaperone_additional/chaperonemisc/ChaperoneMiscGroupBox.qml</file>
<file>qml/chaperone_page/chaperone_additional/chaperonetype/ChaperoneTypeGroupBox.qml</file>
<file>qml/common/FullWidthSliderBox.qml</file>
<file>qml/common/HourComboBox.qml</file>
<file>qml/common/LineSeparator.qml</file>
<file>qml/common/mainwidget.qml</file>
<file>qml/common/MinuteSecondComboBox.qml</file>
<file>qml/common/MyComboBox.qml</file>
<file>qml/common/MyDialogOkCancelPopup.qml</file>
<file>qml/common/MyDialogOkPopup.qml</file>
<file>qml/common/MyPushButton.qml</file>
<file>qml/common/MyPushButton2.qml</file>
<file>qml/common/MyRadioButton.qml</file>
<file>qml/common/MyResources.qml</file>
<file>qml/common/MySlider.qml</file>
<file>qml/common/MyStackViewPage.qml</file>
<file>qml/common/MyText.qml</file>
<file>qml/common/MyTextField.qml</file>
<file>qml/common/MyToggleButton.qml</file>
<file>qml/common/TimeAssembly.qml</file>
<file>qml/motion_page/MotionPage.qml</file>
<file>qml/motion_page/gravity/GravityGroupBox.qml</file>
<file>qml/motion_page/height_toggle/HeightToggleGroupBox.qml</file>
<file>qml/motion_page/space_drag/SpaceDragGroupBox.qml</file>
<file>qml/rotation_page/RotationPage.qml</file>
<file>qml/rotation_page/redirected/AutoTurnGroupBox.qml</file>
<file>qml/rotation_page/redirected/RedirectedGroupBox.qml</file>
<file>qml/rotation_page/snap_turn/SnapTurnGroupBox.qml</file>
<file>qml/rotation_page/space_turn/SpaceTurnGroupBox.qml</file>
<file>qml/rotation_page/view_ratchet/ViewRatchetGroupBox.qml</file>
<file>qml/steamvr_page/SteamVRPage.qml</file>
<file>qml/steamvr_page/camera/CameraGroupBox.qml</file>
<file>qml/steamvr_page/steamvrbind/SteamVRBindGroupBox.qml</file>
<file>qml/steamvr_page/steamvrmisc/SteamVRMiscGroupBox.qml</file>
<file>qml/steamvr_page/steamvr_additional/SteamVRTXRXPage.qml</file>
<file>qml/utilities_page/UtilitiesPage.qml</file>
<file>qml/utilities_page/alarm_clock/AlarmGroupBox.qml</file>
<file>qml/utilities_page/keyboard_utils/KeyboardGroupBox.qml</file>
<file>qml/utilities_page/media_keys/MediaButton.qml</file>
<file>qml/utilities_page/media_keys/MediaControllerKeys.qml</file>
<file>qml/utilities_page/misc/MiscBox.qml</file>
<file>qml/video_page/VideoPage.qml</file>
<file>qml/video_page/brightness/BrightnessGroupBox.qml</file>
<file>qml/video_page/color/ColorGroupBox.qml</file>
<file>qml/video_page/dialogboxes/VideoDeleteProfileDialog.qml</file>
<file>qml/video_page/dialogboxes/VideoMessageDialog.qml</file>
<file>qml/video_page/dialogboxes/VideoNewProfileDialog.qml</file>
<file>qml/video_page/miscvid/VideoMiscGroupBox.qml</file>
<file>qml/video_page/overlaycolorbright/OverlayMethodGroupBox.qml</file>
<file>qml/video_page/profiles/VideoProfileGroupBox.qml</file>
<file>qml/video_page/supersampling/SuperSamplingGroupBox.qml</file>
</qresource>
<qresource prefix="/common"> <qresource prefix="/common">
<file alias="backarrow">img/common/backarrow.svg</file> <file alias="backarrow">img/common/backarrow.svg</file>
<file alias="box_checkmark">img/common/check.svg</file> <file alias="box_checkmark">img/common/check.svg</file>
</qresource> </qresource>
<qresource prefix="/icons">
<file alias="thumbicon.png">img/icons/thumbicon.png</file>
</qresource>
<qresource prefix="/microphone"> <qresource prefix="/microphone">
<file alias="on">img/audio/microphone/mic_on.svg</file> <file alias="on">img/audio/microphone/mic_on.svg</file>
<file alias="off">img/audio/microphone/mic_off.svg</file> <file alias="off">img/audio/microphone/mic_off.svg</file>
<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>
<qresource prefix="/speaker"> <qresource prefix="/speaker">
<file alias="on">img/audio/speaker/speaker_on.svg</file> <file alias="on">img/audio/speaker/speaker_on.svg</file>
@@ -31,4 +112,38 @@
<file alias="video_tab_icon">img/main_menu_icons/video_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> <file alias="rotation_tab_icon">img/main_menu_icons/rotation_tab_icon.svg</file>
</qresource> </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>
<qresource prefix="/alarm">
<file alias="alarm_activated.png">img/alarm/alarm_activated.png</file>
</qresource>
</RCC> </RCC>
+3 -2
View File
@@ -2,7 +2,8 @@
#include <assert.h> #include <assert.h>
#include <array> #include <array>
#include <vector> #include <vector>
#include <easylogging++.h> #include <QtLogging>
#include <QtDebug>
#include "../settings.h" #include "../settings.h"
#include "setting_value.h" #include "setting_value.h"
#include "../../utils/setup.h" #include "../../utils/setup.h"
@@ -64,7 +65,7 @@ void verifySettings( std::array<Value, ArraySize> v ) noexcept
const auto enumSettingNumber = static_cast<int>( currentSetting ); const auto enumSettingNumber = static_cast<int>( currentSetting );
LOG( ERROR ) << enumName << ": at index '" << settingIndex qCritical() << enumName << ": at index '" << settingIndex
<< "' is incorrect. Current value: '" << "' is incorrect. Current value: '"
<< enumSettingNumber << enumSettingNumber
<< "'. Exiting " << "'. Exiting "
@@ -1,6 +1,5 @@
#pragma once #pragma once
#include <list> #include <list>
#include <easylogging++.h>
namespace settings namespace settings
{ {

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