-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpuseaudiodriver.h
42 lines (36 loc) · 927 Bytes
/
puseaudiodriver.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
#ifndef PUSEAUDIODRIVER_H
#define PUSEAUDIODRIVER_H
#include "buffer.h"
#include <QObject>
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
#include <map>
#include <pulse/simple.h>
class PuseAudioDriver : public QThread
{
Q_OBJECT
public:
PuseAudioDriver();
PuseAudioDriver(PuseAudioDriver* parent);
int open();
int out_pcm(short* buf, unsigned long len);
void out_buffer(Buffer* buf);
int close();
int drop_pcm_frames();
int set_nonblock(bool flag);
void run();
void nonBlockingLoop();
std::vector<Buffer*> quenue;
QWaitCondition waitCondition;
QMutex mutex;
void createThreads(char* device_name);
private:
std::vector<PuseAudioDriver*> pulse_threads;
PuseAudioDriver* parent;
bool bExitThread;
std::string device_name;
int Nthreads;
pa_simple *s;
};
#endif // PUSEAUDIODRIVER_H