-
Notifications
You must be signed in to change notification settings - Fork 2
/
source.h
37 lines (33 loc) · 806 Bytes
/
source.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
#ifndef SOURCE_H
#define SOURCE_H
#include <QIODevice>
#include <QFile>
#include "codec2.h"
class Source : public QIODevice
{
Q_OBJECT
public:
explicit Source(QString filename, int codec2_mode, int natural, QObject *parent);
~Source();
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;
int nsam, nbit, nbyte;
QFile *file;
bool done;
qint64 bytesread_sum;
// FILE *fin;
// FILE *fout;
signals:
void percentage_played(int percentage);
public slots:
void start();
void stop();
};
#endif // SOURCE_H