SDIFOut.hxx
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _SDIFOut_
00023 #define _SDIFOut_
00024
00025 #include "IndexArray.hxx"
00026 #include "Processing.hxx"
00027 #include "Err.hxx"
00028 #include "Segment.hxx"
00029 #include "Filename.hxx"
00030 #include "InPort.hxx"
00031 #include "Fundamental.hxx"
00032 #include "Spectrum.hxx"
00033 #include "SpectralPeakArray.hxx"
00034
00035
00036 namespace SDIF {class File;};
00037
00038 namespace CLAM{
00039
00040 class SDIFOutConfig:public ProcessingConfig
00041 {
00042 public:
00043
00044 DYNAMIC_TYPE_USING_INTERFACE (SDIFOutConfig, 9, ProcessingConfig);
00045 DYN_ATTRIBUTE(0,public, TData, SpectralRange);
00046 DYN_ATTRIBUTE(1,public, TIndex, MaxNumPeaks);
00047 DYN_ATTRIBUTE(2,public, bool,EnableResidual);
00048 DYN_ATTRIBUTE(3,public, bool,EnablePeakArray);
00049 DYN_ATTRIBUTE(4,public, bool,EnableFundFreq);
00050 DYN_ATTRIBUTE(5,public, Filename,FileName);
00051 DYN_ATTRIBUTE(6,public, TData, SamplingRate);
00052 DYN_ATTRIBUTE(7,public, TData, FrameSize);
00053 DYN_ATTRIBUTE(8,public, TData, SpectrumSize);
00054
00055 void DefaultInit();
00056 };
00057
00058 class SDIFOut: public Processing
00059 {
00060 public:
00061
00062 SDIFOut(const SDIFOutConfig& c);
00063 SDIFOut();
00064
00065 virtual ~SDIFOut();
00066 const char * GetClassName() const {return "SDIFOut";}
00067
00068 bool GetEnableResidual() {return mConfig.GetEnableResidual();}
00069 bool GetEnablePeakArray() {return mConfig.GetEnablePeakArray();}
00070 bool GetEnableFundFreq() {return mConfig.GetEnableFundFreq();}
00071
00072 bool Do(void);
00073
00074 bool Do(const Frame& frame);
00075
00076 const ProcessingConfig &GetConfig() const;
00077
00078 SDIF::File* mpFile;
00079
00080 protected:
00081
00082 bool ConcreteStart();
00083
00084 bool ConcreteStop();
00085
00086 InPort<Fundamental> mInputFundamental;
00087 InPort<SpectralPeakArray> mInputSinSpectralPeaks;
00088 InPort<Spectrum> mInputResSpectrum;
00089
00090 private:
00091
00092 bool ConcreteConfigure(const ProcessingConfig& c);
00093 void ConnectAndPublishPorts();
00094
00095 SDIFOutConfig mConfig;
00096
00097
00098 IndexArray mPrevIndexArray;
00099 Frame singletonFrame;
00100
00101 };
00102
00103
00104
00105 };
00106 #endif
00107