-
Notifications
You must be signed in to change notification settings - Fork 1
/
audiofilesdecoder.h
60 lines (35 loc) · 1023 Bytes
/
audiofilesdecoder.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
51
52
53
54
55
56
57
58
59
60
#ifndef AUDIOFILESDECODER_H
#define AUDIOFILESDECODER_H
#include <QObject>
#include <QStringList>
#include <QThread>
#include <QDebug>
#include <QFile>
#include <QCoreApplication>
class AudioFilesDecoderConnector : public QObject
{
Q_OBJECT
Q_PROPERTY(NOTIFY filesDecoded)
public:
AudioFilesDecoderConnector();
Q_INVOKABLE void decode(QString files, QString sample_rate, bool also_wav_file);
signals:
// QML TO CPP
void decodeFiles(QString files, QString sample_rate, bool also_wav_file);
// CPP TO QML
void filesDecoded();
};
class AudioFilesDecoder : public QThread
{
Q_OBJECT
public:
AudioFilesDecoder();
signals:
void filesDecoded();
public slots:
void onDecodeFiles(QString file_raw, QString sample_rate, bool also_wav_file);
private:
bool writeFile(QString path, const uint8_t *src, uint32_t size);
QThread * thread = nullptr;
};
#endif // AUDIOFILESDECODER_H