[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11680] branches/soc-2007-hcube/intern/ tinySND/SND_SoundInterface.h: Added callback interface.

Csaba Hruska csaba.hruska at gmail.com
Sun Aug 19 12:34:04 CEST 2007


Revision: 11680
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11680
Author:   hcube
Date:     2007-08-19 12:34:03 +0200 (Sun, 19 Aug 2007)

Log Message:
-----------
Added callback interface.

Modified Paths:
--------------
    branches/soc-2007-hcube/intern/tinySND/SND_SoundInterface.h

Modified: branches/soc-2007-hcube/intern/tinySND/SND_SoundInterface.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_SoundInterface.h	2007-08-19 10:33:21 UTC (rev 11679)
+++ branches/soc-2007-hcube/intern/tinySND/SND_SoundInterface.h	2007-08-19 10:34:03 UTC (rev 11680)
@@ -1,27 +1,31 @@
 #ifndef __SND_SOUNDINTERFACE_H__
 #define __SND_SOUNDINTERFACE_H__
 
+typedef void SND_CallbackFunction( int framesNum, void *userData1, void *userData2 );
+
 class SND_SoundInterface
 {
 public:
-    virtual ~SND_SoundInterface(){}
+    virtual			~SND_SoundInterface(){}
     
-    virtual float getSampleRate() = 0;
+    virtual float	getSampleRate() = 0;
         
     // this inform us if we can get data from getPCMDataPtr or not. ex: FXSample is stopped or paused.
-    virtual bool isDataAvailable() = 0;
+    virtual bool	isDataAvailable() = 0;
 
     // we can request sound data. do not request big part, only few kilobytes are recommended
-    virtual float* getPCMDataPtr( int framesNum ) = 0; // incremets frame counter according play state
+    virtual float*	getPCMDataPtr( int framesNum ) = 0; // incremets frame counter according play state
 	
+	//todo: finish this feature, required for actuating sound ipos
 	// callback is called before real work/mixing is done in getPCMDataPtr
-	void setCallback(); //todo: finish this feature, required for actuating sound ipos
+	void			setCallback( SND_CallbackFunction *callback );
+
+	void			setUserData( void *userData1, void *userData2 );
 	
-	void setUserData( void *userData );
-	void *getUserData();
-	
-private:
-	void	*mUserData;
+protected:
+	SND_CallbackFunction	*mCallback;
+	void	*mUserData1;
+	void	*mUserData2;
 };
 
 #endif //__SND_SOUNDINTERFACE_H__





More information about the Bf-blender-cvs mailing list