aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSource.c
Commit message (Collapse)AuthorAgeFilesLines
* Allow storing multiple buffers in a ALbufferlistitemChris Robinson2017-12-151-67/+143
| | | | | | | | | | | | | | | 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.
* Add queries to get the source offset with the device clockChris Robinson2017-12-031-0/+32
|
* Re-update effect slots when context properties changeChris Robinson2017-09-271-9/+9
| | | | | Also keep all free property update structs together in the context instead of per-object.
* Don't force a fade-in when resuming a paused sourceChris Robinson2017-06-091-11/+1
| | | | | | | | This needs to be handled more automatically by the mixer to work correctly. Otherwise, requiring a property update on resume can put the source into a playing state with the mixer never playing it, due to not having valid mixing parameters and the mixing parameters not getting calculated because no updates are specified by the app (and forcing an update can break deferred updates).
* Rename RollOff to RolloffChris Robinson2017-05-051-4/+4
|
* Start an extension to change the source's spatialize propertyChris Robinson2017-05-051-0/+22
|
* Add a property to force source spatialization on or offChris Robinson2017-05-041-0/+2
|
* Rename 'moving' flag to 'fading'Chris Robinson2017-05-021-5/+5
|
* Set a voice as 'moving' if it starts/resumes at an offsetChris Robinson2017-05-021-8/+21
|
* Remove const from _Atomic vars to make Clang happyChris Robinson2017-04-211-6/+12
| | | | | | | | Clang does not allow using C11's atomic_load on const _Atomic variables. Previously it just disabled use of C11 atomics if atomic_load didn't work on a const _Atomic variable, but I think I'd prefer to have Clang use C11 atomics for the added features (more explicit memory ordering) even if it means a few instances of breaking const.
* Add the ability to change the source resamplerChris Robinson2017-04-211-0/+22
|
* Store the resampler as part of the sourceChris Robinson2017-04-211-0/+2
|
* Missed a raw atomic variable accessChris Robinson2017-04-201-2/+3
|
* Make the buffer list next pointer atomicChris Robinson2017-04-191-27/+32
|
* Use a different way to get the size of structs with flexible array membersChris Robinson2017-04-181-1/+1
|
* Store the source queue head in the voice to signify loopingChris Robinson2017-04-181-145/+134
| | | | | This removes the need to access a couple more source fields in the mixer, and also makes the looping and queue fields non-atomic.
* Store the source prop updates with the mixer voiceChris Robinson2017-04-171-43/+25
| | | | Also move its declaration and rename it for consistency.
* Use separate atomic macros for pointersChris Robinson2017-04-141-10/+9
|
* Handle the source offset fraction as an ALsizeiChris Robinson2017-04-081-7/+9
|
* Make sure the mix is done after setting the looping propertyChris Robinson2017-04-021-0/+9
|
* Fix handling of the PropsClean flagsChris Robinson2017-03-231-1/+1
|
* Add some comments for ALsource functionsChris Robinson2017-03-231-1/+13
|
* Use an atomic flag to test if a source needs to updateChris Robinson2017-03-201-7/+7
|
* Break up a function and move the code to where it's calledChris Robinson2017-03-191-176/+169
|
* Don't defer source state or offset changesChris Robinson2017-03-191-36/+12
|
* Avoid doing sequential load for the source stateChris Robinson2017-03-121-10/+8
|
* Make the voice's 'moving' state a bitflagChris Robinson2017-03-111-2/+1
|
* Implement NFC filters for Ambisonic renderingChris Robinson2017-03-101-0/+12
| | | | | | | | | | | | | | NFC filters currently only work when rendering to ambisonic buffers, which includes HQ rendering and ambisonic output. There are two new config options: 'decoder/nfc' (default on) enables or disables use of NFC filters globally, and 'decoder/nfc-ref-delay' (default 0) specifies the reference delay parameter for NFC-HOA rendering with ambisonic output (a value of 0 disables NFC). Currently, NFC filters rely on having an appropriate value set for AL_METERS_PER_UNIT to get the correct scaling. HQ rendering uses the averaged speaker distances as a control/reference, and currently doesn't correct for individual speaker distances (if the speakers are all equidistant, this is fine, otherwise per-speaker correction should be done as well).
* Remove unnecessary atomic membersChris Robinson2017-03-081-41/+38
|
* Remove an unnecessary variableChris Robinson2017-03-071-3/+2
|
* Check that a source is actually playing before setting pausedChris Robinson2017-03-071-28/+35
| | | | | Also slightly refactor setting playing state when the device is disconnected or there's no buffers to play.
* Store the channel count and sample size in the voiceChris Robinson2017-03-071-11/+4
|
* Don't modify the source state in the mixerChris Robinson2017-03-071-7/+25
|
* Remove an unused functionChris Robinson2017-03-071-1/+0
|
* Make the voice's source pointer atomicChris Robinson2017-03-051-7/+9
|
* Add a boolean to specify if a voice should be playingChris Robinson2017-03-021-15/+39
|
* Avoid standard malloc for buffer queue entriesChris Robinson2017-02-271-7/+7
|
* Move the current buffer queue entry and play position to the voiceChris Robinson2017-02-271-91/+100
| | | | | | | | | | | | | | This has a couple behavioral changes. First and biggest is that querying AL_BUFFERS_PROCESSED from a source will always return all buffers processed when in an AL_STOPPED state. Previously all buffers would be set as processed when first becoming stopped, but newly queued buffers would *not* be indicated as processed. That old behavior was not compliant with the spec, which unequivocally states "On a source in the AL_STOPPED state, all buffers are processed." Secondly, querying AL_BUFFER on an AL_STREAMING source will now always return 0. Previously it would return the current "active" buffer in the queue, but there's no basis for that in the spec.
* Ensure a non-playing or -paused source does not use a mixing voiceChris Robinson2017-02-251-43/+55
|
* Improve handling of source state readsChris Robinson2017-02-241-71/+88
| | | | | | | This avoids using seq_cst for loading the source state when either inside the mixer, or otherwise protected from inconsistencies with async updates. It also fixes potential race conditions with getting the source offset just as a source stops.
* Dynamically allocate the ALsource Send[] arrayChris Robinson2017-02-211-22/+33
|
* Make the voices' Send[] array dynamically sizedChris Robinson2017-02-211-8/+8
| | | | | The voices are still all allocated in one chunk to avoid memory fragmentation. But they're accessed as an array of pointers since the size isn't static.
* Reorganize ALvoice membersChris Robinson2017-02-151-3/+3
| | | | | This places the Send[] array at the end of the struct, making it easier to handle dynamically.
* Make ALsourceProps' Send array dynamically sizedChris Robinson2017-02-141-15/+6
| | | | | | ALsourceProps' Send[] array is placed at the end of the struct, and given an indeterminate size. Extra space is allocated at the end of each struct given the number of auxiliary sends set for the device.
* Fix build with non-C11 atomicsChris Robinson2017-02-131-2/+2
|
* Make the source state atomicChris Robinson2017-02-131-26/+20
| | | | | Since it's modified by the mixer when playback is ended, a plain struct member isn't safe.
* Remove a couple context lock wrapper functionsChris Robinson2017-02-071-17/+17
|
* Avoid duplicating code using a macroChris Robinson2016-12-211-6/+1
|
* Use separate macros for atomics that don't take a memory orderChris Robinson2016-12-201-29/+32
|
* Fix an infinite loopChris Robinson2016-11-231-0/+1
|