Commit Graph

1758 Commits

Author SHA1 Message Date
Chris Robinson
e80b016cbe Use a global RowMixerFunc 2018-01-16 12:18:59 -08:00
Chris Robinson
5deb1df8db Add min/max/clamp functions for size_t 2018-01-16 09:39:28 -08:00
Chris Robinson
bc44efb91d Use ALsizei for some count/length variables 2018-01-15 18:31:43 -08:00
Chris Robinson
682205a3d4 Finalize ALC_SOFT_device_clock 2018-01-15 06:45:53 -08:00
Chris Robinson
63416bf28f Avoid unnecessarily using type aliases 2018-01-14 09:02:59 -08:00
Chris Robinson
0152bc0d10 Remove the SAFE_CONST macro
Seems compilers are now allowing a pointer-to-type-array to implicitly convert
to pointer-to-const-type-array.
2018-01-14 08:51:03 -08:00
Chris Robinson
78cb70a5f9 Replace some freq_mult variable names with f0norm
The latter is a bit more descriptive as f0 is often used to denote the
reference frequency of a filter, so f0norm indicates the normalized reference
frequency (ref_freq / sample_rate).
2018-01-13 09:14:46 -08:00
Chris Robinson
16e4e0fa7c Use a more normal vtable setup for filter methods 2018-01-13 08:07:03 -08:00
Chris Robinson
c031b3cc6a Avoid fixed-PATH_MAX-size buffers
Windows still needs to use MAX_PATH in a couple places, but that macro's
guaranteed there.
2018-01-13 04:40:20 -08:00
Chris Robinson
4db1328bc5 Move the FORCE_ALIGN macro to threads.h 2018-01-12 03:55:33 -08:00
Chris Robinson
e634564b26 Make a couple functions inline 2018-01-12 02:37:48 -08:00
Chris Robinson
1f236d8f20 Define a function where it's used 2018-01-11 22:42:25 -08:00
Chris Robinson
370817ba60 Move logging declarations to a separate header 2018-01-11 20:17:02 -08:00
Chris Robinson
e89c183231 Avoid including alMain.h in ringbuffer.c 2018-01-11 10:03:26 -08:00
Chris Robinson
b11131ce0c Move a forward declaration to the others 2018-01-11 09:43:45 -08:00
Chris Robinson
2d2ca1d791 Remove SET_VTABLE1 2018-01-11 09:39:52 -08:00
Chris Robinson
85a8f965e5 Clean up the EffectList members and make the list size known 2018-01-11 09:34:01 -08:00
Chris Robinson
88545ccae5 Move the EffectList array to alEffect.c/h 2018-01-11 09:25:17 -08:00
Chris Robinson
3832b25f30 Move the ringbuffer declarations to a separate header
And rename alcRing.c to ringbuffer.c for consistency.
2018-01-11 09:16:28 -08:00
Chris Robinson
15ad5245bf Move the FPU mode declarations to a separate header
Also don't use inheritance with FPUCtl.
2018-01-11 08:44:52 -08:00
Chris Robinson
8aa9e35f8c Move the config function declarations to their own header
And rename alcConfig.c to alconfig.c for consistency.
2018-01-11 07:56:54 -08:00
Chris Robinson
81b13f78ea Move the CPU capability flags to a separate header 2018-01-11 07:19:19 -08:00
Chris Robinson
9b9ec2c21a Move the compressor/limiter declarations to their own header 2018-01-11 06:50:53 -08:00
Chris Robinson
f3c9bc114c Move the polymorphic/inheritance macros to a separate header 2018-01-11 06:32:45 -08:00
Chris Robinson
2c8e4467c3 Move some HRTF structures to hrtf.h 2018-01-11 03:53:25 -08:00
Chris Robinson
15f9d15ba0 Avoid using macros to access anonymous structures 2018-01-11 03:45:23 -08:00
Chris Robinson
279799ad70 Don't return whether the bsinc filter cuts or not 2018-01-10 19:20:58 -08:00
Chris Robinson
ef63ec3fe9 Use one macro to handle both resample padding sizes 2018-01-09 23:55:59 -08:00
Chris Robinson
de8c5b1824 Combine the chorus and flanger processing functions
Given that they're nearly identical, it should be relatively simple to use the
same effect state to process either of them, similar to the reverbs. The big
differences seem to be the delay range (much shorter with flanger) and the
defaults.
2018-01-09 23:21:16 -08:00
Chris Robinson
9e2eb5dc23 Rename the device's temp buffer storage to be more generic 2018-01-09 22:01:46 -08:00
Chris Robinson
5d1207104a Remove standard reverb specific processing functions 2018-01-07 22:48:03 -08:00
Chris Robinson
d547f52d8f Move the UNEXPECTED macro to the main header and rename it 2018-01-07 22:20:08 -08:00
Chris Robinson
70973035de Use a separate function to get the cubic value 2018-01-07 17:24:29 -08:00
Chris Robinson
c423b6c8b7 Remove the sinc4 table 2018-01-07 05:58:52 -08:00
Chris Robinson
4cc1c64646 Replace the sinc4 resampler with cubic
Turns out the C version of the cubic resampler is just slightly faster than
even the SSE3 version of the FIR4 resampler. This is likely due to not using a
64KB random-access lookup table along with unaligned loads, both offseting the
gains from SSE.
2018-01-07 05:32:07 -08:00
Chris Robinson
2346426b6e Make MixSamples non-static global 2017-12-17 21:48:07 -08:00
Chris Robinson
30007263e5 Allow storing multiple buffers in a ALbufferlistitem
This will be to allow buffer layering, multiple buffers of the same format and
sample rate that are mixed together prior to resampling, filtering, and
panning. This will allow composing sounds from individual components that can
be swapped around on different invocations (e.g. layer SoundA and SoundB on one
instance and SoundA and SoundC on a different instance for a slightly different
sound, then just SoundA for a third instance, and so on). The longest buffer
within the list item determines the length of the list item.

More work needs to be done to fully support it, namely the ability to specity
multiple buffers to layer for static and streaming sources. Also the behavior
of loop points for layered static sources should be worked out. Should also
consider allowing each layer to have a sample offset.
2017-12-15 22:59:51 -08:00
Chris Robinson
32f72c7471 Add queries to get the source offset with the device clock 2017-12-03 14:45:19 -08:00
Chris Robinson
2f5b86dd38 Add an "un-exposed" method to get the library version
This reports the same ALSOFT version as alGetString(AL_VERSION), but doesn't
require a current context (which requires a ALCdevice) to call. Do *NOT* use
this version to determine feature support, use the standard interfaces. If you
think you need to use this, you probably don't, and shouldn't.
2017-10-16 05:47:12 -07:00
Chris Robinson
296abf03de Avoid a separate function to query ambisonic mode support
Now FuMa and ACN channel orders are required, as are FuMa, SN3D, and N3D
normalization schemes. An integer query (alcGetIntegerv) is added for the
maximum ambisonic order.
2017-09-27 11:58:36 -07:00
Chris Robinson
1ab8902621 Re-update effect slots when context properties change
Also keep all free property update structs together in the context instead of
per-object.
2017-09-27 11:13:18 -07:00
Chris Robinson
fd70b0bca6 Don't update context and listener props unnecessarily 2017-09-27 09:36:34 -07:00
Chris Robinson
101d284a18 Update the context state properties separately
The context state properties are less likely to change compared to the listener
state, and future changes may prefer more infrequent updates to the context
state.

Note that this puts the MetersPerUnit in as a context state, even though it's
handled through the listener functions. Considering the infrequency that it's
updated at (generally set just once for the context's lifetime), it makes more
sense to put it there than with the more frequently updated listener
properties. The aforementioned future changes would also prefer MetersPerUnit
to not be updated unnecessarily.
2017-09-27 08:55:42 -07:00
Chris Robinson
369f52a0d7 Add an option to ignore the app's speed of sound for reverb decay 2017-09-22 05:42:04 -07:00
Chris Robinson
90cedbea49 Pass the context to the auxiliary effect update method 2017-09-21 05:42:35 -07:00
Chris Robinson
bc386af5c5 Manually save and restore the FPU rounding mode on Windows
Apparently there is a bug with at least MinGW-W64 where fegetenv and fesetenv
do not properly save and restore the FPU rounding mode, resulting in the
rounding mode remaining as round-to-zero after certain function calls. I do not
know if this also affects MSVC, but better safe than sorry for now.
2017-09-19 03:42:00 -07:00
Chris Robinson
fde02abc35 Rename resampler labels 2017-08-27 10:47:04 -07:00
Chris Robinson
a4d357de06 Add a higher quality bsinc resampler using 24 sample points
This improves the transition width, allowing more of the higher frequencies
remain audible. It would be preferrable to have an upper limit of 32 points
instead of 48, to reduce the overall table size and the CPU cost for down-
sampling.
2017-08-27 10:16:36 -07:00
Chris Robinson
561e95528f Rename the bsinc resampler to bsinc12 2017-08-25 05:52:19 -07:00
Chris Robinson
e7c4681e9a 0 meters per unit is invalid 2017-08-21 00:27:52 -07:00