158 Commits

Author SHA1 Message Date
Chris Robinson
800e2b6125 Cleanup and fix alAuxiliaryEffectSlotPlayv/StopvSOFT 2020-09-05 21:39:31 -07:00
Chris Robinson
13710b474e Ensure effect slot properties are updated when playing 2020-09-05 21:04:41 -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
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
0ad7bb577a Don't allow callback buffers for effect slots 2020-08-27 21:10:00 -07:00
Chris Robinson
e98a058595 Fix handling doubles 2020-08-25 02:38:44 -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
f9d6aa2f48 Allow setting a buffer on an effect slot 2020-08-24 16:08:09 -07:00
Chris Robinson
ff5c9d1c15 Use an intrusive_ptr for ALeffectslotProps::State 2020-08-24 14:09:26 -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
0406e3bef7 Change a couple functions into member functions 2020-05-10 20:16:43 -07:00
Chris Robinson
cf64dc1103 Fix up some more uses of [AL[C]]void 2020-04-28 14:48:12 -07:00
Chris Robinson
b828cf81a9 Shorten the name of format types 2020-04-28 07:56:36 -07:00
Chris Robinson
be476c7935 Use global placement new for AsyncEvent 2020-04-24 07:04:32 -07:00
Chris Robinson
aff410fa6d Avoid using some more AL types 2020-04-23 04:57:04 -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
27ac637a66 Remove another unnecessary return value 2020-04-16 17:29:32 -07:00
Chris Robinson
6ac5816354 Avoid inlining some potentially costly calls 2020-04-14 11:50:59 -07:00
Chris Robinson
1d8ac4d61f Throw exceptions for errors in the effect getters/setters 2020-04-10 20:23:20 -07:00
Chris Robinson
13153bab60 Add an effect_exception for handling effect properties 2020-04-10 18:26:08 -07:00
Chris Robinson
f7380a44d4 Use a common base for a couple exceptions 2020-04-10 15:12:57 -07:00
Chris Robinson
8bddf3e6ab Report invalid filter values 2020-04-10 09:16:08 -07:00
Chris Robinson
8713bb8afb Add missing include 2020-04-10 09:04:40 -07:00
Chris Robinson
c83609277b Use exceptions for filter errors 2020-04-09 19:36:37 -07:00
Chris Robinson
d67cba99bd Clean up some more unnecessary uses of AL types 2020-04-08 10:15:43 -07:00
Chris Robinson
a0b7638d63 Add an extension to change a buffer's unpack ambisonic order 2020-04-04 03:10:01 -07:00
Chris Robinson
fc906c97f5 Track a buffer's ambisonic order 2020-04-04 01:52:29 -07:00
Chris Robinson
902f5a0dd2 Add an ambisonic order parameter to the buffer channel count 2020-04-03 21:43:57 -07:00
Chris Robinson
bd50601f15 Remove a couple outdated comments 2020-04-03 10:07:43 -07:00
Chris Robinson
963d9b761b Rename ALvoice and related structs to Voice 2020-03-28 18:15:05 -07:00
Chris Robinson
fb07612545 Get rid of MAX_INPUT_CHANNELS 2020-03-28 18:15:05 -07:00
Chris Robinson
f1f9a14172 Avoid AL[C]boolean for internal use 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
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
7effad45c2 Clean up ALfilter some
Use inline methods instead of macros
Fix indentation
Add some consts
2020-03-23 16:31:08 -07:00
Chris Robinson
6a3b3b180b Add a macro to disable class-specific new/delete 2020-03-23 16:00:50 -07:00
Chris Robinson
b53294e291 Use inline initialization more for sources 2020-03-23 15:04:26 -07:00
Chris Robinson
f56ef433d8 Move the FPUCtl methods to its own source 2020-03-20 15:01:45 -07:00
Chris Robinson
78251fd7e6 Fix voices being forced to update without valid properties
When starting a voice, the source ID was set before its first update struct was
provided, creating a small window where a listener or effect slot update could
force a voice to update without it having any valid properties to update with.
Supplying the update struct first would create a different race, where the
mixer could see a voice without a source but with an update struct, causing the
update struct to be 'freed' without being applied.

The fix here is to provide the update struct before setting the source ID, and
change the mixer to ignore update structs for voices without a source ID. This
can pseudo-orphan the updates that get set on a voice just as it stops, leaving
the struct unusable until the voice is used again, or the voice gets deleted
which will clear it. But it allows the update struct to stay in place and get
applied once the voice gets a source ID.
2020-03-04 23:18:05 -08:00
Chris Robinson
48b9b541ec Avoid redundantly setting voice members 2020-03-04 13:40:21 -08:00