201 Commits

Author SHA1 Message Date
Chris Robinson
12911cc533 Use a range-for loop to concatenate available backends 2019-06-29 10:23:29 -07:00
Chris Robinson
3ede66ae45 Don't keep retrieving the backend factories 2019-06-28 18:54:31 -07:00
Minmin Gong
9326b98e2d Fix the error "a reinterpret_cast is not a constant expression" on GCC 9 2019-06-27 22:29:42 -07:00
Chris Robinson
5a884572f0 Use a span instead of pointer+size parameters 2019-06-17 20:05:38 -07:00
Chris Robinson
a009b9502a Avoid manually looping to destroy orphaned async events 2019-06-16 18:58:56 -07:00
Chris Robinson
0a532729ba Reorganize how some device fields are set and reset 2019-06-15 23:10:11 -07:00
Chris Robinson
ec6fdff0c6 Make the voice count unsigned 2019-06-09 19:27:15 -07:00
Chris Robinson
bc8f206ee1 Use a FlexArray for the context's voices 2019-06-09 18:13:54 -07:00
Chris Robinson
90d25e5187 Make sure the bitfield indices are constants 2019-06-09 02:20:30 -07:00
Chris Robinson
2e154069c6 Use a bitfield for the device flags 2019-06-08 23:49:15 -07:00
Chris Robinson
91b7e8142c Simplify DistanceComp somewhat 2019-06-08 01:39:28 -07:00
Chris Robinson
f9da06fc6a Use a span for the effect state's output target 2019-06-05 19:58:58 -07:00
Chris Robinson
1ce310c6d1 Make some more channel counts unsigned 2019-06-05 19:26:54 -07:00
Chris Robinson
410a5ca621 Make RealMixParams channel count unsigned 2019-06-05 18:54:17 -07:00
Chris Robinson
5f26205f8f Properly destroy other objects 2019-06-05 17:25:08 -07:00
Chris Robinson
4522a51ea2 Don't log the function or prefix
It's ultimately unnecessary since the message is an indicator about where it
was logged from. The message itself is generally more important than where it
was from, too.
2019-06-04 01:37:36 -07:00
Chris Robinson
c76fb714cc Restructure voice data members
This should improve access patters by packing each buffer channel's data
together, which is more inline with its use.
2019-06-03 22:24:26 -07:00
Chris Robinson
c80ee5b701 Use std::array for most mixing buffer arrays 2019-05-28 16:22:36 -07:00
Chris Robinson
f57fedec7f Get rid of the COUNTOF macro 2019-05-26 21:28:51 -07:00
Chris Robinson
515a201e30 Restructure some voice fields 2019-05-17 20:39:28 -07:00
Chris Robinson
95d19be36b Catch exceptions from backend reset 2019-05-04 20:34:33 -07:00
Chris Robinson
5ff8d5ae32 Add an exception class to cover backend creation and opening 2019-05-04 18:03:25 -07:00
Chris Robinson
1607f9c525 Report the threshold limit for the output limiter 2019-05-04 13:53:11 -07:00
Chris Robinson
9e4ee500b6 Scale the update size with sample rate changes 2019-04-26 18:04:22 -07:00
Chris Robinson
f23ff0394d Specify the buffer size as itself instead of the period count
Certain backends don't need a buffer size to be a strict multiple of the period
count, which allows a little more flexibility. The period/update size simply
acts as the minimum request, which helps control CPU load by determining how
often parameter and other pre-mixing updates are processed.
2019-04-26 15:58:25 -07:00
Chris Robinson
725ceb128e Open the playback device earlier
So we actually have a device name to get the initial settings for. Be aware
that some backends set a format when opening instead of on reset, so such
devices will only set the default format (it can't get a desired format without
the device name, but the format will already be set once that's known). The
affected backends are WinMM, SDL2, and PortAudio (none of which are generally
used). This could be fixed by reopening the device during reset, but it would
need to be done carefully.
2019-04-20 19:29:33 -07:00
Chris Robinson
4b95d310ae Remove the SZFMT macro
C++11 mandates the %zu/d formatter
2019-04-11 16:01:11 -07:00
Chris Robinson
8215251571 Simplify sorting and initializing the backends 2019-04-11 02:49:13 -07:00
Chris Robinson
460a01443c Add macros to stop exceptions from leaving API functions
Effectively makes the functions act as noexcept, since there's no meaningful
reason to propogate exceptions from "C" functions. Currently only applied to
ALC functions, but can incrementally be applied to AL functions too. In the
future, this could also handle ALC and AL errors with unique exception types
(functions that utilize this behavior would need to ensure proper cleanup).
2019-04-09 20:48:01 -07:00
Chris Robinson
d04f9326c9 Change RealMixParams::ChannelName to better reflect its use 2019-04-02 16:06:45 -07:00
Chris Robinson
9ac3524521 Spread out the ALC extensions like the AL extensions 2019-04-01 21:41:11 -07:00
Chris Robinson
86683264c9 Avoid multiple using statements for the same things 2019-04-01 21:35:52 -07:00
Chris Robinson
8781a32df5 Copy the voice's ambisonic upsampler state when reallocating 2019-04-01 17:27:31 -07:00
Chris Robinson
d8c76ba0c0 Remove a couple unused member variables 2019-03-30 23:41:47 -07:00
Chris Robinson
89210cddb7 Don't stop the backend if it's not running 2019-03-30 23:30:15 -07:00
Chris Robinson
525b5e65b2 Remove a couple unnecessary duration_casts 2019-03-26 10:20:32 -07:00
Chris Robinson
f7ab7b45f7 Mark the device and context deletes as unlikely 2019-03-24 13:54:49 -07:00
Chris Robinson
7880540407 Use a sorted vector for looking up contexts
Note that the device still holds and uses a linked list of its contexts. The
sorted vector is used to verify handles given by callers.
2019-03-19 18:53:32 -07:00
Chris Robinson
90465e9124 Use a sorted vector for devices instead of a linked list 2019-03-19 15:56:30 -07:00
Chris Robinson
9695952c8d Rename DevProbe enum names 2019-03-19 00:24:54 -07:00
Chris Robinson
2c67ab0d2c Rename ALvoice fields for consistency 2019-03-10 16:29:06 -07:00
Chris Robinson
0d295cf811 Don't directly use a buffer for updating source parameters 2019-03-10 11:52:39 -07:00
Chris Robinson
ef0f335132 Add a Stopping state for voices
This currently doesn't do much, except have the mixer progress it to Stopped.
It's valid to have without a source or buffers, and in the future will allow
fading out when a source is paused or stopped.
2019-03-09 16:48:07 -08:00
Chris Robinson
317206e8f3 Remove the FOAOut mixing buffer and associated post-processes 2019-02-22 22:35:37 -08:00
Chris Robinson
8ac2d34706 Allow processing some effects in higher order ambisonics
Reverb notably is still only first-order (any higher order channels are
dropped, and it writes to FOAOut). But others, like the equalizer, work on all
available channels.
2019-02-21 04:23:01 -08:00
Chris Robinson
3966665ca3 Store effect slots in groups of 64
Now that their wet buffers are allocated dynamically, the ALeffectslot object
itself is rather small.
2019-02-20 22:00:26 -08:00
Chris Robinson
c43381d811 Allocate the effect slot wet buffer dynamically 2019-02-20 21:01:08 -08:00
Chris Robinson
05cdc2cb30 Use relaxed memory ordering for initializing atomic_flags 2019-02-04 21:28:37 -08:00
Minmin Gong
41b9d473a2 Fix compiling problems on VS2019 with vc142 toolset
Msvc142 in VS2019 preview 2 doesn't allow std::atomic_flag to be initialized by a bool. Call test_and_set in the constructors instead.
2019-02-04 20:03:18 -08:00
Chris Robinson
f98a24fb8a Don't try to clean up the async ringbuffer if it isn't allocated 2019-01-26 19:29:26 -08:00