[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11685] branches/soc-2007-hcube/intern/ tinySND/intern/SND_FXSample.cpp: Added callback interface.
Csaba Hruska
csaba.hruska at gmail.com
Sun Aug 19 12:35:55 CEST 2007
Revision: 11685
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11685
Author: hcube
Date: 2007-08-19 12:35:55 +0200 (Sun, 19 Aug 2007)
Log Message:
-----------
Added callback interface.
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-08-19 10:35:47 UTC (rev 11684)
+++ branches/soc-2007-hcube/intern/tinySND/intern/SND_FXSample.cpp 2007-08-19 10:35:55 UTC (rev 11685)
@@ -11,6 +11,11 @@
SND_FXSample::SND_FXSample( SND_DataCache *dataCache, int channelIdx )
{
+ // clear callback
+ mCallback = 0;
+ mUserData1 = 0;
+ mUserData2 = 0;
+
mDataCache = dataCache;
mPlayState = SND_FXSample::STOPPED;
mPlayDirection = SND_FXSample::FORWARD;
@@ -33,6 +38,11 @@
{
SND_DataCache *dataCache = new SND_DataCache( dataProvider );
+ // clear callback
+ mCallback = 0;
+ mUserData1 = 0;
+ mUserData2 = 0;
+
mDataCache = dataCache;
mPlayState = SND_FXSample::STOPPED;
mPlayDirection = SND_FXSample::FORWARD;
@@ -195,6 +205,12 @@
int framesDone = 0;
int i;
+ // call callback
+ if( mCallback != 0 )
+ {
+ (*mCallback)( framesNum, mUserData1, mUserData2 );
+ }
+
// resize buffer if necessary
if( mBufferSize < framesNum )
{
More information about the Bf-blender-cvs
mailing list