-
Notifications
You must be signed in to change notification settings - Fork 2
/
sink.h
38 lines (35 loc) · 880 Bytes
/
sink.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef SINK_H
#define SINK_H
#include <QIODevice>
#include <QFile>
#include "codec2.h"
class Sink : public QIODevice
{
Q_OBJECT
public:
explicit Sink(QString filename, int codec2_mode, int natural, bool save_uncompressed_pcm_too, QObject *parent);
~Sink();
qint64 readData(char *data, qint64 maxlen);
qint64 writeData(const char *data, qint64 len);
QString laststatusmsg;
bool failed;
private:
int mode;
CODEC2 *codec2;
short *buf;
unsigned char *bits, *prev_bits;
int nsam, nbit, nbyte;
QFile *file;
QFile *file_pcm;
bool done;
bool save_uncompressed_pcm_too;
int bufremptr;
void writeWavHeader();
signals:
void signal_volume(int volume);
void ChannelFailed();
public slots:
void start();
void stop();
};
#endif // SINK_H