00001 #ifndef AudioSink_hxx 00002 #define AudioSink_hxx 00003 00004 #include "Processing.hxx" 00005 #include "AudioInPort.hxx" 00006 00007 namespace CLAM 00008 { 00009 class AudioSink : public Processing 00010 { 00011 private: 00012 AudioInPort mIn; 00013 float* mFloatBuffer; 00014 double* mDoubleBuffer; 00015 unsigned mBufferSize; 00016 00017 public: 00018 AudioSink(const ProcessingConfig & conf=Config()) 00019 : mIn("AudioIn",this) 00020 , mFloatBuffer(0) 00021 , mDoubleBuffer(0) 00022 , mBufferSize(0) 00023 { 00024 //After being dropped it is ready to run as it does not need any configuration at all 00025 SetExecState(Ready); 00026 } 00027 00029 void SetFrameAndHopSize(const int val) 00030 { 00031 mIn.SetSize(val); 00032 mIn.SetHop(val); 00033 } 00034 00035 ~AudioSink() {} 00036 00037 void SetExternalBuffer(float* buf, unsigned nframes ); 00038 void SetExternalBuffer(double* buf, unsigned nframes ); 00039 00040 bool Do(); 00041 00042 const char* GetClassName() const { return "AudioSink";} 00043 00044 }; 00045 } //namespace CLAM 00046 00047 #endif 00048