00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MARSYAS_AUFILESOURCE_H
00020 #define MARSYAS_AUFILESOURCE_H
00021
00022 #include "AbsSoundFileSource.h"
00023
00024
00025 #include <string>
00026 #include <vector>
00027
00028 namespace Marsyas
00029 {
00040 struct snd_header;
00041
00042
00043 class AuFileSource: public AbsSoundFileSource
00044 {
00045
00046 private:
00047 snd_header* hdr_;
00048 std::string tfname_;
00049 std::string filename_;
00050
00051 short *sdata_;
00052 short sval_;
00053 unsigned short usval_;
00054
00055 unsigned char *cdata_;
00056 FILE *sfp_;
00057 long sfp_begin_;
00058
00059 mrs_natural sampleSize_;
00060 mrs_natural size_;
00061 mrs_natural csize_;
00062
00063 mrs_natural samplesOut_;
00064
00065 std::vector<std::string> sndFormats_;
00066 std::vector<int> sndFormatSizes_;
00067
00068 mrs_natural nChannels_;
00069 mrs_natural samplesToRead_;
00070 mrs_natural samplesToWrite_;
00071 mrs_natural samplesRead_;
00072
00073 mrs_real duration_;
00074 mrs_natural advance_;
00075 mrs_natural cindex_;
00076 mrs_natural nt_;
00077
00078 mrs_real repetitions_;
00079
00080 unsigned long ByteSwapLong(unsigned long nLongNumber);
00081 unsigned short ByteSwapShort (unsigned short nValue);
00082
00083 void addControls();
00084 void myUpdate(MarControlPtr sender);
00085
00086 MarControlPtr ctrl_size_;
00087 MarControlPtr ctrl_pos_;
00088
00089
00090 public:
00091 AuFileSource(std::string name);
00092 AuFileSource(const AuFileSource& a);
00093 ~AuFileSource();
00094 MarSystem* clone() const;
00095
00096 void getHeader(std::string filename);
00097 mrs_natural getLinear16(realvec& win);
00098
00099 void myProcess(realvec& in,realvec &out);
00100
00101 };
00102
00103 }
00104
00105 #endif
00106
00107