diff jssmix.c @ 227:b7e23d91a8c2

Add jvmReset() function for reseting channel's position and pitch.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 08 Oct 2012 01:44:34 +0300
parents dc22e3f77c9a
children 1e89cd081956
line wrap: on
line diff
--- a/jssmix.c	Mon Oct 08 01:19:48 2012 +0300
+++ b/jssmix.c	Mon Oct 08 01:44:34 2012 +0300
@@ -495,6 +495,20 @@
 }
 
 
+void jvmReset(JSSMixer * mixer, const int channel)
+{
+    JSSChannel *c;
+    
+    JSS_LOCK(mixer);
+    c = &mixer->channels[channel];
+
+    c->chDirection = TRUE;
+    c->chPos.dw    = c->chDeltaO.dw = 0;
+
+    JSS_UNLOCK(mixer);
+}
+
+
 void jvmSetSample(JSSMixer * mixer, const int channel,
           void *data, const Sint32 size, const Sint32 loopS,
           const Sint32 loopE, const int flags)