Chris Robinson
9fbd6c6c3f
Make the SourceMix function a method of the ALsource struct
2010-09-26 01:15:27 -07:00
Chris Robinson
08fdc5fa98
Avoid updating the source in MixSource
2010-09-25 23:49:57 -07:00
Chris Robinson
7e362249ff
Convert shorts so that 0 remains 0
2010-09-25 21:13:40 -07:00
Chris Robinson
9fa2db0227
Don't try to open the ALSA device a second time if the first fails
2010-09-25 20:20:10 -07:00
Chris Robinson
4c75a72a90
Avoid some code duplication
2010-09-25 20:18:07 -07:00
Chris Robinson
a0b2778161
Localize more variables and remove unnecessary ones
2010-09-25 14:19:36 -07:00
Chris Robinson
bc6d94cd25
Avoid sampling beyond the end of the loop
2010-09-24 23:32:50 -07:00
Chris Robinson
e70141e57b
Localize some variables to the mixer macros
...
The hope here is to help break the mixer loops into separate functions, so the
macro expansion doesn't cause the MixSource function to explode in size and
kill compilation speed.
2010-09-24 23:24:01 -07:00
Chris Robinson
2e70b82eaa
Use separate mixing loops for the dry path and wet paths
...
This will increase CPU use a bit for sources that use auxiliary sends
(particularly with the cosine resampler), but it makes it more scalable when
adding more sends per source. Additionally, it will improve performance of
sources that don't use auxiliary sends.
The cosine resampler can probably be improved by using a lookup table instead
of calling cos() as there are 14 bits of fractional precision, so a 16384-
element float array would cover it all. This can also be reduced to a half or
quarter size if the precision loss is found to be acceptable.
2010-09-24 18:29:49 -07:00
Chris Robinson
117ed52091
Better protect against negative attenuation
2010-09-24 13:16:09 -07:00
Chris Robinson
e9d5e53dbe
Use ALfloat for the dry mix buffer
2010-09-23 17:44:02 -07:00
Chris Robinson
e308694521
Remove an unnecessary variable
2010-09-23 16:51:30 -07:00
Chris Robinson
7e498012ff
Rename some variables to be less confusing
2010-09-23 16:49:33 -07:00
Chris Robinson
f98bf32be8
Fix line indentation
2010-09-23 15:08:30 -07:00
Chris Robinson
0f2ed8c84d
Be consistent with a variable's use
2010-09-23 13:49:21 -07:00
Chris Robinson
8d67cdfaab
Convert float to short similar to short to float
2010-09-23 08:43:39 -07:00
Chris Robinson
67ba924ed3
Store and mix signed 16-bit samples
2010-09-22 23:38:06 -07:00
Chris Robinson
764cfb6a0d
Allow the mixing loop to access the different sample formats
2010-09-22 20:53:04 -07:00
Chris Robinson
4e3c945093
Compact some reused code
2010-09-22 18:49:46 -07:00
Chris Robinson
8558bc1d41
Allow accessing the buffer data as multiple data types in the mixer
...
Also reduces a bunch of indentation
2010-09-22 17:19:35 -07:00
Chris Robinson
03f56419d0
Duplicate stereo sources by default
...
The mixer is smart enough now to handle proper volume adjustments depending on
the number of output speakers
2010-09-22 11:09:34 -07:00
Chris Robinson
3ee9d24c3f
Use separate macros for the different mixing loops
2010-09-22 09:38:24 -07:00
Chris Robinson
9b1ad6c873
Consolidate some code
2010-09-21 19:49:47 -07:00
Chris Robinson
97daaade8a
Reduce some more indentation
2010-09-21 16:54:33 -07:00
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
2d4453968d
Implement AL_SOFT_buffer_sub_data using the current AL_EXT_buffer_sub_data spec
...
This extension can be useful for some applications, but a full EXT version may
not be ready for some time. Using the SOFT moniker will help differentiate it
in case changes need to be done for the EXT version.
2010-09-21 09:43:35 -07:00
Chris Robinson
a2580a85a8
Improve range checking for BufferSubData
2010-09-19 14:00:55 -07:00
Chris Robinson
8a0e15ff37
Store air absorption factor locally
2010-09-12 00:10:33 -07:00
Chris Robinson
8953a73fb1
Prevent effectiveDist from going negative
2010-09-11 23:57:15 -07:00
Chris Robinson
1a2883ae9a
Pass dry-path click buffers as parameters to MixSource
2010-09-11 23:43:12 -07:00
Chris Robinson
a2358ffc41
Source positions at and after the end of the buffer queue go back to 0
2010-09-09 18:27:14 -07:00
Chris Robinson
33eb2786f8
Avoid another non-descript incrementing variable
2010-09-09 16:47:54 -07:00
Chris Robinson
c8ec4fd505
Avoid using a single-letter iterator value
2010-09-09 14:53:14 -07:00
Chris Robinson
fe98ab5398
Combine multiple checks into one
2010-09-08 17:29:16 -07:00
Chris Robinson
76be7eb1e7
Better protect against sample overflow when converting float to short
2010-09-08 16:26:19 -07:00
Chris Robinson
6e32812bc1
Remove unnecessary check
2010-09-07 22:38:29 -07:00
Chris Robinson
50a7be6385
Fix comparison check
2010-09-07 22:23:37 -07:00
Chris Robinson
3763c95784
Add missing else
2010-09-07 16:36:42 -07:00
Chris Robinson
5fa5252648
Watch for a few more negative sizes
2010-09-07 16:33:17 -07:00
Chris Robinson
1e82561a22
Check for invalid negative sizes
2010-09-07 16:18:24 -07:00
Chris Robinson
ba32a52bb6
Remove unused struct member
2010-09-07 16:07:35 -07:00
Chris Robinson
6027fda0ce
Combine two arrays into one
2010-08-16 16:07:44 -07:00
Chris Robinson
e5cae87502
Handle clicks by watching changes between updates
2010-08-16 14:53:21 -07:00
Chris Robinson
ba0ec1b4ba
Use the correct value to dereference an array
2010-08-16 11:42:18 -07:00
Chris Robinson
2acd6f52f1
Add a bit more information to the README
2010-08-15 16:55:11 -07:00
Chris Robinson
b520228bc6
Consolidate some click removal calculations
2010-08-15 15:55:02 -07:00
Chris Robinson
343a8241ab
Use a multiplier instead of if checks
2010-08-15 15:09:38 -07:00
Chris Robinson
00525274a0
Add click removal for wet sends
2010-08-15 14:52:12 -07:00
Chris Robinson
2915d9dbd9
Use click removal to handle harsh panning/volume changes
2010-08-15 00:19:38 -07:00