Commit Graph
663 Commits
Author SHA1 Message Date
ykeara c0d44812d6 fixes keyboard positioning (#394) 2020-04-08 16:29:59 -05: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
ykeara 9225956e8a added touch default bindings (#385)
travis CI down/broken?
2020-03-27 19:10:33 -05:00
Vasily 2db3b10421 Fix push to mute icon not being used when PTM enabled 2020-03-22 18:48:48 +01:00
ykeara a9d3b9f873 Updated Manifest (#380)
* updated to ovr 1.10.30

* fixed updated showoverlaykeyboard call

* fixed keyboard location

* removed un-necessary matrix, updated app key and manifest

* fixed formatting
2020-03-22 11:58:58 -05:00
ykeara 25f3a1040d Update OVR to 1.10.30 (#379)
* updated to ovr 1.10.30

* fixed updated showoverlaykeyboard call

* fixed keyboard location
2020-03-20 02:59:08 -05: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
ykearaandVasily 97066e453c fixed audio override key unset issues (#374)
* fixed audio override key unset issues

* Add apt-transport-https to CircleCI config

CircleCI fails with
E: The method driver /usr/lib/apt/methods/https could not be found.

when attempting to get the LLVM key.
This is suspected to happen because of an update to the image.

Co-authored-by: Vasily <vautkin@teknik.io>
2020-03-15 13:56:41 -05:00
Chelsea Jaggi 8b5d5ff3d6 Set a static DPI before rendering in-VR overlay (#370)
We expect a standard 96DPI display rendering when creating the overlay,
but system DPI can interfere with this. Setting
QCoreApplication::setAttribute(Qt::AA_Use96Dpi) resolves this.

https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/369
2020-03-10 16:26:22 -05: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
ykeara 50c8415669 Brightness Opacity Refactor + Gain behavior (#355)
* added loop update tick for Synchronizeing while dashboard up

* fixed gain to allow better synching w/ external apps.

* removed extra setting brighnessValue fixed toggle error for brightness Overlay fixed gain synch error

* fixed compiler warning implicit conversion
2020-01-18 11:30:08 -06: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 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 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
Kung-vr d8f1f4e6b9 Add friction feature to motion tab
#344
2020-01-03 01:25:49 +09:00
ykeara 5a7ad06b1c changed m_k_ to m_ (#341) 2019-12-22 11:23:41 -06: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