131 Commits

Author SHA1 Message Date
Chris Robinson
2f0e37bc24 Add back some more missing includes 2021-04-27 23:03:24 -07:00
Chris Robinson
e3c0b60cc6 Rename alcontext.h and move some functions to context.cpp 2021-04-27 19:04:45 -07:00
Chris Robinson
06dcfc3fcf Rename alcmain.h to device.h 2021-04-27 16:40:22 -07:00
Chris Robinson
061148072f Update include headers
Don't add alc/ to the include paths.
2021-04-27 16:04:54 -07:00
Chris Robinson
99157f149f Move ContextBase and VoiceChange to core 2021-04-27 08:04:09 -07:00
Chris Robinson
26c8c50c26 Partially implement an extension to hold sources on disconnect
Rather than stopping voices/sources when the device becomes disconnected, the
context can be set to leave them alone. As a consequence, their state will
remain as playing and they'll keep their last known sample offset indefinately.
For applications mindful of this behavior, it will allow resetting or reopening
the device to reconnect and automatically resume where it left off.
2021-04-26 20:25:24 -07:00
Chris Robinson
2479483645 Move bformatdec to core 2021-04-25 18:08:08 -07:00
Chris Robinson
b54bb388a3 Create a base the ALCdevice and ALCcontext structs
A base that contains the API-agnostic data, with ALCdevice and ALCcontext being
for AL-specific data.
2021-04-24 08:28:13 -07:00
Chris Robinson
2b64008b3e Fix dirty flag check 2021-04-18 16:21:25 -07:00
Chris Robinson
784dbd7d21 Restore missing AL_SOFT_source_length queries 2021-04-15 15:48:14 -07:00
Chris Robinson
29cf7ebb75 Make an inverted atomic flag type and use it
The inverted atomic flag replaces test_and_set+clear with test_and_clear+set,
essentially inverting the flag status. This makes more logical sense for
flagging dirty state, which is less confusing than flagging clean state. The
one caveat is ATOMIC_FLAG_INIT (or default construction in C++20) initializes
the state to true rather than false.
2021-04-15 15:17:04 -07:00
Chris Robinson
f33edc3b30 Add support for 4-channel UHJ
Also add the SOFT moniker to the new macros
2021-03-31 21:02:30 -07:00
Chris Robinson
b5e36007f1 Handle 3-channel UHJ audio buffers 2021-03-31 10:03:31 -07:00
Chris Robinson
35a0f2665f Decode UHJ buffers to B-Format for mixing
This should also have an adjustment for the shelf filter. Although it's not
clear what the appropriate adjustments should be.
2021-03-31 09:37:30 -07:00
Chris Robinson
051d6fb243 Combine some duplicate code 2021-03-30 07:04:06 -07:00
Chris Robinson
063da94bd8 Load/convert samples from all channels at once for mixing
This uses a bit more memory (each voice needs to hold buffers for the
deinterleaved samples of each channel, instead of just one buffer for the
current channel being mixed on the device), but it will allow for handling
formats that need or prefer their channels decoded together.
2021-03-19 23:15:27 -07:00
Chris Robinson
72c4dd4d10 Add a alSourceQueueBufferLayersSOFT stub
For compatiblity with apps that may have directly linked to it on accident.
2021-02-04 13:09:31 -08:00
Chris Robinson
3b89246733 Make sure InitVoice is given a valid buffer queue item 2021-01-26 10:40:16 -08:00
Chris Robinson
71e6bcbd62 Use an AL-specific buffer queue item struct for sources 2021-01-25 09:08:49 -08:00
Chris Robinson
6151d11253 Use a deque for the source buffer queue
This mainly avoids having to allocate ~64-byte structures individually. The
mixing voice still holds the queue as a linked list so as to be container-
agnostic.
2021-01-25 05:07:02 -08:00
Chris Robinson
f7acc30c22 Store the callback in the buffer list item 2021-01-24 09:29:56 -08:00
Chris Robinson
13c1d7efb7 Store buffer info in the queue entry 2021-01-24 02:07:39 -08:00
Chris Robinson
da59ad5105 Make PopCount and CountTrailingZeros more standard-like 2021-01-22 04:58:42 -08:00
Chris Robinson
20f5e7c1fa Avoid global constexpr arrays 2021-01-21 04:03:30 -08:00
Chris Robinson
8a86ec8ac5 Add a crossover frequency field for the device
Used when upsampling low-order ambisonic signals to higher order. Rather than a
hardcoded 400hz, it ensures a consistent crossover point when an ambdec
configuration is used. It can also allow for an alsoft config option.
2020-12-26 05:23:08 -08:00
Chris Robinson
eedc42890f Move alexcpt to core 2020-12-24 22:49:55 -08:00
Chris Robinson
d578bc6cb1 Move logging to core 2020-12-17 02:47:03 -08:00
Chris Robinson
f0fe57dc5a Don't link DistanceModel enums to AL values 2020-12-16 14:58:55 -08:00
Chris Robinson
c96b50fb65 Use a separate enum for the VoiceChange state 2020-12-16 01:40:15 -08:00
Chris Robinson
5ad28f8cba Move VoiceChange to a separate header 2020-12-16 00:50:50 -08:00
Chris Robinson
191fe888b4 Move ambidefs.h to core 2020-12-12 10:38:24 -08:00
Chris Robinson
69d55d7e03 Move the filters to core 2020-12-04 11:15:50 -08:00
Chris Robinson
a913aa6ba8 Make sure batched source updates are with the proper voice 2020-11-24 10:49:53 -08:00
Chris Robinson
21174047df Make ALbuffer inherit from BufferStorage 2020-11-21 00:54:25 -08:00
Chris Robinson
f85e76285f Disassociate internal voice enums from AL enums 2020-11-20 01:37:19 -08:00
Chris Robinson
03f9700071 Use BufferStorage for the buffer queue 2020-11-19 04:18:25 -08:00
Chris Robinson
4e760bbecc Use a separate structure for the active effect slot properties 2020-11-07 08:36:49 -08:00
Chris Robinson
7bb37deb51 Replace the mixer fraction macros with constexpr variables 2020-10-21 17:16:27 -07:00
Chris Robinson
3e62600ecc Replace some more macros with constexpr variables 2020-10-21 16:39:21 -07:00
Chris Robinson
b8f5e1f424 Change some more macros into constexpr variables 2020-10-21 10:39:00 -07:00
Chris Robinson
7b43cb8266 Declare variables closer to where they're used 2020-10-13 05:54:05 -07:00
Chris Robinson
303ca3af72 Use inline functions for popcnt and ctz instead of macros 2020-10-13 01:21:44 -07:00
Chris Robinson
1f486f820e Use a separate structure for buffer storage 2020-08-28 00:09:46 -07:00
Chris Robinson
4d9d406966 Clarify an error message 2020-05-25 02:02:50 -07:00
Chris Robinson
5bbbe8341e Use an enum class for SpatializeMode 2020-05-21 09:10:32 -07:00
Chris Robinson
cf64dc1103 Fix up some more uses of [AL[C]]void 2020-04-28 14:48:12 -07:00
Chris Robinson
a97e6e6a12 Fix the source ID for a source voice stopped from deletion 2020-04-21 01:01:18 -07:00
Chris Robinson
fc906c97f5 Track a buffer's ambisonic order 2020-04-04 01:52:29 -07:00
Chris Robinson
963d9b761b Rename ALvoice and related structs to Voice 2020-03-28 18:15:05 -07:00
Chris Robinson
d344c5a228 Avoid some extraneous uses of AL type aliases 2020-03-25 22:39:45 -07:00