-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaudiointerface.h
101 lines (72 loc) · 1.77 KB
/
audiointerface.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#ifndef AUDIOINTERFACE_H
#define AUDIOINTERFACE_H
#include "signalgenerator.h"
#include "iscope.h"
#include "IAnalyzer.h"
#include "rtaudio\RtAudio.h"
int AudioInterfaceInOut( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, double streamTime, RtAudioStreamStatus status, void *data );
class AudioInterface : public SignalGenerator
{
public:
explicit AudioInterface( RtAudio* audioInterface, unsigned int sampleRate, unsigned int inputDevice, unsigned int outputDevice, QObject *parent = 0);
void startAudio( RtAudio* audioInterface, unsigned int sampleRate );
void stopAudio();
inline void connectScope( IScope* scope )
{
m_scope = scope;
}
inline void disconnectScope()
{
m_scope = NULL;
}
inline IScope* scope()
{
return m_scope;
}
inline void connectAnalyzer( IAnalyzer* analyzer )
{
m_analyzer = analyzer;
}
inline void disconnectAnalyzer()
{
m_analyzer = NULL;
}
inline IAnalyzer* analyzer()
{
return m_analyzer;
}
inline void setOut1( bool value )
{
m_out1 = value;
}
inline void setOut2( bool value )
{
m_out2 = value;
}
inline bool isOut1()
{
return m_out1;
}
inline bool isOut2()
{
return m_out2;
}
inline unsigned int sampleRate()
{
return m_sampleRate;
}
private:
int m_started;
RtAudio* m_ptrAudioInterace;
unsigned int m_sampleRate;
unsigned int m_inputDevice;
unsigned int m_outputDevice;
IScope* m_scope;
IAnalyzer* m_analyzer;
bool m_out1;
bool m_out2;
AudioInterface()
{
}
};
#endif // AUDIOINTERFACE_H