diff jssmix.h @ 287:1e89cd081956

Use fixed point everywhere in the mixing internals, to avoid going over sample boundaries.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 11 Oct 2012 11:09:26 +0300
parents b7e23d91a8c2
children 3bdc776a4b33
line wrap: on
line diff
--- a/jssmix.h	Thu Oct 11 10:24:00 2012 +0300
+++ b/jssmix.h	Thu Oct 11 11:09:26 2012 +0300
@@ -24,21 +24,20 @@
 typedef struct
 {
     DMFixedPoint
+            chSize,         // Length of sample in UNITS
+            chLoopS,        // Loop start in UNITS
+            chLoopE,        // Loop end in UNITS
+
             chPos,          // Current position in sample, 32:32 fixpoint
             chDeltaO,       // Delta in 32:32 UNSIGNED! (chDirection)
             chVolume,       // Volume
             chDeltaV,
             chPanning,      // Panning
             chDeltaP;
-
     int     chVolumeD,
             chPanningD;
 
     int     chFreq;         // Frequency of sampel in Hz
-    Sint32
-            chSize,         // Length of sample in UNITS
-            chLoopS,        // Loop start in UNITS
-            chLoopE;        // Loop end in UNITS
 
     void    *chData;        // Pointer to data
 
@@ -76,8 +75,8 @@
     void            (*cbFunction)(void *, void *);
 
     // Mixing routine pointers
-    int    (*jvmMixChannel_FW)(JSSMixer *, JSSChannel *, JMIXER_ADDBUF_TYPE *, const int, const Sint32);
-    int    (*jvmMixChannel_BW)(JSSMixer *, JSSChannel *, JMIXER_ADDBUF_TYPE *, const int, const Sint32);
+    int    (*jvmMixChannel_FW)(JSSMixer *, JSSChannel *, JMIXER_ADDBUF_TYPE *, const int, const DMFixedPoint);
+    int    (*jvmMixChannel_BW)(JSSMixer *, JSSChannel *, JMIXER_ADDBUF_TYPE *, const int, const DMFixedPoint);
     void   (*jvmPostProcess)(JMIXER_ADDBUF_TYPE *, void *, const int);
 
     // Device locking