// // Programmer: Craig Stuart Sapp // Creation Date: Fri Nov 1 23:35:02 PST 1996 // Last Modified: Mon Apr 28 21:52:13 GMT-0800 1997 // Filename: ...sig/maint/code/Generator/SoundFileIn/SoundFileIn.h // Web Address: http://sig.sapp.org/include/sigSignal/SoundFileIn.h // Documentation: http://sig.sapp.org/doc/classes/SoundFileIn // Syntax: C++ // // #ifndef _SOUNDFILEIN_H_INCLUDED #define _SOUNDFILEIN_H_INCLUDED #include "Generator.h" #include "SoundHeader.h" #include "helperFunctions.h" #include "Array.h" #include "FileIO.h" #include #ifndef OLDCPP #include #include using namespace std; #else #include #include #endif class SoundFileIn : public Generator { public: SoundFileIn (const char* aFileName = "", float start=NONE, float dur = NONE); ~SoundFileIn(); void action (void); short extractSample16Bit (void); int getBitsPerSample (void); int getChannels (void); const char* getFilename (void) const; long getSamples (void); SoundHeader& getHeader (void); sampleType output (int channel = 0); void printState (void); void reset (int sampleIndex = 0); void setFile (const char* aFileName, float start = NONE, float dur = NONE); protected: FileIO sndfile; // soundfile input stream int endianType; // how soundfile data is stored char *filename; // name of the soundfile SoundHeader sndHeader; // header from soundfile long curSampleIndex; // the current sample number long begSampleIndex; // the first sample number long endSampleIndex; // the last sample number long maxSampleIndex; // the highest sample index value int loopingQ; int runningQ; Array Output; // output samples, by channel sampleType (*readSample) (FileIO&); void determineSampleReadingFunction (void); void fillOutputArray (void); }; #endif /* _SOUNDFILEIN_H_INCLUDED */ // md5sum: 63d54a26081ec06e10499d90571a9459 SoundFileIn.h [20050403]