forked from ieatlint/MagRead
-
Notifications
You must be signed in to change notification settings - Fork 0
/
magdecode.h
50 lines (37 loc) · 885 Bytes
/
magdecode.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
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef MAGDECODE_H
#define MAGDECODE_H
#include <QIODevice>
#include <QVarLengthArray>
#include "mslib.h"
#include "magcard.h"
class MagDecode : public QIODevice
{
Q_OBJECT
public:
explicit MagDecode(QObject *parent = 0);
void start();
void stop();
qint64 writeData( const char *data, qint64 dataLen );
qint64 readData( char *data, qint64 len );
void setTimeOut( int _timeOut );
void setNorm( int _normOffset );
void setAlgorithm( QString _algorithm );
private:
int silenceCount;
bool noiseDetected;
bool captureAudio;
int timeOut;
int defaultTimeOut;
void processSwipe();
int silenceThreshold;
int normOffset;
bool normOffsetFound;
QString algorithm;
QVarLengthArray<qint16> pcmData;
signals:
void cardRead( MagCard );
void errorMsg( QString );
public slots:
void setThreshold( int threshold );
};
#endif // MAGDECODE_H