Commit Graph

1109 Commits

Author SHA1 Message Date
Chris Robinson
db80f682c9 Clean a couple debug messages 2008-01-19 21:41:09 -08:00
Chris Robinson
e1cdbac5a0 Close ALC first when exiting since devices might've been running when deleting stuff 2008-01-19 20:58:50 -08:00
Chris Robinson
543eb9d217 Don't use a multiple lists for extensions 2008-01-19 20:02:40 -08:00
Chris Robinson
bc963463f3 Add an option for setting the max number of sources 2008-01-19 19:38:06 -08:00
Chris Robinson
86b7b3d54b Remove duplication of setting the max source count 2008-01-19 19:28:34 -08:00
Chris Robinson
799ba1f954 Use less ambiguous config file names 2008-01-19 18:18:14 -08:00
Chris Robinson
1a3e39e452 Remove some unnecessary duplicate math, which was making long lines 2008-01-19 00:49:05 -08:00
Chris Robinson
7dc73815ae Remove some branches 2008-01-18 21:39: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
1b9d740244 Remove duplicated source freeing code 2008-01-18 00:56:01 -08:00
Chris Robinson
497ada9c77 Buffer size fixes. Partially reverts the ALSA buffer size "fix" 2008-01-18 00:28:25 -08:00
Chris Robinson
73e386dc6f Release effect slots when deleting sources 2008-01-17 21:17:08 -08:00
Chris Robinson
43cfc097de Don't dereference ALContext if there's no context yet
Patch by Evgeny A. Marchenko
2008-01-17 12:57:22 -08:00
Chris Robinson
6735fc7911 Add missing config.h includes 2008-01-16 14:09:04 -08:00
Chris Robinson
be34dbe608 Don't include alAuxEffectSlot.h in alSource.h 2008-01-16 14:01:24 -08:00
Chris Robinson
70102e7cd3 Fix debug comments 2008-01-16 13:58:10 -08:00
Chris Robinson
8ad16145f6 Make sure sources are deleted with the context 2008-01-16 13:27:15 -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
4742dedb45 Don't clamp wet gain if there's no send slot, and move slot gain calculation
To remove an extra if check
2008-01-16 13:00:35 -08:00
Chris Robinson
10a9bc62bf Store a reference to the effect slot in a source's send, not a copy 2008-01-16 12:43:25 -08:00
Chris Robinson
8cbbf17519 Allow getting and setting reverb parameters, as well as setting reverb effects
Reverb is still not implemented. The parameters just no-op for now.
2008-01-15 23:32:28 -08:00
Chris Robinson
24f433b938 Remove unneeded variables 2008-01-15 21:57:50 -08:00
Chris Robinson
abc69dd3d0 Use acosf when available 2008-01-15 21:23:14 -08:00
Chris Robinson
bf87aed459 Add reverb parameters 2008-01-15 20:32:20 -08:00
Chris Robinson
42306f93b3 Set default room rolloff factor 2008-01-15 19:59:19 -08:00
Chris Robinson
03ca50fa70 Use the previous low-pass filter again, as it seems to match the intended output better 2008-01-15 18:29:21 -08:00
Chris Robinson
7b1b8bd741 Set the default outer cone gainhf 2008-01-15 17:40:37 -08:00
Chris Robinson
a11f25e47b Fix source and buffer out-of-memory conditions 2008-01-15 16:30:43 -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
707e596811 Don't append _struct to the effect slot struct name 2008-01-15 16:01:27 -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
Chris Robinson
7edc576e9c Fix some copy/paste errors 2008-01-15 15:37:54 -08:00
Chris Robinson
0041a09576 Move include so win32 gets it too, and remove unnecessary line 2008-01-15 12:45:24 -08:00
Chris Robinson
0f06254ecf Use a string for the detected backends, instead of a list 2008-01-15 12:43:43 -08:00
Chris Robinson
ff5245ca8a Reword the backend options' text 2008-01-15 12:30:20 -08:00
Chris Robinson
fe925ada59 Fix use of variables in checks 2008-01-15 12:25:51 -08:00
Chris Robinson
b6596f38b9 Use CMAKE_BUILD_TYPE instead of custom options for compile modes 2008-01-15 10:00:56 -08:00
Chris Robinson
16fb3f6db5 Check for strncasecmp or _strnicmp 2008-01-14 16:30:18 -08:00
Chris Robinson
a2e2522612 Let alIsExtensionPresent work with mixed-case extension names 2008-01-14 16:26:22 -08:00
Chris Robinson
df07e8a65b Add support for AL_LOKI_quadriphonic 2008-01-14 16:11:15 -08:00
Chris Robinson
729f076c3b Reduce indentation 2008-01-14 15:38:15 -08:00
Chris Robinson
dfc0118b8b Add an option for disabling ALSA mmap 2008-01-14 15:30:52 -08:00
Chris Robinson
d9ef062caf Avoid busy waiting when waiting for suspend to clear 2008-01-14 13:23:49 -08:00
Chris Robinson
2b8ce3b4cf Let the mmap thread start the pcm stream when it's full
Instead of filling it with silence and starting it before the thread is active
2008-01-14 13:07:41 -08:00
Chris Robinson
a27b855a39 Make sure the stream is playing when it's full 2008-01-14 12:59:44 -08:00
Chris Robinson
1634b69faf Don't restart the stream right after preparing it
It needs to be filled, first
2008-01-14 12:51:36 -08:00
Chris Robinson
59fa1f90d5 Don't attempt to recover the ALSA stream when filling silence
Since it was just prepared, any error would likely mean bigger problems
2008-01-14 12:49:21 -08:00
Chris Robinson
e519338a2b Add missing stdio include 2008-01-14 10:55:13 -08:00