00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MARSYAS_AUFILESINK_H
00020 #define MARSYAS_AUFILESINK_H
00021
00022 #include <cstring>
00023
00024 #include "AbsSoundFileSink.h"
00025 #include "AuFileSource.h"
00026 #include "FileName.h"
00027
00028
00029
00030
00031 namespace Marsyas
00032 {
00044 struct snd_header;
00045
00046 class AuFileSink: public AbsSoundFileSink
00047 {
00048 private:
00049 snd_header* hdr_;
00050 unsigned long written_;
00051 long fpos_;
00052
00053 short *sdata_;
00054 unsigned char *cdata_;
00055
00056 std::string filename_;
00057 FILE *sfp_;
00058 long sfp_begin_;
00059
00060 mrs_natural nChannels_;
00061
00062 unsigned long ByteSwapLong(unsigned long nLongNumber);
00063 unsigned short ByteSwapShort (unsigned short nValue);
00064
00065 void addControls();
00066 void myUpdate(MarControlPtr sender);
00067
00068 public:
00069 AuFileSink(std::string name);
00070 AuFileSink(const AuFileSink& a);
00071 ~AuFileSink();
00072 MarSystem* clone() const;
00073
00074 void putLinear16(realvec& slice);
00075 void putHeader(std::string filename);
00076 bool checkExtension(std::string filename);
00077 void myProcess(realvec& in, realvec& out);
00078 };
00079
00080 }
00081
00082 #endif
00083
00084
00085
00086