[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11687] branches/soc-2007-hcube/intern/ tinySND: Added callback interface.
Csaba Hruska
csaba.hruska at gmail.com
Sun Aug 19 12:38:01 CEST 2007
Revision: 11687
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11687
Author: hcube
Date: 2007-08-19 12:38:01 +0200 (Sun, 19 Aug 2007)
Log Message:
-----------
Added callback interface.
Modified Paths:
--------------
branches/soc-2007-hcube/intern/tinySND/SND_FXDuplicator.h
branches/soc-2007-hcube/intern/tinySND/intern/SND_FXDuplicator.cpp
Modified: branches/soc-2007-hcube/intern/tinySND/SND_FXDuplicator.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_FXDuplicator.h 2007-08-19 10:37:12 UTC (rev 11686)
+++ branches/soc-2007-hcube/intern/tinySND/SND_FXDuplicator.h 2007-08-19 10:38:01 UTC (rev 11687)
@@ -6,21 +6,21 @@
class SND_FXDuplicator: public SND_SoundInterface
{
public:
- SND_FXDuplicator();
- ~SND_FXDuplicator();
+ SND_FXDuplicator();
+ ~SND_FXDuplicator();
- void setInput( SND_SoundInterface *input );
+ void setInput( SND_SoundInterface *input );
SND_SoundInterface *getInput();
- void setNumCopy( int numCopy );
- int getNumCopy();
+ void setNumCopy( int numCopy );
+ int getNumCopy();
- bool isMuted();
- void setMute( bool isMuted );
+ bool isMuted();
+ void setMute( bool isMuted );
- float getSampleRate();
- bool isDataAvailable();
- float* getPCMDataPtr( int framesNum );
+ float getSampleRate();
+ bool isDataAvailable();
+ float* getPCMDataPtr( int framesNum );
private:
SND_SoundInterface *mInput;
Modified: branches/soc-2007-hcube/intern/tinySND/intern/SND_FXDuplicator.cpp
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/intern/SND_FXDuplicator.cpp 2007-08-19 10:37:12 UTC (rev 11686)
+++ branches/soc-2007-hcube/intern/tinySND/intern/SND_FXDuplicator.cpp 2007-08-19 10:38:01 UTC (rev 11687)
@@ -3,6 +3,11 @@
SND_FXDuplicator::SND_FXDuplicator()
{
+ // clear callback
+ mCallback = 0;
+ mUserData1 = 0;
+ mUserData2 = 0;
+
mNumCopy = 1;
mInput = 0;
mIsMuted = false;
@@ -68,6 +73,12 @@
{
assert( mBuffer == 0 || mBufferSize == framesNum );
+ // call callback
+ if( mCallback != 0 )
+ {
+ (*mCallback)( framesNum, mUserData1, mUserData2 );
+ }
+
if( mCounter <= 0 )
{
mBuffer = mInput->getPCMDataPtr( framesNum );
More information about the Bf-blender-cvs
mailing list