115 Commits

Author SHA1 Message Date
Chris Robinson
2c96c29938 Rename some "template" functions 2010-11-25 13:22:54 -08:00
Chris Robinson
65919b7037 Always make sure there's a sample available to mix, for pending click removal 2010-11-25 13:17:51 -08:00
Chris Robinson
f4e0c6a348 Use a temporary stack buffer to store the source buffer data to be mixed
This makes it much easier to pack the playable buffer data so that it's a
continuous data stream. This could normally be broken up otherwise, such as
when using loop points or small queued buffers.
Currently it defaults to a 16KB stack buffer, but this can be overridden at
compile time.
2010-11-25 11:16:19 -08:00
Chris Robinson
885a5e9f90 Use 0-based access for the buffer data 2010-11-24 20:44:21 -08:00
Chris Robinson
22e3e9a18b Support 8-bit sample data in the mixer 2010-11-24 19:41:25 -08:00
Chris Robinson
445cde2dd4 Check the sample byte size after the resampler 2010-11-24 17:23:09 -08:00
Chris Robinson
3dd58cf765 Get rid of a useless union 2010-11-24 17:10:41 -08:00
Chris Robinson
cd87061749 Change the mixer macros to declare functions 2010-11-24 17:07:50 -08:00
Chris Robinson
1311e051d9 Set mixer sample pos and frac when needed 2010-11-24 14:54:46 -08:00
Chris Robinson
6ab22e7cbb Reorder some stored source params 2010-11-24 10:01:50 -08:00
Chris Robinson
bb13f7f234 Make sure the buffer padding is always cleared before looking for the next buffer 2010-11-24 07:20:41 -08:00
Chris Robinson
bbb45e326c Avoid temporary float variables 2010-11-21 03:58:37 -08:00
Chris Robinson
dfe3e402a8 Pass the data pointer and proper sampler to the mixer macro 2010-11-21 03:33:33 -08:00
Chris Robinson
e884da50ea Move aluMixData back to ALu.c 2010-11-21 02:51:18 -08:00
Chris Robinson
07346da740 Use the number of sends the device is configured for in more places 2010-11-06 14:27:33 -07:00
Chris Robinson
289c74788e Use a switch to select the appropriate channel-count mixer 2010-11-06 12:21:46 -07:00
Chris Robinson
65a8d9278d Declare a variable where it's used 2010-11-01 12:44:56 -07:00
Chris Robinson
6db4e08efb Fix fpu state handling with _controlfp 2010-10-15 10:35:47 -07:00
Chris Robinson
90e9cd970a Check resampler mode first when selecting the mixer 2010-09-26 13:53:02 -07:00
Chris Robinson
845ca95888 Get a variable where it's needed 2010-09-26 13:30:46 -07:00
Chris Robinson
92d8d2f8a4 Pass the device to the mix function and localize the dry mix and click buffers 2010-09-26 12:23:22 -07:00
Chris Robinson
7cd52b2857 Clarify a check 2010-09-26 01:29:28 -07:00
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
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
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
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
1a2883ae9a Pass dry-path click buffers as parameters to MixSource 2010-09-11 23:43:12 -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
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