Chris Robinson
8a1d5a21c3
Reduce some indentation
2010-09-21 15:12:08 -07:00
Chris Robinson
301a8ba3a4
Improve some range checks
2010-09-21 14:41:43 -07:00
Chris Robinson
e5cae87502
Handle clicks by watching changes between updates
2010-08-16 14:53:21 -07:00
Chris Robinson
00525274a0
Add click removal for wet sends
2010-08-15 14:52:12 -07:00
Chris Robinson
4edd7fe647
Use a map for the effects list
2010-05-18 17:41:06 -07:00
Chris Robinson
af4faaf666
Use a UIntMap for the effect slot list
2010-05-12 02:20:14 -07:00
Chris Robinson
0378422fcb
Use a map to store sources and buffers
...
And do a lookup using a binary search instead of linear
2010-05-01 19:59:41 -07:00
Chris Robinson
b273d616ad
Implement a skeleton Ring Modulator effect
2010-04-08 08:54:28 -07:00
Chris Robinson
7bdf0d5156
Shorten some variable names
2010-03-26 00:41:27 -07:00
Chris Robinson
f77832fea2
Remove unnecessary NULL check
2010-03-24 03:43:37 -07:00
Chris Robinson
3e9934e810
Mark extension functions with AL_API/ALC_API
2010-03-23 17:44:01 -07:00
Chris Robinson
49db3bf916
Cleanup and fixup Release* functions
2010-03-20 21:49:02 -07:00
Chris Robinson
99f28f25b0
Avoid calling alDelete* from alGen*
2010-03-20 21:38:05 -07:00
Chris Robinson
2687155200
Get rid of more alIs* calls
2010-03-16 20:23:46 -07:00
Chris Robinson
f37cfc486d
Pass the context to alSetError
2010-03-16 17:35:51 -07:00
Chris Robinson
ec917e8e2f
Rename some struct members for consistency
2010-03-16 15:37:41 -07:00
Chris Robinson
d930fb8d3d
Call the Update effect method for null effects
2009-11-28 20:09:41 -08:00
Chris Robinson
658923175f
Update source parameters only when they need changing
2009-11-25 16:21:47 -08:00
Chris Robinson
c1b161b44b
Handle NULL effect objects as AL_EFFECT_NULL effects
2009-11-05 20:50:56 -08:00
Chris Robinson
aa84b2e328
Handle setting AL_EFFECT_NULL effect types on a slot
2009-11-05 18:22:43 -08:00
Chris Robinson
f14cf8289e
Add a method to update device-dependant effect parameters.
...
The effect state's update method will be called afterwards
2009-10-20 08:31:44 -07:00
Chris Robinson
6d1d61026d
Be context-agnostic in the effect Create functions
...
This allows the effect Update functions to handle the playback frequency being
changed. By default the effects assume a maximum frequency of 192khz, however,
it can go higher at the cost of the sample buffers being cleared and the risk
of an abort() if reallocation fails
2009-10-19 07:46:53 -07:00
Chris Robinson
487f0dde75
Print source and auxiliary slot debug warnings from alcDestroyContext
2009-08-16 16:11:22 -07:00
Chris Robinson
c8f700930a
More modifications and fixes for context checks
2009-08-16 16:02:13 -07:00
Chris Robinson
462f27c129
Use a function to retrieve the current context in an already-locked state
...
This should help prevent race-conditions with a context being destroyed between
breing retrieved and locked
2009-08-16 14:09:23 -07:00
Chris Robinson
0fac1e9115
Store the max number of auxiliary slots in the device
2009-06-07 14:53:22 -07:00
Chris Robinson
3c122b0bef
Set an error if effect creation fails
2009-05-31 11:54:49 -07:00
Chris Robinson
2c20f26784
Apply slot gain on slot output, not input
2009-05-29 16:51:00 -07:00
Chris Robinson
74dc7090fd
Don't expose effect-specific structures
2009-05-29 13:30:50 -07:00
Chris Robinson
34ea7eba9e
Add preliminary support for the EAX Reverb effect
...
Not all parameters are supported yet, though it is a little more fuctional than
standard reverb
2009-05-29 01:32:54 -07:00
Chris Robinson
55c790c9ff
Add the Echo effect
2009-04-12 16:01:10 -07:00
Chris Robinson
30f57d0824
Make auxiliary effect slot count configurable
2009-04-11 18:16:05 -07:00
Chris Robinson
1c54018111
Move the WetBuffer into the effect slot object
...
This should make it easier to support multiple slots
2009-04-11 17:04:55 -07:00
Chris Robinson
c0ccd31a3e
Implement a new reverb effect
...
Code created and graciously provided by Christopher Fitzgerald
2008-11-16 00:29:49 -08:00
Chris Robinson
3863dcc9cb
Use a new low-pass filter, based on the I3DL2 spec
...
Many thanks to Christopher Fitzgerald, for helping with it
2008-10-02 22:20:42 -07:00
Chris Robinson
5f3329b2c9
Don't export extension function symbols from the lib
2008-09-06 13:45:27 -07:00
Chris Robinson
597e01153e
Use arrays instead of pointer-to-arrays for the low-pass filter
2008-07-26 17:13:50 -07:00
Chris Robinson
c7e49c9f57
Implement yet another low-pass filter
...
This one using the Butterworth IIR filter design
2008-07-25 19:31:12 -07:00
Chris Robinson
93c0f61050
Clarify implicit destruction warnings
2008-07-22 14:29:27 -07:00
Chris Robinson
847b3e8b61
Preserve data and position when reallocating the reverb effect
...
Still not perfect, but better for when the size doesn't change
2008-02-18 21:58:58 -08:00
Chris Robinson
b5a2baafe5
Remove effect slot thunk entry when deallocated forcefully
2008-01-21 15:34:38 -08:00
Chris Robinson
db80f682c9
Clean a couple debug messages
2008-01-19 21:41:09 -08:00
Chris Robinson
4caf2c7edd
Implement AL_EFFECT_REVERB
...
Here is a quick description of how the reverb effect works:
+--->---+*(4)
| V new sample
+-----+---+---+ |
|extra|ltr|ref| <- +*(1)
+-----+---+---+
(3,5)*| |*(2)
+-->|
V
out sample
1) Apply master reverb gain to incoming sample and place it at the head of the
buffer. The master reverb gainhf was already applied when the source was
initially mixed.
2) Copy the delayed reflection sample to an output sample and apply the
reflection gain.
3) Apply the late reverb gain to the late reverb sample
4) Copy the end of the buffer, applying a decay gain and the decay hf ratio,
and add to the late reverb.
5) Copy the late reverb sample, adding to the output sample.
Then the head and sampling points are shifted forward, and done again for each
new sample. The extra buffer length is determined by the Reverb Density
property. A value of 0 gives a length of 0.1 seconds (long, with fairly
distinct echos) , and 1 gives 0.075 seconds (short, indistinct echos).
The decay gain is calculated such that after a number of loops to satisfy the
Decay Time, a sample will be 1/32768th as powerful (virtually insignificant to
the resulting output, and only getting further reduced). It is calculated as:
DecayGain = pow(1.0f/32768.0f, 1.0/(DecayTime/ExtraLength));
Things to note: Reverb Diffusion is not currently handled, nor is Decay HF
Limit. Decay HF Ratios above 1 probably give incorrect results. Also, this
method likely sucks, but it's the best I can come up with before release. :)
2008-01-18 21:25:40 -08:00
Chris Robinson
6735fc7911
Add missing config.h includes
2008-01-16 14:09:04 -08:00
Chris Robinson
70102e7cd3
Fix debug comments
2008-01-16 13:58:10 -08:00
Chris Robinson
bb7b18d4e1
Keep track of references to effect slots, so they aren't deleted while in use
2008-01-16 13:20:09 -08:00
Chris Robinson
a6213ebfc7
Fix allocation of multiple effect slots, effects, and filters
2008-01-15 16:24:12 -08:00
Chris Robinson
b95fcf5da1
Store effect slots in the context
2008-01-15 16:22:39 -08:00
Chris Robinson
5678041b92
Remove errant line
2008-01-15 15:53:58 -08:00
Chris Robinson
7f850d8fb0
Make sure a valid context is set for effect slots
2008-01-15 15:53:06 -08:00