Commit Graph
355 Commits
Author SHA1 Message Date
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
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
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 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
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
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 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 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
Vasily 3375ee4b1a Convert m_vrcDebug to new settings API 2019-12-10 08:28:41 +01:00
Vasily a272decd73 Convert m_alarmIsModal to new settings API 2019-12-10 08:28:41 +01:00
Vasily e38c72ef42 Convert m_alarmEnabled to new settings API 2019-12-10 08:28:41 +01:00
Vasily a014de8368 Convert m_micReversePtt to new settings API 2019-12-10 08:28:41 +01:00