* Added Manual Override Checkbox
* added profile logic/synch fixed bug with profile
* Added Function definitions + re-arranged code into more logical blocks
* formatting and fixed reset function in steamvrtabcontroler
* updated documentation
* removed some comments(for later standardization), params as const (where applicable), changed SS minimum value to .2 to match with steamVR minimum
* changed c style cast to c++
* re-applied formatting
* removed un-used lines in steamvrtabcontroller.h
.pngs were chosen because the .svgs were only available in black. Qt
currently does not have an easy way of changing colors. The rest of the
interface icons are white, so getting them in white was necessary.
The sendKeyboardBackspace function was used with a non-const parameter
throughout the entire inheritance hierachy. Const has been added to
every parameter for the reasons you add const.
The original functions had the API details of sending keys absolutely
correct, but they were cumbersome to use due to not abstracting away the
press and release aspect and manual creation of INPUT structs.
The manual management of objects also saved a few operations, but with
the frequency that these functions are called it's probably better to
have more abstract code than preventing a 28 byte object from being stack
copied twice every 2 seconds or so.
When audio devices connected or disconnected from the system, the default audio device swapped around. This was because of QML setting index 0 on ComboBox.model changes. onCurrentIndexChanged was calling setPlaybackDeviceIndex() / mirrorDevice/ micDevice etc... in the audio tab controller and actively setting the audio device index to 0 momentarily. Changing onCurrentIndexChanged to onActivated allows the ComboBox to only actively command the audio tab controller in direct response to user interaction.
* Update OpenVR from an unknown version to 1.1.3b
There shouldn't be any breaking changes.
* Add removed variables from old OpenVR version
The strings are the names of variables in steamvr.vrsettings in
C:\Program Files
(x86)\Steam\steamapps\common\SteamVR\resources\settings\
The string allowReprojection leads to warning log spam on some
occasions.
For more information see this github issue
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/25.
* Move logging set up into own function
This does not affect the ability to log, the logging macros are
available globally.
* Clean up logging logic and add comments
The logic to find the logging location was broken, in that it always
placed the logs in the directory of the executable.
It was supposed to place the logs in
AppData/Roaming/matzman666/OpenVRAdvancedSettings/AdvancedSettings.log,
but it hasn't done this since at least git tag "v2.7". Since the change
hasn't been documented anywhere it is assumed to be an unintentional
regression.
The settings file is also currently placed in
AppData/Roaming/matzman666/OpenVRAdvancedSettings.ini, so this commit
undoes the probable regression until a strategy can be developed for
changing all paths at once.
* Move command line arg logging calls and add to manifest calls
The LOG_IF macros are cleaner than if blocks, and they do not need to be
in the middle of the Qt logic inside a giant try block.
* Remove unused QCoreApplication constructor in manifest logic
The object is not used in any of the manifest logic functions and
running without the remove/install manifest calls does not use it
either.
* Unindent logic in installManifest
The error checking was unnecessarily done in an else block. Moving it
into an if block and negating the result does the same but leaves the
rest of the logic at a much smaller indentation level.
* Change array in installManifest to be 0 intialized
Not zero initializing could lead to strange bugs if the terminating null
isn't there.
* Move manifest install/removal to separate function
The manifest handling is tangential to the actual main operation of the
program, hence moving it to a separate function improves readability of
the actual program.
The enum ReturnErrorCode has also been moved to the top in order to be
available to all functions. On introspection it is revealed that it
should always have been placed at the top.
* Unindent logic in removeManifest
The logic is unnecessarily indented, leading to harder to follow logic.
While the current logic isn't that hard to understand, it's better if it
follows the same rhythm as installManifest, which errors checks the same
way with a !QFile::exists( manifestQPath ).
* Move manifestPath out of install/removeManifest
Moving the variable outside of the functions reduces code duplication
and increases the versatility of the functions.
Variable was renamed from manifestQPath to manifestPath, because the Q
does not add anything to the name except (maybe wrongfully in the
future) typing a variable that has been typed with 'auto'.
The default variable has been removed, as it did not improve readability
at all.
* Rename installManifest to handleManifestInstallLogic
The new name better reflects the overall purpose. installManifest should
be a function that only installs the manifest.
* Move manifest related things into manifest namespace
* Move manifestInstallation logic into functions
The logic becomes clearer when replaced by function names instead of
just blocks of error checking.
* Refactor installManifest into separate functions
The uses for the removeManifest and installManifest functions could be
boiled down to three separate use cases:
* If the application was passed the "-installmanifest" arg:
Reinstall the manifest and enable application autostart.
* If the application was passed thed "-removemanifest" arg:
Remove the manifest.
* If the application was not passed "-desktop" and also not passed
"-nomanifest" (basically every start):
Install the manifest.
Where reinstalling means to remove the manifest if installed and then
install it.
The relatively complex logic in installManifest hid this logic behind
several if statements and changing what the "alreadyInstalled" bool
signified.
The refactored functions should make everything easier to understand.
* Add variable for manifest name
* Rename variables in main to camelCase
This appears to be the style chosen for the majority of the project.
* Change cerr to be LOG(ERROR) and add logging for manifest completion
The cerr calls are not likely to be seen by anybody. Logging them as
ERROR will make sure they are available for diagnostics.
* Add comments for new manifest functions
* Reorder namespaces and functions in main
Namespaces and functions are now ordered as they appear in main.
* Add static_cast to height and width in func call in main
width and height are "qreal" (typedef for double). Having them
implicitly cast to int leads to warnings on some compilers, and can lead
to doubt whether they're supposed to be converted.
* Move organizationName and applicationName into overlaycontroller.h
The string have been moved to static constexpr autos inside the
overlaycontroller.
Them remaining static means that they are included in the final binary,
even if they don't need to be included as static.
They should probably also not be directly gotten, instead being offered
up as static getters, but it's better to do them all at the same time in
a specific commit for that.
* Add comment to installApplicationManifest
Describing that OpenVR must be initialized before the function is
called.
* Change QApplication var name and add comments
The previous QApplication was named "a". This is obviously not
sufficient for such a large part of the application, even if the class
is rather boilerplate heavy.
* Add comments to Qt portions of main
Some things have been left uncommented. That's because I don't know what
it does.
* Change documentation for command line arguments, logging config
The information under the Desktop Mode header could be rolled under the
"-desktop" command line arg.
Support for the command line args of Easylogging++ and custom logging
files have not been supported for the original developer. Both should
probably be dropped in favor of having the same logging behavior for all
users.
* Remove error causing property from QML MyStackViewPage and PlayspacePage
The properties were causing an error message to be spammed in the log
QML QQuickText: Detected anchors on an item that is managed by a layout.
This is undefined behavior; use Layout.alignment instead.
and
QML RowLayout: Detected anchors on an item that is managed by a layout.
This is undefined behavior; use Layout.alignment instead.
Removing them fixed the spam and didn't noticeably change the appearance
of the pages.
The additional files packaged with the installer have been moved to
their own dir to separate them from the C++ source.
All licenses are now also included in the installer, as per the terms.
The version string in overlaycontroller.h has been updated to 2.8.0.
Update logging dependency from 9.84 to 9.89
This is the newest version that doesn't lead to compile errors. It has
also reduced the amount of "-Wexpansion-to-defined" errors on clang-msvc
by about 80 (from ~400 to 320).
Update easylogging license file
Originally came as LICENCE.txt (notice C instead of S in LICENSE),
renamed to better fit into the git history.
Move logging defines to QMAKE instead of logging.h
Defines done outside of easylogging++.h does not work according to
official documentation
(https://github.com/zuhd-org/easyloggingpp/blob/master/README.md#configuration-macros)
"NOTE: All the macros can be defined in one of the following ways:
1. Define macros using -D option of compiler, for example in case of
g++ you will do g++ source.cpp ... -DELPP_SYSLOG -DELPP_THREAD_SAFE
... (recommended way)
2. Define macros inside "easylogging++.h" (defining macros in other
files won't work)"
Linking to this issue:
https://github.com/zuhd-org/easyloggingpp/issues/590#issuecomment-346753951
We are using the developer recommended way of defining them by command
line.
What is assumed to be the intention of enabling debug logs before
including easylogging++ never actually did anything, hence this define
is dropped. Newer versions of easylogging++ uses the macro
ELPP_DISABLE_DEBUG_LOGS to _disable_ debug logs. Leaving that macro
undefined satisfies the original intent.
Move easylogging++ include into necessary files
logging.h previously had logic to enable debug logging even on release
builds. This logic was moved to the QMAKE file, hence the logging.h file
is no longer necessary.
Update easylogging++ to 9.96.7, turn on /WX for clang-msvc
Updating from easylogging++ 9.89 to 9.96.7 turns it from a header only
library to one requiring a source file. It has been added to sources
near the other third party includes in the QMAKE to signify that it
isn't a first party file.
Updating easylogging++ also means that clang-msvc can compile without
any warnings, hence turning on warnings as errors for that compiler as
well, to avoid any regressions.
updated to current
fixed formatting
fixed ptt add bug/compilerwarnings/c++14 target
cleaned up .pro file
fixed casting back to c++ style
added default profile and ptt profile view
fixed c++ casts
fixed logic error on getDevice functions
logging.h previously had logic to enable debug logging even on release
builds. This logic was moved to the QMAKE file, hence the logging.h file
is no longer necessary.
Defines done outside of easylogging++.h does not work according to
official documentation
(https://github.com/zuhd-org/easyloggingpp/blob/master/README.md#configuration-macros)
"NOTE: All the macros can be defined in one of the following ways:
1. Define macros using -D option of compiler, for example in case of
g++ you will do g++ source.cpp ... -DELPP_SYSLOG -DELPP_THREAD_SAFE
... (recommended way)
2. Define macros inside "easylogging++.h" (defining macros in other
files won't work)"
Linking to this issue:
https://github.com/zuhd-org/easyloggingpp/issues/590#issuecomment-346753951
We are using the developer recommended way of defining them by command
line.
What is assumed to be the intention of enabling debug logs before
including easylogging++ never actually did anything, hence this define
is dropped. Newer versions of easylogging++ uses the macro
ELPP_DISABLE_DEBUG_LOGS to _disable_ debug logs. Leaving that macro
undefined satisfies the original intent.
Notice that the class has an identical var that is used in several
places. It is unknown if the original programmer intended to use the
member var in this function, but what is actually being done is a new
var being created, changed and returned. This may not respect the
original intention, but it does preserve the original mechanics.
Parameters with the same name as class members are ripe for introducing
bugs. The fact that the "this->" syntax is optional creates confusion
for maintaining programmers who can only guess at the intention.
Casting to void should shut up GCC about
error: statement has no effect [-Werror=unused-value]
static_cast<void>() is possible for all current types. Supposedly an old
C style cast could also be used, but they should not be used in modern
C++ code.
GCC gave error
../src/tabcontrollers/MoveCenterTabController.cpp:57:67: error:
operation on
‘((advsettings::MoveCenterTabController*)this)->advsettings::MoveCenterTabController::lastMoveButtonClick[0]’
may be undefined [-Werror=sequence-point]
Because assigning a value to itself twice is undefined behavior. It is
highly likely that intended behavior was to initialize both array
members to the same value at once.
Mostly casts and unsigned to signed comparisons.
Testing to ensure that the int isn't below 0. If it is, it can't be used
in the array later anyway. After we're sure it isn't below 0 it's safe
to static_cast<size_t>().