748 Commits

Author SHA1 Message Date
Chris Robinson
1d4b355622 Use standard sin and sqrt 2020-09-12 19:06:06 -07:00
Chris Robinson
bb90bfd9b3 Accumulate delays as samples before calculating nanoseconds 2020-09-12 01:52:45 -07:00
Chris Robinson
cf298075b5 Round (and clamp) the reftime instead of ceiling it 2020-09-12 00:47:04 -07:00
Chris Robinson
33d91ceeec Avoid repeating string literals 2020-09-11 01:40:36 -07:00
Chris Robinson
a4bfba4cb5 Recognize GUID name strings with the DSound backend 2020-09-10 22:05:25 -07:00
Chris Robinson
21162cf5fc Allow JACK to enumerate custom devices
Each device being associated with a port name pattern it'll try connecting to.
2020-09-10 21:09:06 -07:00
Chris Robinson
bb63d5aab3 Simplify clearing an array 2020-09-09 23:21:46 -07:00
Chris Robinson
ce0a45cbc7 Don't assume iterators are pointers 2020-09-09 14:02:02 -07:00
Chris Robinson
68a099ba35 Apply the first convolution segment in the time domain
This avoids an inherent delay from the effect, at the cost of higher CPU use.
Having a customizable user-specified delay (with said user ensuring a properly
trimmed impulse response) could help alleviate the cost since once the delay
exceeds the segment size, the initial FIR filter could be skipped.
2020-09-09 02:23:38 -07:00
Chris Robinson
f4a55cc8c2 Don't leave the negative frequencies as 0 for inverse FFT 2020-09-08 23:20:06 -07:00
Chris Robinson
29566b995c Avoid an extraneous ConvolutionFilter sub-object 2020-09-06 00:16:50 -07:00
Chris Robinson
7eb5dfb3f8 Allow querying the new enums and functions 2020-09-05 23:53:53 -07:00
Chris Robinson
c52bf8c401 Rework effect slot buffer setting
Rather than creating an effect-specific buffer that gets passed along as a
property, the buffer is set the effect state when the effect state is created,
the device is updated, or the buffer is changed. The buffer can only be set
while the effect slot isn't playing, so it won't be changed or updated while
the mixer is processing the effect state.
2020-09-05 20:48:56 -07:00
Chris Robinson
9975aeb37f Add methods to start and stop effect slot processing
A newly-created effect slot is in an AL_INITIAL state, in which processing is
stopped but will automatically become AL_PLAYING after successfully setting an
AL_EFFECTSLOT_EFFECT value (including AL_EFFECT_NULL or 0). Calling Play[v] or
Stop[v] will set the effect slot to AL_PLAYING or AL_STOPPED respectively.
While stopped, the effect won't produce audio and will not be processed.
2020-09-05 19:11:57 -07:00
Chris Robinson
7851f7d4ce Don't add effect slots to the active list until an effect is set 2020-09-05 18:13:08 -07:00
Chris Robinson
c1ad5d6055 Avoid confusing */*...*/ syntax
MSVC warns about */ being outside of a comment.
2020-09-05 14:28:08 -07:00
Chris Robinson
73f5331305 Use an RAII wrapper to manage COM object references 2020-09-05 12:32:41 -07:00
Chris Robinson
88f7617807 Avoid duplicate WASAPI devices by matching GUIDs 2020-09-04 18:32:06 -07:00
Chris Robinson
9e862900fe Update some UHJ comments 2020-09-02 15:50:11 -07:00
Chris Robinson
1968136c98 Add an in-progress extension string for convolution reverb 2020-09-01 07:37:07 -07:00
Chris Robinson
a6aefeccd8 Use enum class for a couple enums 2020-09-01 05:46:19 -07:00
Chris Robinson
af97a92952 Move more processing to the ConvolutionFilter struct 2020-08-31 06:43:42 -07:00
Chris Robinson
88425becb2 Remove a couple unnecessary pointers 2020-08-30 04:41:19 -07:00
Chris Robinson
82873486b7 Dynamically allocate the convolution channel mixing data 2020-08-30 04:28:01 -07:00
Chris Robinson
ebe0765ce3 Reorganize some convolution fields 2020-08-30 03:42:44 -07:00
Chris Robinson
8724c1ce4b Remove extraneous parenthesis 2020-08-28 23:28:20 -07:00
Chris Robinson
3fdee6c814 Calculate the correct number of convolution segments 2020-08-28 23:08:44 -07:00
Chris Robinson
ecfb0d4f5b Limit convolution processing to the output ambisonic order 2020-08-28 06:47:21 -07:00
Chris Robinson
7266cd8b6c Don't dereference a null convolution filter 2020-08-28 06:44:05 -07:00
Chris Robinson
52531d8b72 Support B-Format impulse responses for convolution 2020-08-28 05:48:26 -07:00
Chris Robinson
986a58d5b4 Pass a BufferStorage to EffectState::createBuffer 2020-08-28 00:44:55 -07:00
Chris Robinson
1f486f820e Use a separate structure for buffer storage 2020-08-28 00:09:46 -07:00
Chris Robinson
ecf30de36f Rename buffer_formats to buffer_storage 2020-08-27 23:02:17 -07:00
Chris Robinson
a9ebcdcb7f Handle 0-length convolution buffers 2020-08-27 21:32:25 -07:00
Chris Robinson
3c09f17421 Blend panned B-Format source directivity given its radius 2020-08-27 08:44:29 -07:00
Chris Robinson
2a01940041 De-duplicate LoadSampleArray and FmtTypeTraits 2020-08-26 21:29:16 -07:00
Chris Robinson
9dab2db33b Avoid copying the convolution filter history to shift it
Instead, the current/head/newest segment is tracked, and decremented with each
process to overwrite the oldest.
2020-08-25 15:43:48 -07:00
Chris Robinson
801c7a9226 Initial implementation of the convolution effect
Currently limited to mono and stereo impulse responses, and stereo IRs try to
use direct/real output rather than panning.
2020-08-25 04:21:10 -07:00
Chris Robinson
a6bd53c4e1 Store a reference to the effect buffer as an active property 2020-08-24 20:40:24 -07:00
Chris Robinson
1a9fbc1b2f Stub out a convolution effect state 2020-08-24 20:04:16 -07:00
Chris Robinson
b955479e18 Recognize a convolution reverb effect type 2020-08-24 20:00:58 -07:00
Chris Robinson
9e5a388dfe Add a method for effects to create persistent buffer data 2020-08-24 19:13:46 -07:00
Chris Robinson
9d61484e4b Move storable buffer format info to a separate source 2020-08-24 17:59:07 -07:00
Chris Robinson
73ab9d46c8 Use an intrusive_ptr to hold the unapplied effect state 2020-08-24 16:34:53 -07:00
Chris Robinson
ff5c9d1c15 Use an intrusive_ptr for ALeffectslotProps::State 2020-08-24 14:09:26 -07:00
Chris Robinson
23259b48dd Avoid a zero-length array for the FlexArray definition
Newer GCCs are warning about FlexArray being used at the end of another struct.
Though not the most ideal to always allocate space for at least 1 element,
actual 0-sized uses are rare and for smaller element types.
2020-08-15 23:22:10 -07:00
Chris Robinson
b12cd77d32 Use a wait predicate instead of a while loop 2020-08-12 10:00:43 -07:00
Chris Robinson
475ed0f039 Use a FlexArray instead of a vector for distance compensation 2020-08-11 05:59:20 -07:00
Chris Robinson
e8b3e82f96 Change a couple functions into member functions 2020-08-07 06:22:39 -07:00
Chris Robinson
84354c792e Cleanup OSS enumeration and fix duplicate names 2020-08-07 00:11:29 -07:00