24 Commits

Author SHA1 Message Date
Chris Robinson
8853519d89 Generate the bsinc tables using constexpr methods
All the methods used should be compliant with C++14 constexpr rules. However,
the number of scales and phases cause GenerateBSincCoeffs to reach the allowed
step limit, preventing full compile-time generation. It's not a terribly big
deal, it'll generate them very quickly when loading, but it does prevent using
shared read-only memory pages.
2020-04-02 00:49:19 -07:00
Chris Robinson
963d9b761b Rename ALvoice and related structs to Voice 2020-03-28 18:15:05 -07:00
Chris Robinson
a27096dd63 Dynamically allocate voice channel data
Rather than allocating for a full 8 channels for each voice, when the vast
majority will only need 1 or 2. The voice channel data is relatively big since
it needs to hold HRTF coefficients and history, and this will allow increasing
the maximum number of buffer channels without an obscene memory increase.
2020-03-25 21:06:24 -07:00
Chris Robinson
ef663f13c0 Properly allocate voices 2020-03-22 11:34:37 -07:00
Chris Robinson
e7405f7801 Use a new voice state to indicate a pending source offset change 2020-03-04 10:16:59 -08:00
Chris Robinson
872096958b Rename the voice's PendingStop to PendingChange 2020-02-26 01:48:59 -08:00
Chris Robinson
a8162a77c2 Use an array of ALvoice pointers for the active voices
This allows growing the array atomically with the mixer since the ALvoice
objects themselves don't move, and a new larger array of them can be swapped in
without blocking the mixer.
2020-02-21 20:14:28 -08:00
Chris Robinson
acf7f6f74e Add a voice flag to indicate a voice has a pending stop
Pending/asynchronous stops to be implemented soon.
2020-02-20 19:18:07 -08:00
Chris Robinson
3122c3b4a1 Handle running the buffer callback in the voice 2020-02-17 17:13:25 -08:00
Chris Robinson
c8dfd24818 Add a callback flag for voices 2020-02-17 04:50:00 -08:00
Chris Robinson
3ee0906c81 Use std::array and span for the HRTF delays 2020-02-08 15:00:58 -08:00
Chris Robinson
e889282131 Get rid of an unnecessary struct 2020-01-13 19:45:13 -08:00
Chris Robinson
701d43b41e Start a new extension for a new direct_channels state
So existing behavior remains consistent for anything that needs it, and new
behavior is opt-in.
2019-12-28 11:33:19 -08:00
Chris Robinson
38037e29ba Handle the buffer's ambisonic properties 2019-12-02 12:50:18 -08:00
Chris Robinson
b79aa32308 Store the ambisonic order for the voice
Currently only first-order B-Format is possible for a buffer/source, but this
will begin to allow for higher orders with an appropriate extension.
2019-12-01 15:36:25 -08:00
Chris Robinson
7ff165b095 Use unsigned for array indices 2019-11-29 08:33:46 -08:00
Chris Robinson
f58167e72d More sanely handle the voice state when mixing 2019-10-14 20:45:23 -07:00
Chris Robinson
acb6baad90 Use std::array instead of plain arrays in a couple places 2019-10-05 21:23:31 -07:00
Chris Robinson
267b79f337 Avoid duplicate structs 2019-10-05 16:11:38 -07:00
Chris Robinson
bce6889173 Remove an unnecessary struct specifier 2019-10-02 22:20:34 -07:00
Chris Robinson
324fb8d0b7 Fix a comment 2019-10-02 19:22:14 -07:00
Chris Robinson
58085f1c7b Clean up some unnecessary includes 2019-10-02 19:13:07 -07:00
Chris Robinson
50198ee30c Clean up some ALfloat -> float 2019-10-02 17:07:23 -07:00
Chris Robinson
64e2c377d8 Move ALvoice from alu.h to a separate header 2019-10-02 16:53:23 -07:00