[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11087] branches/soc-2007-hcube/intern/ tinySND/intern/SND_FXSample.cpp: Added an incompleted play implementation.

Csaba Hruska csaba.hruska at gmail.com
Wed Jun 27 15:38:43 CEST 2007


Revision: 11087
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11087
Author:   hcube
Date:     2007-06-27 15:38:42 +0200 (Wed, 27 Jun 2007)

Log Message:
-----------
Added an incompleted play implementation. It is just a feature preview.

Modified Paths:
--------------
    branches/soc-2007-hcube/intern/tinySND/intern/SND_FXSample.cpp

Modified: branches/soc-2007-hcube/intern/tinySND/intern/SND_FXSample.cpp
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/intern/SND_FXSample.cpp	2007-06-27 13:37:24 UTC (rev 11086)
+++ branches/soc-2007-hcube/intern/tinySND/intern/SND_FXSample.cpp	2007-06-27 13:38:42 UTC (rev 11087)
@@ -139,8 +139,18 @@
 // we can request sound data. do not request big part, only few kilobytes are recommended
 float* SND_FXSample::getPCMDataPtr( int framesNum ) 
 {
+	// !!! NOT HANDLES YET: framesNum > mSourceBufferSize
+	float *res = &mSourceBuffer[mSourceBufferPos];
+	// Not final code, it's just for fun
+	mSourceBufferPos += framesNum;
+	if( mSourceBufferPos > mSourceBufferSize )
+	{
+		mSourceBufferPos = 0;
+		res = &mSourceBuffer[mSourceBufferPos];
+	}
+	
     // we know wich frames are prepared now, if the requested frames are already prepared then we provide them and dont mix it again
 //    if( mFrameCounter >= mSourceBufferPos &&  )
-    return mSourceBuffer;
+    return res;
 }
 





More information about the Bf-blender-cvs mailing list