[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11678] branches/soc-2007-hcube/intern/ tinySND/SND_DataConsumer.h: New interface for sound targets, like file writer or audio device.
Csaba Hruska
csaba.hruska at gmail.com
Sun Aug 19 12:33:12 CEST 2007
Revision: 11678
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11678
Author: hcube
Date: 2007-08-19 12:33:12 +0200 (Sun, 19 Aug 2007)
Log Message:
-----------
New interface for sound targets, like file writer or audio device.
Added Paths:
-----------
branches/soc-2007-hcube/intern/tinySND/SND_DataConsumer.h
Added: branches/soc-2007-hcube/intern/tinySND/SND_DataConsumer.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_DataConsumer.h (rev 0)
+++ branches/soc-2007-hcube/intern/tinySND/SND_DataConsumer.h 2007-08-19 10:33:12 UTC (rev 11678)
@@ -0,0 +1,45 @@
+#ifndef __SND_DATACONSUMER_H__
+#define __SND_DATACONSUMER_H__
+
+// doesnt contains any cache buffer
+#include "SND_DataMultiplexer.h"
+
+//sound data target
+class SND_DataConsumer
+{
+public:
+
+ virtual ~SND_DataConsumer() {}
+
+ virtual bool initialize() = 0;
+ virtual bool finalize() = 0;
+
+ virtual float getSampleRate() = 0;
+ virtual void setSampleRate( float sampleRate ) = 0;
+
+ virtual int getSampleFormat() = 0;
+ virtual void setSampleFormat( int sampleFormat ) = 0;
+
+ virtual int getNumChannels() = 0;
+ virtual void setNumChannels( int channelsNum ) = 0;
+
+ virtual void consumeData( int framesNum ) = 0;
+
+ int getBitRate();
+
+ // only same sample rate is acceptable that device has
+ void setInput( SND_DataMultiplexer *input );
+
+ // calling callback before producing pcm data to the device
+ void setCallback( SND_CallbackFunction *callback );
+
+ void setUserData( void *userData1, void *userData2 );
+
+protected:
+ SND_DataMultiplexer *mInput;
+ SND_CallbackFunction *mCallback;
+ void *mUserData1;
+ void *mUserData2;
+};
+
+#endif //__SND_DATACONSUMER_H__
More information about the Bf-blender-cvs
mailing list