-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqcoreaudio.h
46 lines (35 loc) · 1.01 KB
/
qcoreaudio.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
#ifndef QCOREAUDIO_H
#define QCOREAUDIO_H
#include <QObject>
#include <AudioUnit/AudioUnit.h>
#include "avobject.h"
class QCoreAudio : public QObject, public AVObject
{
Q_OBJECT
public:
explicit QCoreAudio(QObject *parent = 0);
virtual ~QCoreAudio();
virtual const char * getName();
virtual size_t pull(float *buffer_ptr, size_t buffer_size);
virtual size_t push(float *buffer_ptr, size_t buffer_size);
private:
AudioUnit device_unit;
static OSStatus outputCallback(
void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList *ioData);
signals:
public slots:
bool open();
void start();
void stop();
void close();
Float64 getDeviceSampleRate();
void setDeviceSampleRate(Float64 sample_rate);
UInt32 getDeviceBufferSize();
void setDeviceBufferSize(UInt32 buffer_size);
};
#endif // QCOREAUDIO_H