Chris Robinson
f2875d5d13
Read in chunks of the fragment size, not expected buffer size
2008-02-12 21:19:09 -08:00
Chris Robinson
b0720333cc
UpdateSize is not used for capture devices
2008-02-12 19:50:49 -08:00
Chris Robinson
c3446a10fa
Rename UpdateFreq device field to UpdateSize
2008-02-12 19:38:27 -08:00
Chris Robinson
fbc869eed7
Pretend DSound buffer fragment size is 1/4th the total buffer size
2008-02-12 19:24:08 -08:00
Chris Robinson
e3e4dbbccf
Make the backend list static
2008-02-11 17:24:04 -08:00
Chris Robinson
7fda645b16
Call InitAL at the start of some more ALC functions
2008-02-11 17:23:31 -08:00
Chris Robinson
ec7f20644d
Fast float-to-int function is no longer needed
2008-02-08 21:03:48 -08:00
Chris Robinson
3d5fa91703
Remove unnecessary casting
2008-02-08 21:01:05 -08:00
Chris Robinson
e8acfb069c
Remove explicit dependancy on ole32 and unused dxguid
2008-02-08 20:56:45 -08:00
Chris Robinson
4c38ed272d
Enumerate DirectSound devices
2008-02-08 20:46:34 -08:00
Chris Robinson
13a3fe8a7a
Remove unneeded device struct member
2008-02-08 19:41:47 -08:00
Chris Robinson
3dd3cd4ceb
Prevent overflow of the device lists
2008-02-08 15:33:26 -08:00
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
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
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
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
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
8ad16145f6
Make sure sources are deleted with the context
2008-01-16 13:27:15 -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
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
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
b95fcf5da1
Store effect slots in the context
2008-01-15 16:22:39 -08:00