138 Commits

Author SHA1 Message Date
Chris Robinson
8e0164df96 Fix for some missing macros 2022-03-10 18:05:07 -08:00
Chris Robinson
cfae2cc254 Use proper macros instead of magic numbers 2022-03-09 16:11:47 -08:00
Chris Robinson
90db129d60 Avoid a divide-by-zero in UhjDecoder::decodeStereo 2022-03-07 17:32:13 -08:00
Chris Robinson
42bacc399b Fix an unused parameter warning
... when either pthread_setschedparam or RTKit aren't available.
2022-02-23 02:39:17 -08:00
Chris Robinson
234e55cc3c Explicitly define AmbDecConf's destructor
GCC complains it can't inline the destructor because it's "unlikely" to be
called and would bloat code size, despite being implicitly defined. Technically
accurate, but rather annoying since it's not explicitly called or defined.
2022-02-22 21:23:53 -08:00
Chris Robinson
d06ed618d3 Avoid using an if_constexpr macro
It doesn't actually use if constexpr, and compilers are smart enough to
optimize. Some functions can use templates instead.
2022-02-22 03:03:44 -08:00
Chris Robinson
3c9a705210 Handle AirAbsorptionGainHF as a native context property 2022-02-08 22:41:44 -08:00
Chris Robinson
256ea81dbe Combine listener and context updates 2022-02-08 20:43:05 -08:00
Jan Niklas Hasse
7d2de711c8
Remove extra ';' after member function definition (#652)
Found using -Wextra-semi warning.
2022-01-31 16:02:10 -08:00
Chris Robinson
f8ac1ffe80 Get rid of MathDefs 2022-01-27 02:59:07 -08:00
Chris Robinson
1bbea9cd30 Start and use a standard-like numbers header 2022-01-27 01:38:39 -08:00
Chris Robinson
388f10319b Handle _gettid on FreeBSD
And simplify handling D-Bus/RTKit interfaces
2022-01-18 15:55:51 -08:00
Chris Robinson
5306c9d424 Set niceness as a fallback only on Linux
If pthread_setschedparam and rtkit_make_realtime both fail, lowering niceness
can also work to boost priority. However, this only works on Linux and other
OSs that implement a per-thread niceness (POSIX standard has it per-process,
which isn't desirable behavior here).
2022-01-18 14:32:15 -08:00
Chris Robinson
4920167fa0 Avoid passing a function pointer to std::call_once 2022-01-18 11:45:08 -08:00
Chris Robinson
6f60e7a452 Handle the rt-prio config options as the priority level 2022-01-18 10:04:40 -08:00
Chris Robinson
a6dc7afa0f Explicitly default the band splitter's copy assignment 2022-01-11 01:49:24 -08:00
Chris Robinson
a2c5ffd9bc Slightly improve handling of stopping voices 2022-01-08 23:21:35 -08:00
Jan Niklas Hasse
3bdbbe8aa8
Remove extra ';' after member function definition (#634)
Found using -Wextra-semi warning.
2022-01-04 12:39:34 -08:00
Chris Robinson
fff09a2e5c Don't mix higher orders of B-Format than the device is doing 2022-01-02 00:18:29 -08:00
Chris Robinson
72c99b52d8 Use an span of pointers instead of arrays for mixing 2022-01-01 21:19:53 -08:00
Chris Robinson
a271484e7c Pass a span of pointers to the UHJ/SuperStereo decoder 2022-01-01 00:10:21 -08:00
Chris Robinson
f1aa10ff0b Use a bitset instead of a plain uint for flags 2021-12-23 13:43:10 -08:00
Chris Robinson
0a87828b41 Don't swallow up buffer callback samples when pausing 2021-12-18 03:59:32 -08:00
Chris Robinson
5bfa7c22fd Don't update voice sample histories when stopping/pausing
Since a voice pausing is on a fade-out, and will replay the same samples again
when restarting and fading in.
2021-12-18 03:45:19 -08:00
Chris Robinson
cbbc4dc8fa Move some more context functions to the proper source 2021-12-17 17:34:03 -08:00
Chris Robinson
d16b61dffb Move the effects base and effectslot to core 2021-12-17 17:13:59 -08:00
Chris Robinson
fbc42aad7e Move some ContextBase function definitions to the right place 2021-12-17 04:25:46 -08:00
Chris Robinson
3ed913f6dd Remove an unnecessary parameter 2021-12-17 04:14:39 -08:00
Chris Robinson
c9537abfb1 Allocate voice properties in clusters 2021-12-17 04:07:00 -08:00
Chris Robinson
edea2b2a02 Rename Voice::mNumChannels for clarity 2021-12-15 14:28:26 -08:00
Chris Robinson
54c4bea487 Add source properties for Super Stereo
When playing a stereo format, enabling Super Stereo causes the source to behave
as a B-Format source, with a variable width control.
2021-12-15 02:01:22 -08:00
Chris Robinson
b489705b25 Minor UHJ coefficient scaling precision improvement 2021-12-13 01:09:53 -08:00
Chris Robinson
953745d386 Make an inline function to check for 2D ambisonic formats 2021-12-12 15:53:53 -08:00
Chris Robinson
5e3fcb3a93 Avoid initializing the NFC filter for every voice channel
It can be initialized once with the device's speaker distance since it won't
change in between resets, then copied into the voice where it can be adjusted
as needed.
2021-12-11 21:42:34 -08:00
Chris Robinson
01dd34f305 Add an internal Super Stereo format
It's not available as an AL buffer format (yet) since I'm not sure how to
expose it. Internally it seems fine as a separate channel configuration, but
because OpenAL combines the channel configuration and sample type, a flag may
work better there.
2021-12-11 17:50:24 -08:00
Chris Robinson
a75d35bbb0 Use a vector in BFormatDec instead of FlexArray
FlexArray would be better since it's not likely to use much memory for the
array, but the std::unique_ptr makes BFormatDec a non-standard layout, causing
GCC and Clang to complain.
2021-12-10 22:07:20 -08:00
Chris Robinson
c005d2c300 Remove unnecessary lines 2021-12-10 00:23:03 -08:00
Chris Robinson
a97dba6f41 Improve the 2-channel UHJ response
This attempts to correct for the differences needed for 2-channel UHJ's shelf
filters given the output shelf filters. It's far from ideal, but better than
nothing.
2021-12-09 22:00:35 -08:00
Chris Robinson
b72402d3e7 Add a function for Super Stereo conversions
a.k.a. Stereo Enhance. A common feature of UHJ decoders to take a plain
stereo signal and generate a B-Format signal with variable width control,
widening (or narrowing) the soundfield while maintaining a sharp central
image.
2021-12-09 21:19:36 -08:00
Chris Robinson
a73b64ce3c Slight update to the UHJ coefficients
The extended precision of the encoder's 0.6512*X term was guesswork, with no
real basis for it. Switch back to the original value until something better
actually comes up. Also updates the decoder to account for the change in the
encoder.
2021-11-28 05:39:35 -08:00
Chris Robinson
f1380d830a Avoid passing spans unnecessarily 2021-11-25 20:29:50 -08:00
Chris Robinson
c5831c92f3 Don't assume the UhjDecoder::decode offset is 16-byte aligned
It's not, it's MaxResamplerEdge which is currently 24.
2021-11-25 20:22:12 -08:00
Chris Robinson
d5707b3184 Use a base for the UhjEncoder/Decoder common properties 2021-11-25 19:53:52 -08:00
Chris Robinson
3ef4bffaf9 Slightly improve logging on Windows
The characters won't display properly if the system codepage isn't UTF-8, but
at least it shouldn't cut the line off prematurely.
2021-11-21 21:21:46 -08:00
Chris Robinson
834800c817 Downgrade some ERRs to WARNs 2021-11-21 20:29:20 -08:00
Chris Robinson
0c99a6b316 Make the backend pointer part of ALCdevice instead of DeviceBase 2021-11-19 20:04:10 -08:00
Chris Robinson
49a36334bd Use a tri-state optional for the stereo output mode 2021-10-24 11:51:39 -07:00
Chris Robinson
d0e5e138e2 Use a flag to indicate headphone-like output 2021-10-23 07:51:06 -07:00
Chris Robinson
92b65fa15f Avoid manually prefixing EventType_ enums
And use a better fitting type that matches how it's used
2021-10-10 05:07:31 -07:00
Chris Robinson
e3b8f8fe27 Make a construct_at method amd use it 2021-10-08 11:05:36 -07:00