]> camargo.eng.br - camargo/neiasound.git/blob - src/wav/nwavestream.h
Initial commit
[camargo/neiasound.git] / src / wav / nwavestream.h
1 #ifndef DWSOUNDRAWSTREAM_H
2 #define DWSOUNDRAWSTREAM_H
3
4 #include "../nSoundStream.h"
5
6 class QIODevice;
7
8 class nWaveStream : public nSoundStream
9 {
10     Q_OBJECT
11 public:
12     explicit nWaveStream(QIODevice * device, nSoundFormat format, int frequency, int channels = -1, QObject *parent = 0);
13
14 signals:
15
16 public slots:
17     virtual quint64 frames() { return _totalFrames; }
18     virtual int channels() { return _channels; }
19     virtual int frequency() { return _frequency; }
20
21     virtual nSoundBag * createSoundBag(QObject * parent = 0);
22
23     virtual nSoundFormat format() { return _format; }
24     virtual bool suggestStreaming() { return false; }
25
26     virtual quint64 read(void* data, unsigned long frames);
27
28     virtual void rewind();
29
30 private:
31
32     QIODevice * _device;
33     quint64 _totalFrames;
34     int _channels;
35     int _frequency;
36     int _deviceOffset;
37     nSoundFormat _format;
38
39 };
40
41 #endif // DWSOUNDRAWSTREAM_H