233 Commits

Author SHA1 Message Date
Chris Robinson
80fcbc8adc Use all capture devices listed by ALSA, not just the first on each card 2008-02-08 15:22:17 -08:00
Chris Robinson
33680accea Don't remove the devices from the device list on unexpected shutdown
The close functions will remove it for us
2008-02-08 14:44:05 -08:00
Chris Robinson
081e593e2b Set the done flag immediately when entering the initialization
To prevent two threads from initializing at the same time (not that it's
likely to happen at this point).
2008-02-06 22:22:29 -08:00
Chris Robinson
b4ffdfab81 Add an option for duplicating stereo sources on the back speakers 2008-02-06 22:18:50 -08:00
Chris Robinson
1ea4aac799 Add an alext.h header 2008-02-06 20:53:00 -08:00
Chris Robinson
4d6c292757 Fix race condition when starting winmm message poll thread 2008-02-03 00:28:00 -08:00
Chris Robinson
655a83c5c5 Use WAVEFORMATEXTENSIBLE for multichannel dsound output, and don't create a primary buffer 2008-02-01 08:17:57 -08:00
Chris Robinson
e8b576bc25 Use the correct channel ordering for Windows 2008-01-27 07:04:13 -08:00
Chris Robinson
01404ed7af Fix output channel order for 6.1 and 7.1 2008-01-27 06:49:48 -08:00
Chris Robinson
ad6237f6f7 Fix availibility amount calculation 2008-01-26 21:10:55 -08:00
Chris Robinson
d06c64e1c4 aluBytesFromFormat returns bytes, not bits 2008-01-26 21:09:08 -08:00
Chris Robinson
b4ad3186dd Update frame size after detecting the directsound output format 2008-01-25 17:05:14 -08:00
Chris Robinson
5f1c0450b3 Remove unnecessary Channels field 2008-01-25 16:38:37 -08:00
Chris Robinson
04b62f77e3 Set the output format according to the speaker setup reported by directsound 2008-01-25 05:02:00 -08:00
Chris Robinson
029dff3f40 Use both write pointers from the directsound buffer lock 2008-01-25 04:42:44 -08:00
Chris Robinson
342f639771 Release 1.2.218 2008-01-21 18:43:14 -08:00
Chris Robinson
b5a2baafe5 Remove effect slot thunk entry when deallocated forcefully 2008-01-21 15:34:38 -08:00
Chris Robinson
781e4e5be4 Remove an unneceesary pointer check and decrease indentation 2008-01-21 14:54:15 -08:00
Chris Robinson
f3dddb5e99 Remove unnecessary duplicate thunk lookups 2008-01-21 14:33:42 -08:00
Chris Robinson
9a5e892cad Small formatting updates 2008-01-20 22:16:28 -08:00
Chris Robinson
0317362662 Remove duplicate function 2008-01-20 19:22:39 -08:00
Chris Robinson
6b403a76e8 Don't access ALSource for every sample mix 2008-01-20 19:20:24 -08:00
Chris Robinson
6bf6c6fb7b More overflow protection 2008-01-20 13:27:54 -08:00
Chris Robinson
29618bee10 Prevent float samples from overflowing when converting to 16-bit 2008-01-20 00:43:02 -08:00
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