Mercurial > hg > dmlib
view jmix_c.h @ 36:f3407a58e01e
Change DMFixedPoint types and appropriate JSS functions back to using signed
integers, easier than trying to get unsigned sizes etc. to work properly in
audio mixing.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 29 Sep 2012 20:41:36 +0300 |
parents | fb5200deeda8 |
children |
line wrap: on
line source
/* * miniJSS - Mixing routine in C, innerloop template * Programmed and designed by Matti 'ccr' Hamalainen * (C) Copyright 2006-2007 Tecnic Software productions (TNSP) */ #ifdef JMIXER_HEADER int JMIXER_NAME (JSSMixer *, JSSChannel *, Sint32 *, const int, const Sint32); #else int JMIXER_NAME (JSSMixer *mixer, JSSChannel *chn, Sint32 *addBuffer, const int mixLength, const Sint32 endPos) { const JSSVolumeTable *volTab8 = (const JSSVolumeTable *) &(mixer->volTab8); Sint32 *ap = addBuffer; Sint32 tr = chn->chPrevR, tl = chn->chPrevL; DMFixedPoint tmpPos = chn->chPos; const DMFixedPoint tmpDelta = chn->chDeltaO; int strideLength = 0; if (chn->chFlags & jsf16bit) { Sint16 *sp = (Sint16 *) chn->chData; JMIXER_INIT while (strideLength < mixLength && JMIXER_ENDCOND) { JMIXER_FUNC_16 JMIXER_DEBUG JMIXER_NEXT strideLength++; } } else { Uint8 *sp = (Uint8 *) chn->chData; JMIXER_INIT while (strideLength < mixLength && JMIXER_ENDCOND) { JMIXER_FUNC_8 JMIXER_DEBUG JMIXER_NEXT strideLength++; } } chn->chPos.dw = tmpPos.dw; chn->chPrevR = tr; chn->chPrevL = tl; return strideLength; } #endif #undef JMIXER_NAME #undef JMIXER_NEXT #undef JMIXER_ENDCOND