Commit Graph
100 Commits
Author SHA1 Message Date
username223 ba5e19d34d Revert "Add dedicated image for CircleCI builds" (#594)
* Revert "Add dedicated image for CircleCI builds"

This reverts commit 44a5d3eed0.

With how little we use the Docker hub features it does not make sense to
have external dependencies on it.

* Add `qt512websockets` to CI build

This is necessary for Ykeara's feature branch.
2022-04-01 19:22:07 -05:00
Vasily Utkin 522ba46ac6 Add qt5-quickcontrols package to required for Arch 2021-12-30 16:41:53 +01:00
Vasily Utkin 3ab10ce334 Update easylogging++ from 9.96.7 to 9.97.0
Easylogging++ forgot to update the version number at the top of their
header files. Oops.
2021-01-01 23:28:19 +01:00
Vasily Utkin 5a7fe687d8 Remove warnings-as-errors by default
Compiling C++ on various different platforms with as many out of tree
dependencies as we have is volatile at best.
In order to prevent a third party warning from ruining the build for
people who don't care about third party warnings, we remove
warnings-as-errors by default.
They are still enabled by default on CI.
2021-01-01 23:28:19 +01:00
Vasily Utkin 44a5d3eed0 Add dedicated image for CircleCI builds
This essentially just bakes in all the dependencies and other third
party tools that we need, preventing them from being downloaded on every
new CI run.

TravisCI does not have non-enterprise support for custom images without
a lot of hassle.
2021-01-01 23:28:19 +01:00
Vasily b12f5f8b34 Add X-AppImage-Integrate=false to second .desktop file
`qtdeploylinux` apparently caches the .desktop file, so we need to
change both of them.
2020-07-02 19:15:36 +02:00
Vasily 3857c2ac2f Refactor update rates of tab controllers
Previous way of controlling when controllers were run was split among
the different controllers, meaning that third parties would require
knowledge of internal state of controllers in order to be on the same
update schedule as them.

This refactor moves the logic into a seperate class.

Additionally, it also stops the use of the `adjustUpdateRate` function
on all tab controllers, since it broke the prime-number-ability of
less collisions.
2020-06-06 20:53:34 +02:00
Vasily 4757756d32 Refactor alarm system and replace notification method
The old OpenVR overlays did not function for unknown reasons, and it was
not possible to get them to work.

With this a white overlay with ALARM ACTIVATED will be shown for 3 seconds.
It's not pretty, but it effectively communicates that an alarm has been
activated.

This fixes
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/417
2020-06-05 20:52:13 +02:00
Vasily 4b94a4bd27 Fix chaperone profiles not loading correctly
Saving a profile with only visibility changed, the saved struct looks
like
bools\1\bools=false
bools\2\bools=true
bools\3\bools=false
bools\4\bools=false

The load function expects 2 bool values before loading
`includesVisibility`, leading it to getting a false value (actually
includesFadeDistance).

Making the struct save the `chaperoneGeometryQuadsValid` that it expects
to be saved there fixes the issue.

This bug highlights issues with the current object settings system, in
that debugging is unnecessarily tedious and difficult.
2020-05-31 08:50:48 +02:00
Vasily 410cbd65b9 Remove libxkbcommon-x11.so.0 from AppImage
Library caused segfaults on Ubuntu 20.04 when using the keyboard input
keys.
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/455
2020-05-31 08:50:48 +02:00
Vasily 81fef5e7ec Add exclution of libxcb-randr.so.0
This prevented the appimage from working on newer Manjaro versions.
It has also been tested on Debian Testing to still work there.
2020-05-20 11:57:43 +02:00
Vasily 2ce911b5d8 Fix keyboard input bugs
Premade keyboard inputs that relied on multiple buttons were broken due
to no TOKEN_NO_KEYUP_NEXT.
2020-05-17 22:36:35 +02:00
Vasily 9412c31e42 Refactor input_sender to have main logic be cross platform
Previously logic was duplicated for Linux/Windows.
Additionally, Linux was
```cpp
if ( isModifier( token ) )
{
    sendKeyPress( token, KeyStatus::Down, display );
    if ( noKeyUp )
    {
        heldInputs.push_back( token );
    }
    continue;
}
```
while Windows was
```cpp
if ( isModifier( token ) )
{
    inputs.push_back( createInputStruct(
                convertToVirtualKeycode( token ), KeyStatus::Down ) );
    if ( !noKeyUp )
    {
        heldInputs.push_back( token );
    }
    continue;
}
```
(notice difference in noKeyUp if statement which was a bug on Linux.
Windows was the correct version and it has been kept.
2020-05-17 22:36:35 +02:00
username223 31f92df4b1 Change Linux build docs
libpulse-dev does not exist on Manjaro.
2020-04-15 20:00:11 +02:00
username223 a1cae11256 Update docs for building on Ubuntu 2020-04-13 12:54:30 +02:00
Vasily f138e46ceb Add O3 flag to linker call for GCC 2020-04-12 00:52:31 +02:00
Vasily 799bc7d429 Add O3 to gcc linker
It is unknown if gcc uses the O3 optimization levels passed to the
compilation of individual cpp files, or if it needs O3 passed to the
linker as well.

The hash of the final binaries are different, thus O3 is passed to the
linker.
2020-04-12 00:52:31 +02:00
Vasily 8a315abb55 Disable LTO on Travis CI and change clang binary to clang++
Travis clang does not have the LLVMgold plugin installed.
Disabling LTO is easier than installing the plugin since the CI doesn't
create any artifacts anyway.
2020-04-12 00:52:31 +02:00
Vasily fa166b20d4 Add logging of Linux compiler version
Mainly for CI and third party logs.
2020-04-12 00:52:31 +02:00
Vasily 28b09e78f5 Update Linux compiler selection with linker
Qmake attempts to invoke the linker with the default `g++` binary even
when we changed the binary. This will compile error when using LTO.

For clang:
```
/usr/bin/ld.gold: error: /usr/lib/llvm-3.8/bin/../lib/LLVMgold.so: could
not load plugin library: /usr/lib/llvm-3.8/bin/../lib/LLVMgold.so:
cannot open shared object file: No such file or directory
```

For GCC:
```
lto1: fatal error: bytecode stream generated with LTO version 6.0
instead of the expected 4.1
```
2020-04-12 00:52:31 +02:00
Vasily 7202230de3 Increase compiler optimization for Linux
`optimize_full` is an undocumented config option that enables O3 on
Linux.

On Windows it does not change the command line, but the final build is
slightly different for unknown reasons.
2020-04-12 00:52:31 +02:00
Vasily f0e05bde25 Add link time optimization to clang/gcc builds
Using `-flto` on clang without using the gold linker produces the error:
```main.o: file not recognized: File format not recognized```
https://github.com/android/ndk/issues/242

`gold` seems to be faster than `ld`, and decently tested even in 2010:
https://stackoverflow.com/questions/3476093/replacing-ld-with-gold-any-experience

Qmake will still append `-Wl,-O1` even though higher optimization levels
are used. Removing this in order to keep the compile command as short as
possible, and to reduce weird issues down the line. Ref topic:
https://stackoverflow.com/questions/53384988/why-qmake-passes-wl-o1-to-gcc-when-linking-and-will-it-harm-lto
2020-04-12 00:52:31 +02:00
Vasily c34e6139ec Update Travis CI to Ubuntu 18.04
clang-format below version 8 wants a different formatting and would
error on the already existing codebase.
2020-04-12 00:52:31 +02:00
Vasily 9ff4863f3e Add branch filtering to all CI providers 2020-04-12 00:52:31 +02:00
Vasily bb30a7c041 Add framework for implementing Linux AudioManager
Source outputs must all be moved to new default source.
Reference topic
https://askubuntu.com/a/72076

* Adds microphone controls on Linux via PulseAudio (PA) for several
points in
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/43.

It can not be overstated how unsuited the public AudioManager API is for
using the PA API.

It can also not be overstated how undocumented and horrible the PA API
is. The PA way of doing audio is very unlike the Windows way of doing
audio, which the AudioManager is heavily influenced by.

Since I don't have a Linux machine I have not been able to personally
test this. https://github.com/feilen/ has graciously helped with
testing.

PulseAudio is very undocumented and not very widely used for what we
need outside of official utilities. As such there's most likely a better
way of doing things than I've done.
Additional information can be found at
https://github.com/username223/pulseaudio-device-changing.

The "complex" PA API is asynchronous. Since our current AudioManager is
running synchronously and would not work asynchronously (functions are
expected to return valid data on function return) it is necessary to
massage the PA API until it runs synchronously.

This is done with a general workflow of

1. Register a callback function (`pa_context_get_source_info_list()`,
        for example).
2. Run the PA loop through `customPulseLoop()`. This will trigger
any registered callbacks. Sometimes a `void*` is passed through the
callback that can be used for custom data. `successCallback()` uses
this to set the success variable.
3. Run the callback function and do required work.
4. Return to original function, do work or return values.

It is not possible to run a `customPulseLoop()` inside of an already
running loop (inside a callback), as this will lead to a PA assert
error on runtime.
2020-04-08 22:44:12 +02:00
Vasily 2db3b10421 Fix push to mute icon not being used when PTM enabled 2020-03-22 18:48:48 +01:00
Vasily b66fca6f28 Fix float comparison error for setBoundsVisibility
m_visibility was never being set due to m_visibility-m_visibility always
being 0.
2020-03-17 19:39:03 +01:00
Vasily a74b63f199 Fix off by one error when loading settings profiles 2020-03-17 19:39:03 +01:00
Vasily d88eb0f53b Add push to mute icon when using push to mute feature
The PTM icon was quickly made in mspaint and (in my opinion) adequately
reflects push to mute.

Fixes
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/342
2020-03-04 09:17:01 +01:00
Vasily 827d46e48b Add null check to AudioManagerWindow getDeviceName/Id
Windows was returning a nullptr on arbitrary devices, leading to a
SEGFAULT.

"INVALID-NAME" was chosen to be distinguishable from an empty string.
2020-01-30 10:36:21 +01:00
Vasily 7b9f7e6ff3 Explicitly disallow floats from object settings API
This is to incentivize the transfer from `float` to `double` throughout
the codebase.
2020-01-30 10:36:21 +01:00
Vasily eed01ed5a8 Remove unneeded QSettings functions and imports 2020-01-30 10:36:21 +01:00
Vasily 9d8e3ad3ef Add ChaperoneProfile to new settings object API
chaperoneGeometryQuads was converted from an implicit pointer array to a
std::vector because the only thing the pointer array did was hide the
fact that it was an array.
2020-01-30 10:36:21 +01:00
Vasily 2930ea6d4f Add VideoProfiles to new object settings API 2020-01-30 10:36:21 +01:00
Vasily 58b155da00 Remove unneeded QSettings usage in VideoTabController
Was a relic from when we didn't have a settings API.
2020-01-30 10:36:21 +01:00
Vasily 4bfe944461 Add OffsetProfiles to new object settings API 2020-01-30 10:36:21 +01:00
Vasily dcbf76cb0b Add audio profiles to new settings object API
Audio profiles are not currently activated due to SteamVR changes.

micVol has been changed to default initilize to 1.0f since that was
being applied in the settings load anyway.
2020-01-30 10:36:21 +01:00
Vasily a6eea3cd08 Add save/loadAllObjects to object settings API
Looping through the vectors was done for almost all vectors
individually. Because there are some weird off by one issues that could
crop up it's easier to just have a function for it.
2020-01-30 10:36:21 +01:00
Vasily bcbc32c812 Enable settings object to work with 'const char*' strings
Passing a C style string (const char*) to any of the templated functions
would lead to a compile error. It was necessary to wrap the raw string
in a std::string call, which is obviously not ideal.

Using automatic type deduction was necessary because `std::vector<const
char*` is not the same as `std::vector<std::string>`.
2020-01-30 10:36:21 +01:00
Vasily 15b4d17672 Change RootPage header title to OVR Advanced Settings 2020-01-30 10:36:21 +01:00
Vasily dbfb3d69f7 Update AudioManagerDummy function definitions 2020-01-18 00:17:28 +01:00
Vasily 0c7c888c82 Update OpenVR from 1.8.19 -> 1.9.16 and remove Sync() calls
Release log:
https://github.com/ValveSoftware/openvr/releases/tag/v1.9.16
```
Removed sync function. Saving of settings is controlled automatically by
the system now. All existing calls to Sync can be deleted. Calls to sync
using old APIs do nothing.
```
2020-01-18 00:17:28 +01:00
Vasily b6eaca6caa Change pair<string, string> to custom type in AudioTabController
Explicitly named fields are more readable.
2020-01-18 00:17:28 +01:00
Vasily af572ee0b7 Move AudioManager into audiomanager folder 2020-01-18 00:17:28 +01:00
Vasily 54cbdc545b Readd <memory> include in AudioTabController
Windows does not need this explicitly included, but CircleCI does.
2020-01-16 00:09:09 +01:00
Vasily b8488d318d Convert m_pttShowNotification to new settings API 2020-01-16 00:09:09 +01:00
Vasily d873e024ca Convert m_pttEnabled to new settings API 2020-01-16 00:09:09 +01:00
Vasily 7be55a2199 Move remaining PttController items into AudioTabController 2020-01-16 00:09:09 +01:00
Vasily ba4a19217d Remove unused PttProfile features from PttController
None of these features have been used since the introduction of the
SteamVR IVRInput interface sometime around the start of 2019.
2020-01-16 00:09:09 +01:00
Vasily 0bc77b2fd0 Completely remove features related to Desktop Overlay
As of SteamVR 1.10.1 the overlay width feature has been implemented by
Valve in the standard settings.
OpenVR features related to overlay translation have been removed and the
main reason for including them (multi monitor setups) have been solved
by Valve giving each screen an individual overlay.
2020-01-16 00:09:09 +01:00
Vasily ebc2d92333 Fix SEGFAULT when compiling with Qt 5.14.0
For unknown reasons this did not SEGFAULT with Qt<5.14.0.

Official Qt docs says that deleteLater is the preferred method
https://doc.qt.io/qt-5/qobject.html#deleteLater
2020-01-15 14:01:47 +01:00
Vasily 491671937a Remove warning C4242 from MSVC
Qt 5.14.0 introduces a new `qfloat16.h` file that spams this error, with
no way of ignoring it on MSVC.
2020-01-15 14:01:47 +01:00
Vasily 5c85551b9d Fix MSVC not copying files on Qt 5.14.0
For some unknown reason, the jump to Qt 5.14.0 broke the way we're using
the COPIES/file_copies function only on MSVC.
The `mkspecs/features/file_copies.prf` file itself has not been changed.
2020-01-15 14:01:47 +01:00
Vasily 016e5ebc4a Add switch for enabling debug symbols and logs
Enabling the switch on release builds will optimize the binaries as
normal, but will still include debug symbols. This is advantageous for
bugs that do not show up in debug builds without optimizations.
2020-01-15 14:01:47 +01:00
Vasily 5498424889 Add libudev0-shim to Manjaro TL;DR
OVRAS will runtime error without libudev.so.0, this package provides
that file.
2020-01-15 14:01:47 +01:00
Vasily ac4b01273e Add basic PKGBUILD for building on Arch/Manjaro
PKGBUILD format is described on the Arch wiki
https://wiki.archlinux.org/index.php/Creating_packages

Arch User Repository is described here
https://wiki.archlinux.org/index.php/Arch_User_Repository

The AUR package can be found here
https://aur.archlinux.org/packages/ovras/
2020-01-15 14:01:47 +01:00
Vasily 061506e5b4 Add documentation strings to settings_object.h
Further discussion in pull request
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/pull/347
2020-01-08 21:18:45 +01:00
Vasily a47d9e6ec9 Add settings object functions for deprecated values 2020-01-08 21:18:45 +01:00
Vasily 0a32f8c1fa Fix clang-format error on namespace in settings_object.cpp 2020-01-08 21:18:45 +01:00
Vasily c5c64cd66d Remove unneeded import in main 2020-01-08 21:18:45 +01:00
Vasily f1105d15a3 Remove unused QSettings imports 2020-01-08 21:18:45 +01:00
Vasily e71bc7b1b3 Add settings object API
Documentation is in `docs/specs/Settings-Object-API.md`.
2020-01-08 21:18:45 +01:00
Vasily bda3cc0aa2 Update docs for building for Manjaro 2020-01-07 23:31:48 +01:00
Vasily 70d5675119 Update Linux build docs with required SteamVR libraries
https://github.com/ValveSoftware/openvr/issues/549#issuecomment-570911998

Program would not run without `libSDL2-2.0.so.0` and `libvulkan.so.1`
adding the below packages solved the issue on both 1804 and 1910.
2020-01-07 23:31:48 +01:00
Vasily a21c42ef3d Update Linux build docs for 1604 and 1804 2020-01-07 23:31:48 +01:00
Vasily f315b8c182 Add qtchooser to Ubuntu 1904 TLDR 2020-01-07 23:31:48 +01:00
Vasily 7340a7468e Update TOC in building for linux 2020-01-07 23:31:48 +01:00
Vasily 01972546af Update Linux build docs with Git 2020-01-07 23:31:48 +01:00
Vasily 6cdb461af3 Update Qt version in Linux build docs to 5.12.6 2020-01-07 23:31:48 +01:00
Vasily 231b040e62 Update Readme table of contents
TOC created using the `github-markdown-toc` tool from
https://github.com/ekalinin/github-markdown-toc.
2020-01-07 23:31:48 +01:00
Vasily 26471454ef Update docs on Preview builds for Linux 2020-01-07 23:31:48 +01:00
Vasily 4afa87a91d Update Usage section of readme to include Linux 2020-01-07 23:31:48 +01:00
Vasily 752295fa63 Make currently used settings be printed out at application start
Due to the SettingsController being a static object it will be
initialized before the main method has been run. This will cause
easylogging to log using the default logging style instead of the
defined application style. Because of this the settings are propogated
up through a function into the main method.
2019-12-10 08:28:41 +01:00
Vasily 2f612f52ae Cache verified customMsTickRate
The `customTickRateMs()` function is being called every millisecond,
adding the verification to every call leads to unnecessary overhead.

The tick rate is verified when loading and when saving.
2019-12-10 08:28:41 +01:00
Vasily c2dff4c863 Move internal settings headers into /internal/ dir
The additional headers are not intended to be public. To reinforce that
it is a bad idea to include these they are put into the /internal/
directory.
2019-12-10 08:28:41 +01:00
Vasily 1465c4a8bd Convert getSettingsController() to global static object
After looking at the assembly output it became apparent that the Windows
compiler did not compile out the `getSettingsController()` function
call.

This led to an unnecessary function call in order to get the
SettingsController. Turning it into a static object in the compilation
unit scope removes this function call and turns getSettings call into a
single instruction (not counting zeroing the register for comparison and
the jump instruction afterwards).

----

Adding the following code to the `main` function:
```cpp
f ( settings::getSetting( settings::BoolSetting::UTILITY_vrcDebug ) )
{
        LOG( INFO ) << "Enabled";
}
else
{
        LOG( INFO ) << "Disabled";
}
```

Leads to this with the `getSettingsController` function:
```assembly
[...]
    47            if ( settings::getSetting( settings::BoolSetting::UTILITY_vrcDebug ) )
0x7ff6c96819a0  <+ 1024>         call AdvancedSettings!settings::getSettingsController (00007ff6`c96cd280)
0x7ff6c96819a5  <+ 1029>         xorps   xmm0,xmm0
0x7ff6c96819a8  <+ 1032>         cmp     byte ptr [rax+5FCh],0
0x7ff6c96819af  <+ 1039>         je AdvancedSettings!main+0x4fd (00007ff6`c9681a9d)
    49                LOG( INFO ) << "Enabled";
0x7ff6c96819b5  <+ 1045>         mov     qword ptr
[rsp+288h],r15
0x7ff6c96819bd  <+ 1053>         mov     qword ptr
[rsp+290h],rsi
[...]
```

And this without the function:
```assembly
[...]
    47            if ( settings::getSetting( settings::BoolSetting::UTILITY_vrcDebug ) )
0x7ff7d97a19bb  <+ 1019>         xorps   xmm0,xmm0
0x7ff7d97a19be  <+ 1022>         cmp     byte ptr [AdvancedSettings!settings::settingController+0x5fc (00007ff7`d9854d4c)],0
0x7ff7d97a19c5  <+ 1029>         je AdvancedSettings!main+0x4f3 (00007ff7`d97a1ab3)
    49                LOG( INFO ) << "Enabled";
0x7ff7d97a19cb  <+ 1035>         mov     qword ptr
[rsp+288h],r15
0x7ff7d97a19d3  <+ 1043>         mov     qword ptr
[rsp+290h],rsi
[...]
```

Notice the missing `call AdvancedSettings![...]` without the function
and that the settings call literally cannot be made any faster.
2019-12-10 08:28:41 +01:00
Vasily 7cecc6ab69 Convert m_isOverlayMethodActive to new settings API 2019-12-10 08:28:41 +01:00
Vasily fb1cd0c93f Convert m_colorOverlayEnabled to new settings API 2019-12-10 08:28:41 +01:00
Vasily 117b0f65eb Convert m_colorBlue to new settings API 2019-12-10 08:28:41 +01:00
Vasily 6e0b6d39f8 Convert m_colorGreen to new settings API 2019-12-10 08:28:41 +01:00
Vasily b0b1f44ae1 Remove color*New from settings
The color*New settings were a hotfix for 4.0.1 where wrong settings were
applied to the colors leading to a black headset screen.
The New postfix is to manually prevent the settings file from reading
the old values.
2019-12-10 08:28:41 +01:00
Vasily d474af9501 Convert m_colorRed to new settings API 2019-12-10 08:28:41 +01:00
Vasily 287a6139be Convert m_brightnessEnabled to new settings API 2019-12-10 08:28:41 +01:00
Vasily 39ec5267f6 Convert m_colorOverlayOpacity to new settings API
The setColorOverlayEnabled function had a bug where the previous value
would be applied instead of the current value.
2019-12-10 08:28:41 +01:00
Vasily a13b901b88 Convert m_brightnessValue to new settings API 2019-12-10 08:28:41 +01:00
Vasily 0710432933 Convert m_brightnessOpacityValue to new settings API 2019-12-10 08:28:41 +01:00
Vasily ec73c54f3e Convert m_fadeDistanceRemembered to new settings API 2019-12-10 08:28:41 +01:00
Vasily 0c07f0c207 Convert m_chaperoneShowDashboardDistance to new settings API 2019-12-10 08:28:41 +01:00
Vasily 292398fd98 Convert m_chaperoneAlarmSoundDistance to new settings API 2019-12-10 08:28:41 +01:00
Vasily 13c8eabeb0 Convert m_chaperoneHapticFeedbackDistance to new settings API 2019-12-10 08:28:41 +01:00
Vasily 81bbec52b4 Convert m_chaperoneSwitchToBeginnerDistance to new settings API 2019-12-10 08:28:41 +01:00
Vasily d47c570537 Convert m_disableChaperone to new settings API 2019-12-10 08:28:41 +01:00
Vasily be6a21d321 Convert m_enableChaperoneShowDashboard to new settings API 2019-12-10 08:28:41 +01:00
Vasily b6f0e22770 Convert m_chaperoneAlarmSoundAdjustVolume to new settings API 2019-12-10 08:28:41 +01:00
Vasily 3632fc03d5 Convert m_chaperoneAlarmSoundLooping to new settings API 2019-12-10 08:28:41 +01:00
Vasily 54022e0438 Convert m_enableChaperoneAlarmSound to new settings API 2019-12-10 08:28:41 +01:00
Vasily 4011674b0f Convert m_enableChaperoneHapticFeedback to new settings API 2019-12-10 08:28:41 +01:00
Vasily ee32cf90b5 Convert m_chaperoneSwitchToBeginnerActive to new settings API 2019-12-10 08:28:41 +01:00
Vasily 71b8a336c2 Convert m_alarmTime to new settings API 2019-12-10 08:28:41 +01:00
Vasily 09fcf79e8b Convert keyboardShortcuts to new settings API 2019-12-10 08:28:41 +01:00