-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhost.h
66 lines (43 loc) · 1.08 KB
/
host.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
#pragma once
#include <QtCore>
#include <QtMultimedia>
#include "mididevice.hh"
namespace En
{
class Node;
class NodeGroup;
class Host : public QObject
{
Q_OBJECT
QIODevice* m_ioDevice; // not owned
QAudioFormat m_format;
QByteArray m_buffer; // PCM audio buffer
//QVector<float> m_floatBlock[4]; // 2 in 2 out
QAudioOutput* m_audioOutput;
QTimer* m_timer;
unsigned long m_globalSampleIndex;
NodeGroup* m_rootGroup;
unsigned m_blockSizeSamples;
// stuff for profiling utilisation
uint64_t m_lastProfiledTime;
uint64_t m_busyAccumulatedTime;
QVector<float> m_nullInputBuffer;
MidiDevice *m_globalMidiDevice;
public:
Host(NodeGroup* rootGroup);
virtual ~Host();
void init();
void stop();
const float* nullInputBuffer() const {
return m_nullInputBuffer.constData();
}
MidiDevice *globalMidiDevice() const {
return m_globalMidiDevice;
}
public slots:
void stateChanged(QAudio::State state);
void writeData();
signals:
void utilisation(float);
};
} // namespace En