00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef WAVEFILE_HH
00022 #define WAVEFILE_HH
00023
00026 #include <qstring.h>
00027
00028 #include "common.hh"
00029
00044 #define MAX_PIXPERSEC 160.0
00045
00046 class QTime;
00047
00064 class WaveFile
00065 {
00066 public:
00067
00078 WaveFile();
00079 virtual ~WaveFile();
00080
00110 virtual bool open(QString fname, int xres) = 0;
00111
00126 virtual void close() = 0;
00127
00140 bool isOpen() const;
00141
00158 virtual QTime length() const = 0;
00159
00180 virtual size_t getPlayBufferSize(QTime const start,
00181 QTime const end) const = 0;
00182
00203 virtual void getPlayBuffer(QTime const start, char *buf,
00204 size_t &size) = 0;
00205
00225 void getDispBuffer(QTime const start, char *buffer) const;
00226
00248 virtual void waveFormat(WaveFormat &f) const = 0;
00249
00268 void changeRes(int xres);
00269
00270 protected:
00280 bool opened;
00281
00291 double pixpersec;
00292
00302 size_t wavelength;
00303
00324 char *wave;
00325
00339 char *dispbuf;
00340 };
00341
00342 #endif // WAVEFILE_HH