Mercurial > hg > dmlib
annotate jmixtmpl_c.h @ 49:033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
8bit, but samples are internally upconverted to 16bit after module loading.)
Also prepare for floating point mixing support.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 01 Oct 2012 02:51:41 +0300 |
parents | 1936fc1a6c18 |
children | 36e2f910219c |
rev | line source |
---|---|
0 | 1 /* |
2 * miniJSS - Mixing routine in C, innerloop template | |
3 * Programmed and designed by Matti 'ccr' Hamalainen | |
4 * (C) Copyright 2006-2007 Tecnic Software productions (TNSP) | |
5 */ | |
6 | |
7 #ifdef JMIXER_HEADER | |
36
f3407a58e01e
Change DMFixedPoint types and appropriate JSS functions back to using signed
Matti Hamalainen <ccr@tnsp.org>
parents:
35
diff
changeset
|
8 int JMIXER_NAME (JSSMixer *, JSSChannel *, Sint32 *, const int, const Sint32); |
0 | 9 #else |
49
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
10 int JMIXER_NAME (JSSMixer *mixer, JSSChannel *chn, JMIXER_ADDBUF_TYPE *addBuffer, const int mixLength, const Sint32 endPos) |
0 | 11 { |
12 const DMFixedPoint tmpDelta = chn->chDeltaO; | |
49
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
13 DMFixedPoint tmpPos = chn->chPos; |
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
14 JMIXER_ADDBUF_TYPE |
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
15 *ap = addBuffer, |
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
16 tr = chn->chPrevR, |
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
17 tl = chn->chPrevL; |
0 | 18 int strideLength = 0; |
49
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
19 JMIXER_SAMPLE_TYPE *sp = (JMIXER_SAMPLE_TYPE *) chn->chData; |
0 | 20 |
49
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
21 JMIXER_INIT |
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
22 |
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
23 while (strideLength < mixLength && JMIXER_ENDCOND) |
0 | 24 { |
49
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
25 JMIXER_FUNC |
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
26 JMIXER_DEBUG |
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
27 JMIXER_NEXT |
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
28 strideLength++; |
0 | 29 } |
30 | |
31 chn->chPos.dw = tmpPos.dw; | |
49
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
32 chn->chPrevR = tr; |
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
33 chn->chPrevL = tl; |
0 | 34 return strideLength; |
35 } | |
35
fb5200deeda8
Another fix, related to 7908061da010.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
36 #endif |
0 | 37 |
49
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
38 #undef JMIXER_NAME |
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
39 #undef JMIXER_NEXT |
0 | 40 #undef JMIXER_ENDCOND |
49
033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
41 |