Commit Graph

503 Commits

Author SHA1 Message Date
Chris Robinson
e1965fe7d9 Convert CR/LF -> LF
Spotted by Alam Arias
2010-03-18 14:23:31 -07:00
Chris Robinson
0fee20a415 Simplifiy verification loops 2010-03-17 20:16:02 -07:00
Chris Robinson
2e6c5e590f Remove old comment 2010-03-17 19:28:01 -07:00
Chris Robinson
9d4e715ee7 Don't return unsupported effects from alGetEnumValue 2010-03-17 19:20:52 -07:00
Chris Robinson
932e5ec9b8 The enums are the same as with mcforamts, so advertise AL_EXT_MULAW too 2010-03-17 19:15:51 -07:00
Chris Robinson
af5fb1d535 Remove unnecessary assert 2010-03-17 19:04:02 -07:00
Chris Robinson
2953daebf5 GetSourceOffset can't fail 2010-03-17 15:19:00 -07:00
Chris Robinson
dd82b68175 Handle source offsets for muLaw formats 2010-03-17 15:15:12 -07:00
Chris Robinson
05a081a7b8 Allow selecting databuffer 0 2010-03-17 14:04:25 -07:00
Chris Robinson
9c417d33cc clock_gettime is available only when _POSIX_TIMERS is greater than 0 2010-03-17 12:04:33 -07:00
Chris Robinson
975f92fc84 Remove unnecessary stop call 2010-03-16 21:29:55 -07:00
Chris Robinson
0097beb84c Remove unused variable 2010-03-16 21:12:36 -07:00
Chris Robinson
65e16cc8bb Remove unneeded checks 2010-03-16 20:29:01 -07:00
Chris Robinson
2687155200 Get rid of more alIs* calls 2010-03-16 20:23:46 -07:00
Chris Robinson
49321961e8 Effect and filter ID 0 is valid 2010-03-16 19:14:05 -07:00
Chris Robinson
65f43637ce Avoid some alIs* calls while under the context lock
Instead, use functions that verify the ID by searching the object list and
returning its handle
2010-03-16 18:54:36 -07:00
Chris Robinson
f37cfc486d Pass the context to alSetError 2010-03-16 17:35:51 -07:00
Chris Robinson
a337a59fb8 Use alext.h for extension definitions 2010-03-16 16:25:30 -07:00
Chris Robinson
ec917e8e2f Rename some struct members for consistency 2010-03-16 15:37:41 -07:00
Chris Robinson
89d84131a4 Avoid dereferencing a NULL buffer when unqueueing buffer 0 2010-03-15 16:10:21 -07:00
Chris Robinson
2033f60d24 Print an error when realloc fails 2010-03-15 14:28:38 -07:00
Chris Robinson
6c5f1b78d7 Reduce the mixing buffers to the next power of two 2010-03-14 03:30:42 -07:00
Chris Robinson
1f2d3a0132 Remove duplication of setting source angles 2010-03-14 03:23:18 -07:00
Chris Robinson
c23e4ed412 Add support for AL_EXT_DOUBLE 2010-03-13 21:32:45 -08:00
Chris Robinson
8c0118e7ae Add support for AL_EXT_MULAW_MCFORMATS 2010-03-13 21:03:34 -08:00
Chris Robinson
b734cab6fc Fix the retrieval of the RW offsets using the correct functions 2010-03-10 07:33:30 -08:00
Chris Robinson
08b1bed38b Remove a couple incorrect comments 2010-03-10 07:16:53 -08:00
Chris Robinson
98f4f5a4f0 Add EFX types and enums to alext.h
The types and enums are in efx.h, which is included by alext.h. It's done this
way because EFX has a lot if definitions which would polute alext.h
2010-03-09 09:28:22 -08:00
Chris Robinson
1f10195c47 Use powf when available 2010-03-07 22:12:33 -08:00
Chris Robinson
dc40702b53 Remove unused source param count macro 2010-03-07 21:48:25 -08:00
Chris Robinson
365a62d63a Improve source write offset calculations 2010-02-07 20:11:24 -08:00
Chris Robinson
f22b02a762 al_print doesn't need to be inline 2010-01-12 09:05:57 -08:00
Chris Robinson
0c2efa1253 Use GCC's format attribute for al_printf 2010-01-12 08:48:25 -08:00
Chris Robinson
5921e18be2 Fix some typos with the solaris backend 2010-01-12 08:28:07 -08:00
Chris Robinson
35ba7d70dc Consolidate some source offset handling code 2010-01-12 02:43:37 -08:00
Chris Robinson
026b4b8f4c Better handle large second offsets 2010-01-12 02:26:38 -08:00
Chris Robinson
c924a50bed Don't use a flag to set an error when applying the source offset 2010-01-12 02:22:38 -08:00
Chris Robinson
574792d2e1 Fix Windows compilation 2010-01-11 23:47:03 -08:00
Chris Robinson
3d7f925d52 Add helpful values to the resampler enum 2010-01-11 07:02:29 -08:00
Chris Robinson
93b584ff84 Add a cosine resampler 2010-01-11 06:19:54 -08:00
Chris Robinson
705849ca73 Add an option for point resampling 2010-01-11 05:37:20 -08:00
Chris Robinson
7ee81eac0f Store ALC errors with the device when possible 2009-12-28 23:19:13 -08:00
Chris Robinson
69ab93a824 Add a function to check if a config option is set to a non-empty value 2009-12-28 13:08:15 -08:00
Chris Robinson
6e9ce47a4b GetConfigValueBool should take an int, not a float 2009-12-26 07:42:57 -08:00
Chris Robinson
88de4e15b3 Mark the source for updating when setting a buffer on it
Changing the buffer can change the playback format, which can require different
source parameter calculations. Queueing a buffer on a source that has no
buffers (or only buffers without a format, eg. buffer 0) has the same effect
2009-12-25 05:09:29 -08:00
Chris Robinson
7f0c6629b9 Use a 64-bit value to scale potentially-large numbers 2009-12-24 15:41:45 -08:00
Chris Robinson
2b7953c472 Track whether a context is suspended or not 2009-12-09 12:14:53 -08:00
Chris Robinson
bd696a6b37 Fix IMA ADPCM offset calculation 2009-12-09 09:50:09 -08:00
Chris Robinson
656a406377 Use an inline function to calculate the low-pass filter coefficient 2009-12-09 07:21:59 -08:00
Chris Robinson
84d2d623b6 Add a head-dampening option
This simulates occlusion of the player's head for sounds coming from behind,
when outputing to mono or stereo
2009-12-08 14:18:07 -08:00
Chris Robinson
4697e946d3 Internally store 32-bit float buffer data, and mix accordingly 2009-12-07 10:35:30 -08:00
Chris Robinson
9286e3984c Move default channel order setting out of the header 2009-12-07 04:19:33 -08:00
Chris Robinson
d4427c54ea Change internal order to match WFX 2009-12-07 00:51:27 -08:00
Chris Robinson
92ade80557 Fix 6.1 channel order 2009-12-07 00:49:56 -08:00
Chris Robinson
58ecc7fad4 Check for potential NULL accesses with the IsBadWritePtr wrapper 2009-12-04 01:33:50 -08:00
Chris Robinson
c1eb444a39 Remove some assumptions of 16-bit internal storage 2009-12-02 05:55:33 -08:00
Chris Robinson
b5270e0bb3 Use a channel-map to specify the output device channel order 2009-12-02 04:03:51 -08:00
Chris Robinson
6cfc31777b Add an option for real-time priority mixing
Default to disable for now, as a safety precaution
2009-12-01 23:15:09 -08:00
Chris Robinson
f63d8dbf38 Enable real-time priority for ALSA, OSS, and DirectSound mixing loops 2009-11-29 23:02:21 -08:00
Chris Robinson
d930fb8d3d Call the Update effect method for null effects 2009-11-28 20:09:41 -08:00
Chris Robinson
3ec64eb0fd Call to the right databuffer function 2009-11-28 19:37:29 -08:00
Chris Robinson
d81c9819b8 Remove unnecessary returns 2009-11-28 19:36:05 -08:00
Chris Robinson
98ce1d14c1 Update AL_EXTX_source_distance_model to require explicit enabling
The in-progress spec has been updated to reflect this
2009-11-27 20:05:21 -08:00
Chris Robinson
69f9ab88b9 Send multi-channel sources to auxiliary effect slots
They are downmixed to mono using a volume-preserving scalar, and passed
through a 1-pole low-pass filter (not chained)
2009-11-26 00:39:32 -08:00
Chris Robinson
658923175f Update source parameters only when they need changing 2009-11-25 16:21:47 -08:00
Chris Robinson
06bbee2449 Add a function for 1-pole filtering 2009-11-22 21:20:27 -08:00
Chris Robinson
8d1da6a8ca Move NextPowerOf2 to alMain.h 2009-11-19 09:50:15 -08:00
Chris Robinson
ff8e09495d Move aluCart2LUTpos to alu.h 2009-11-19 09:24:35 -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
dcd6a55529 Use a realtime clock for measuring time 2009-11-01 10:03:05 -08:00
Chris Robinson
a3fcd67a82 Remove some unneeded buffer fields, make padding a constant amount 2009-10-25 08:31:28 -07:00
Chris Robinson
fe3a43e2d4 Remove the format and frequency from the source, get them manually 2009-10-25 06:26:19 -07:00
Chris Robinson
b0a82aa420 Store the buffer format and frequency in the source when updated 2009-10-25 05:03:22 -07:00
Chris Robinson
1665595138 Remove unneeded bufferlistitem properties 2009-10-25 02:59:31 -07:00
Chris Robinson
bbccf76b45 Dereference left over buffers and slots when sources are released 2009-10-24 07:09:44 -07:00
Chris Robinson
921e7ac3e9 Store the buffer handle directly in the source and buffer queue list 2009-10-22 09:31:26 -07:00
Chris Robinson
8d807add41 Store the bufferID in the buffer struct 2009-10-22 08:53:59 -07:00
Chris Robinson
8501fce38b Remove unused source fields 2009-10-21 15:40:09 -07:00
Chris Robinson
8dbac9c0bd Store the calculated source parameters in the source struct 2009-10-21 14:25:54 -07:00
Chris Robinson
75b65ab2a2 Remove the Frequency field from the context 2009-10-20 13:47:55 -07:00
Chris Robinson
93361118b7 Store a device's contexts in a dynamic array 2009-10-20 11:54:04 -07: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
c7c4cf221a Make the dry buffer part of the device 2009-10-09 01:06:33 -07:00
Chris Robinson
d6e439244a Rename SetALCError for consistency 2009-10-07 04:32:14 -07:00
Chris Robinson
af8e7ab984 Check the source start position in alSourcePlayv instead of the mixer 2009-09-24 12:24:10 -07:00
Chris Robinson
4cd41e3e08 Don't allow setting an invalid auxiliary send 2009-09-21 23:09:31 -07:00
Chris Robinson
cbcaa54173 Store the number of periods in the device instead of the buffer size
Also keep all the fields in sync
2009-09-16 22:58:54 -07:00
Chris Robinson
94e3fca702 Remove unnecessary parameters, and rename methods 2009-09-16 00:24:44 -07:00
Chris Robinson
49648fe22d Make a GetConfigValueBool function and use it 2009-09-15 22:18:13 -07:00
Chris Robinson
9f037e8980 Pass the device to aluMixData 2009-09-15 19:30:27 -07:00
Chris Robinson
12f81bcbb9 Move the stereo-to-binaural filter to the device 2009-09-15 19:06:47 -07:00
Chris Robinson
f9d228c30a Add missing context checks 2009-09-12 20:22:03 -07:00
Chris Robinson
59ed9338d8 Add support for the in-progress ALC_EXT_thread_local_context extension 2009-09-12 16:45:46 -07:00
Chris Robinson
bb121e68a6 Rebuild device lists when retrieving them 2009-08-27 06:09:33 -07:00
Chris Robinson
6bb14e45ce Store a copy of the device name in the device 2009-08-27 02:53:09 -07:00
Chris Robinson
45dc804819 Store copies of the device names in the individual backends 2009-08-27 01:47:41 -07:00
Chris Robinson
81db01ebf1 Add a method to deinitialize backends 2009-08-26 23:45:00 -07:00
Chris Robinson
7976de05a5 Add base support for ALC_EXT_disconnect
Individual backends need to be updated to handle disconnection events
2009-08-26 19:15:17 -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
decbe4df45 Modify some context checks 2009-08-16 15:09:36 -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
0b5a0d1e79 Reset the target if the databuffer being deleted is currently selected 2009-08-16 11:12:13 -07:00
Chris Robinson
0b7eb9f118 Add in-progress working extension AL_EXTX_sample_buffer_object 2009-08-16 00:54:08 -07:00
Chris Robinson
510ccc7f17 Store the effect and filter lists in the device 2009-08-15 09:39:18 -07:00
Chris Robinson
43067ed2b8 Store the buffer list in the device 2009-08-15 09:14:08 -07:00
Chris Robinson
e079291202 Remove unnecessary function parameters 2009-08-13 19:36:14 -07:00
Chris Robinson
243939f94f Allow delaying playback start until context creation, and don't use UpdateSize to store the buffer size
This will make it possible to support the context attributes (frequency,
refresh, etc) for some backends
2009-08-13 12:28:46 -07:00
Chris Robinson
32060f53cd Reset the buffer played count when the queue is removed via the AL_BUFFER property 2009-08-11 14:16:30 -07:00
Chris Robinson
4ee3972f15 Update queued buffer states when source looping is toggled 2009-08-11 07:57:18 -07:00
Chris Robinson
00a9cf4a85 Remove more unneeded variables 2009-07-07 21:11:13 -07:00
Chris Robinson
1dcd538ad9 Remove unneeded variables 2009-07-07 21:01:41 -07:00
Chris Robinson
0ac9e57d28 Store the requested mono/stereo source count and sends in the device
Although the properties are set as context attributes, they are queried from
the device. If multiple contexts per device are ever supported, it would not
be straight forward about where to read the values from. This way, the
attributes can be treated as device-specific attributes that are updated when
a new context is created.
2009-07-06 03:09:01 -07:00
Chris Robinson
c6f3a4e062 Move a couple inline functions into the header 2009-06-07 20:16:41 -07:00
Chris Robinson
1454c46b5f Use a thread-safe static inline function for printing 2009-06-07 15:42:15 -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
f3a3358e63 Fix for MSVC
MSVC won't accept zero-sized arrays at the end of structs, if that struct is
used in another struct that's not also at the end. This wastes a float for each
FILTER object
2009-06-06 23:33:53 -07:00
Chris Robinson
3c122b0bef Set an error if effect creation fails 2009-05-31 11:54:49 -07:00
Chris Robinson
7940003d06 Set an error if NaN is given for panning values 2009-05-31 11:34:07 -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
e12ac95d69 Use the MIN/MAX/DEFAULT macros for checking and setting the effect parameters 2009-05-29 12:40:08 -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
ac04cf57fa Make sure _CRT_SECURE_NO_WARNINGS is always defined for MSVC 2009-05-26 06:02:40 -07:00
Chris Robinson
1bfa7609d2 Make the filter functions global inline, and use it for echo 2009-05-16 23:34:26 -07:00
Chris Robinson
7e8501123a Set some common macros in alu.h 2009-05-16 23:26:39 -07:00
Chris Robinson
7a7a4844f4 Make the filter history buffer size flexible
This lets the filter history buffer be as big as needed for a given use, so
that it can have a size large enough for the more demanding cases, but not be
wasteful for lesser-demanding cases, while not incuring the overhead of an
added pointer indirection
2009-04-16 05:43:09 -07:00
Chris Robinson
a2adbb1ab5 Add a PulseAudio backend 2009-04-16 05:17:42 -07:00
Chris Robinson
a97fc792d8 Increase the default maximum number of sends to 2 2009-04-14 22:18:47 -07:00
Chris Robinson
f245f0ef87 Make the number of source sends variable
The highest value is clamped to MAX_SENDS
2009-04-13 20:33:41 -07:00
Chris Robinson
55c790c9ff Add the Echo effect 2009-04-12 16:01:10 -07:00
Chris Robinson
c67fbd72dd Pay attention to the MAX_SENDS value 2009-04-11 20:04:46 -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
8d0c4ccb3b The room rolloff factor can go up to 10 2009-03-13 02:12:45 -07:00
Chris Robinson
7ebb28327f Remove the SDL backend 2009-03-10 01:03:39 -07:00
Chris Robinson
86931cbde4 Add a PortAudio backend 2009-03-10 00:55:29 -07:00
Chris Robinson
1f4c69c17a Use a matrix for up- and down-mixing channels 2009-01-25 22:11:07 -08:00
Chris Robinson
98e86decad 6.1 uses front- and back-center, not left- and right-back channels 2009-01-24 15:13:14 -08:00
Chris Robinson
778b74cae1 Reimplement panning using lookup tables, based on a patch by Christian Borss
This allows speaker positions to be specified by discrete angles around the
listener, providing more flexibility and configurability in placement.
Additional patches to take advantage of this are forthcoming.
2009-01-24 10:38:04 -08:00
Chris Robinson
3056f91ec5 Apply the dry filter to multi-channel sources
Unlike mono sources, they use 2 chained one-pole filters instead of 4
2008-12-10 11:54:13 -08:00
Chris Robinson
8b54d59b8c Add an SDL backend 2008-12-07 01:05:39 -08:00
Chris Robinson
55b9ccc2de Implement AL_EXTX_source_distance_model
As with other EXTX extensions, this is subject to change and removal as the
spec gets worked on
2008-11-25 18:56:10 -08:00
Chris Robinson
482b160c8a Remove unneeded macro 2008-11-16 01:07:39 -08: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
d72b132c57 Add an option to disable specific EFX effect types 2008-11-14 07:13:59 -08:00
Chris Robinson
010f7d12f4 Don't ramp gains when starting a sound from the beginning 2008-11-13 05:48:38 -08:00
Chris Robinson
da684564ea Avoid unnecessary floating-point math 2008-11-11 17:59:55 -08:00
Chris Robinson
fc4c867f27 Add initial AL_EXTX_buffer_sub_data support
Note that this is an in-development extension, as noted by the EXTX moniker
instead of EXT. It's behavior is subject to change, and the extension string
will be removed (replaced with the official string once it's finalized).
Developers are discouraged from using this in production code, though feel
free to play around with it.
2008-11-11 05:57:32 -08:00
Chris Robinson
15334e56cd Be more flexible with channel count when loading IMA4 data 2008-11-02 15:30:56 -08:00
Chris Robinson
ffa42ff22c Seperate data converters into reusable functions 2008-11-02 01:24:57 -07:00
Chris Robinson
a7c62dbabc More padding fixes 2008-11-01 16:37:32 -07:00
Chris Robinson
eda1e41152 More buffer conversion refactoring 2008-11-01 16:35:16 -07:00
Chris Robinson
af5a5b76ec Padding is not dependant on the frequency cutoff anymore 2008-10-31 23:32:28 -07:00
Chris Robinson
87f3a0dc16 Restructure buffer data conversion code a bit 2008-10-31 22:13:35 -07:00
Chris Robinson
301a4c4a95 Append the driver and its version to the AL version string 2008-10-25 15:48:17 -07:00
Chris Robinson
59a71b1454 Remove another unused source member 2008-10-10 01:31:31 -07:00
Chris Robinson
bfa1107781 Remove unneeded source member variable 2008-10-09 23:44:48 -07:00
Chris Robinson
11397f7667 Commit missing changes 2008-10-09 20:58:12 -07: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
6567cdd7b5 Air absorption factor is applied to the dB value, not linear gain 2008-09-22 17:01:47 -07:00
Chris Robinson
6bfdb57a5b Use a 12dB/oct rolloff instead of 24 for the lowpass filter 2008-09-13 02:46:14 -07:00
Chris Robinson
16d96eed7b Add a Solaris playback backend 2008-09-07 14:34:14 -07:00
Chris Robinson
5f3329b2c9 Don't export extension function symbols from the lib 2008-09-06 13:45:27 -07:00
Chris Robinson
db541f3cfa Remove unneeded source struct member 2008-08-15 17:43:07 -07:00
Chris Robinson
3e19ba6ca8 Clear channel volumes when starting a source 2008-08-15 16:33:47 -07:00
Chris Robinson
084df2a229 Allow setting the EFX doppler factor source property 2008-08-14 16:14:16 -07:00
Chris Robinson
22557070ec Ramp channel gains to remove pops and clicks from abrupt changes
Thanks to Christopher Fitzgerald for helping me work on it
2008-08-14 05:43:52 -07:00
Chris Robinson
f8ef66954c Include fenv.h if it exists for fesetround 2008-08-08 08:12:41 -07:00
Chris Robinson
8621fbb015 Improve getting and setting EFX filter parameters 2008-07-26 18:32:45 -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
3e0f9cc716 Make the filter processing function inline 2008-07-26 00:58:54 -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
e2ed8ff2bf Use a temp pointer when realloc()ing
So the original data isn't lost on out-of-memory conditions
2008-07-24 13:44:26 -07:00
Chris Robinson
559c786d0c Specify padding per buffer, and make sure it's large enough for the filter step 2008-07-24 00:41:25 -07:00
Chris Robinson
a75e75aef5 Implement an alternative low-pass filter
This method samples from the buffer so that it gets a time-correct 5khz stream,
which is subtracted from the original sample and has the high-frequency gain
applied, then added back.
A better method may be to average all the samples from the current one to the
one freq/5000 away, instead of bilinear filtering the two nearest freq/5000
apart. Processing cost will need to determine its viability
2008-07-23 22:29:53 -07:00
Chris Robinson
93c0f61050 Clarify implicit destruction warnings 2008-07-22 14:29:27 -07:00
Chris Robinson
87b5d7bc7b Store extension list with a pointer, not a per-context array 2008-07-22 12:39:10 -07:00
Chris Robinson
e66bb09156 Move (de)initialization into ALc.c and remove unneeded file 2008-07-17 18:38:07 -07:00
Chris Robinson
0042b1f80d Implement doppler factor source property 2008-07-15 02:33:05 -07:00
Chris Robinson
97d3a45aff Don't check the number of objects being deleted with the number currently allocated
Since apps can validly delete buffer 0, and delete the same source/buffer multiple times in a single call
2008-07-11 09:12:11 -07:00
Chris Robinson
cad9b367a5 Use pthread_mutexattr_setkind_np as a fallback to set a recursive mutex type
Some systems (FreeBSD) don't like setting it through pthread_mutexattr_settype
2008-05-15 21:35:51 -07:00
Chris Robinson
28093a6dcb constify the pointer that holds the filename 2008-03-22 19:05:00 -07:00
Chris Robinson
2af5498804 Define _WIN32_WINNT to 0x0500 when including windows.h
VC7 appears to require that value, or higher, set and fails otherwise
2008-03-01 01:39:42 -08: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
8c3188bc7d Remove FrameSize struct member 2008-02-14 22:05:56 -08:00
Chris Robinson
c3446a10fa Rename UpdateFreq device field to UpdateSize 2008-02-12 19:38:27 -08:00
Chris Robinson
acbb4f8e6c Include alext.h instead of redefining some enums 2008-02-08 19:55:51 -08:00
Chris Robinson
13a3fe8a7a Remove unneeded device struct member 2008-02-08 19:41:47 -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
5f1c0450b3 Remove unnecessary Channels field 2008-01-25 16:38:37 -08:00
Chris Robinson
b5a2baafe5 Remove effect slot thunk entry when deallocated forcefully 2008-01-21 15:34:38 -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
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
73e386dc6f Release effect slots when deleting sources 2008-01-17 21:17:08 -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
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
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
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
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
e519338a2b Add missing stdio include 2008-01-14 10:55:13 -08:00
Chris Robinson
7a4870bd97 Close dangling devices when exiting 2008-01-14 10:54:33 -08:00
Chris Robinson
29c6238b52 Keep track of open devices 2008-01-14 10:39:54 -08:00
Chris Robinson
3bbbf8a025 Merge branch 'master' into efx-experiment 2008-01-11 17:19:08 -08:00
Chris Robinson
f10408739e Add a wave file writing backend 2008-01-11 09:32:22 -08:00
Chris Robinson
e1d0ad749b Use nanosleep instead of usleep
So not to rely on the non-standard unistd.h header
2008-01-11 08:15:44 -08:00
Chris Robinson
2a5a5b5c1b Add Sleep wrapper 2008-01-11 06:54:09 -08:00
Chris Robinson
a97ecb8690 Add a timing wrapper, using gettimeofday 2008-01-11 06:01:51 -08:00
Chris Robinson
298f6f440a Add missing header include 2008-01-06 01:15:44 -08:00
Chris Robinson
5e48be27b8 Merge branch 'master' into efx-experiment 2008-01-04 14:40:38 -08:00
Chris Robinson
8fe39042da Add the Bauer stereophonic-to-binaural DSP (bs2b) code and hooks 2008-01-03 05:36:51 -08:00
Chris Robinson
3d78d93b40 Merge branch 'master' into efx-experiment 2007-12-31 19:34:52 -08:00
Chris Robinson
9382956b0e Remove obsolete comment 2007-12-31 06:00:50 -08:00
Chris Robinson
1397417fcd Handle AL_FORMAT_REAR* formats 2007-12-31 05:46:20 -08:00
Chris Robinson
c9a539eade Allow loading of 4, 5.1, 6.1, and 7.1 sample data 2007-12-31 05:06:59 -08:00
Chris Robinson
79b95da0a3 Check specific formats before general properties 2007-12-31 02:57:58 -08:00
Chris Robinson
1c85273662 Export float32 formats 2007-12-31 02:55:35 -08:00
Chris Robinson
76dd568971 Add some more formats 2007-12-31 02:53:56 -08:00
Chris Robinson
7a99b1fa32 Make some defines local to ALu.c 2007-12-31 01:16:13 -08:00
Chris Robinson
e82c27ab04 Fix includes so alMain.h doesn't include so much by itself 2007-12-31 01:09:57 -08:00
Chris Robinson
f32098e04d Don't append _struct to the source struct name 2007-12-31 01:09:21 -08:00
Chris Robinson
1e0fa58d79 Remove unused macros 2007-12-31 00:52:34 -08:00
Chris Robinson
1061108c61 Remove some duplication 2007-12-28 22:56:48 -08:00
Chris Robinson
5f8e65e099 Implement AL_EXT_FLOAT32 2007-12-28 22:41:14 -08:00
Chris Robinson
87615fffc9 Consolidate buffer loading/conversion a bit 2007-12-28 20:25:18 -08:00
Chris Robinson
8343a98ec6 Avoid a couple explicit format checks for buffers 2007-12-28 19:21:21 -08:00
Chris Robinson
d7bf7a8b0d Don't rely on the exact formats as much for sources 2007-12-28 18:53:46 -08:00
Chris Robinson
ab8d342df0 Allow 5.1 channel output
This doesn't use the center or LFE channel in spatial calculations, however
2007-12-26 23:01:22 -08:00
Chris Robinson
e516b3c0d3 Prevent possible buffer overflow in AL_PRINT 2007-12-22 14:00:10 -08:00