Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

wavFile.h

Go to the documentation of this file.
00001 //wavFile.h
00002 #ifndef WAVFILE_H
00003 #define WAVFILE_H
00004 
00005 #include <qobject.h>
00006 #include <sys/soundcard.h>
00007 #include <qfile.h>
00008 #include <qstring.h>
00009 
00010 typedef struct { 
00011         char           riffID[4];
00012         unsigned long  riffLen;
00013         char           wavID[4];
00014         char           fmtID[4];
00015         unsigned long  fmtLen;
00016         unsigned short fmtTag;
00017         unsigned short nChannels;
00018         unsigned long  sampleRate;
00019         unsigned long  avgBytesPerSec;
00020         unsigned short nBlockAlign;
00021         unsigned short bitsPerSample;
00022         char           dataID[4];
00023         unsigned long  dataLen;
00024     } wavhdr;
00025 
00026 
00027 class WavFile : public QObject {
00028 Q_OBJECT
00029 public:
00030     WavFile( QObject * parent=0,const QString &fileName=0, bool newFile=0, int sampleRate=0,
00031              int channels=0 , int resolution=0, int format=0);
00032  ~WavFile();
00033     wavhdr hdr;
00034     bool adjustHeaders(int fd, int total);
00035     QString currentFileName;
00036     QString trackName();
00037     
00038     QFile track;
00039     int wavHandle();
00040     int getFormat();
00041     int getResolution();
00042     int getSampleRate();
00043     int getNumberSamples();
00044    int getChannels();
00045     bool isTempFile();
00046     int openFile(const QString &);
00047     bool newFile();
00048     void closeFile();
00049 
00050 private:
00051     int wavFormat, wavChannels, wavResolution, wavSampleRate, wavNumberSamples;
00052     bool useTmpFile;
00053     bool setWavHeader(int fd, wavhdr *hdr);
00054     int parseWavHeader(int fd);
00055 };
00056 
00057 #endif

Generated on Sat Nov 5 16:17:34 2005 for OPIE by  doxygen 1.4.2