Mercurial > hg > dmlib
diff minijss/jmixtmpl_c.h @ 658:c430112449a7
Move miniJSS into a subdirectory.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 16 Apr 2013 07:32:29 +0300 |
parents | jmixtmpl_c.h@37382bee0619 |
children | d7bd9c11229e |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/minijss/jmixtmpl_c.h Tue Apr 16 07:32:29 2013 +0300 @@ -0,0 +1,57 @@ +/* + * miniJSS - Mixing routine in C, innerloop template + * Programmed and designed by Matti 'ccr' Hamalainen + * (C) Copyright 2006-2007 Tecnic Software productions (TNSP) + */ + +int JMIXER_NAME (JSSMixer *mixer, JSSChannel *chn, JMIXER_ADDBUF_TYPE *addBuffer, const int mixLength, const DMFixedPoint endPos) +#ifdef JMIXER_HEADER +; +#else +{ + const DMFixedPoint tmpDelta = chn->chDeltaO, tmpDeltaV = chn->chDeltaV; + DMFixedPoint tmpPos = chn->chPos, + tmpVolume = chn->chVolume; + JMIXER_ADDBUF_TYPE + *ap = addBuffer, + *tr = chn->chPrevR, + *tl = chn->chPrevL; + int strideLength = 0; + + JMIXER_SAMPLE_TYPE *sp = (JMIXER_SAMPLE_TYPE *) chn->chData; + + JMIXER_INIT + + if (chn->chVolumeD > 0) + { + const int tmpLength = chn->chVolumeD < mixLength ? chn->chVolumeD : mixLength; + chn->chVolumeD -= tmpLength; + + while (strideLength < tmpLength && JMIXER_ENDCOND) + { + JMIXER_FUNC + JMIXER_DEBUG + JMIXER_NEXT + FP_ADD(tmpVolume, tmpDeltaV); + strideLength++; + } + } + + while (strideLength < mixLength && JMIXER_ENDCOND) + { + JMIXER_FUNC + JMIXER_DEBUG + JMIXER_NEXT + strideLength++; + } + + chn->chPos = tmpPos; + chn->chVolume = tmpVolume; + return strideLength; +} +#endif + +#undef JMIXER_NAME +#undef JMIXER_NEXT +#undef JMIXER_ENDCOND +