-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmidi_controller.h
178 lines (150 loc) · 5.21 KB
/
midi_controller.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#ifndef ELKCPP_MIDI_CONTROLLER_H
#define ELKCPP_MIDI_CONTROLLER_H
#include "sushi_rpc.grpc.pb.h"
#include "control_interface.h"
namespace sushi_controller
{
class MidiControllerClient : public MidiController
{
public:
MidiControllerClient(const std::string& address);
/**
* @brief Get number of available MIDI input ports
*
* @return std::pair<ControlStatus, int>
*/
std::pair<ControlStatus, int> get_input_ports() override;
/**
* @brief Get number of available MIDI output ports
*
* @return std::pair<ControlStatus, int>
*/
std::pair<ControlStatus, int> get_output_ports() override;
/**
* @brief Get all MIDI keyboard input connections
*
* @return std::pair<ControlStatus, std::vector<MidiKbdConnection>>
*/
std::pair<ControlStatus, std::vector<MidiKbdConnection>> get_all_kbd_input_connections() override;
/**
* @brief Get all MIDI keyboard output connections
*
* @return std::pair<ControlStatus, std::vector<MidiKbdConnection>>
*/
std::pair<ControlStatus, std::vector<MidiKbdConnection>> get_all_kbd_output_connections() override;
/**
* @brief Get all MIDI CC input connections
*
* @return std::pair<ControlStatus, std::vector<MidiCCConnection>>
*/
std::pair<ControlStatus, std::vector<MidiCCConnection>> get_all_cc_input_connections() override;
/**
* @brief Get all MIDI PC input input connections
*
* @return std::pair<ControlStatus, std::vector<MidiPCConnection>>
*/
std::pair<ControlStatus, std::vector<MidiPCConnection>> get_all_pc_input_connections() override;
/**
* @brief Get the CC input connections for a processor
*
* @param processor_id The processor to get the CC input connections from
* @return std::pair<ControlStatus, std::vector<MidiCCConnection>>
*/
std::pair<ControlStatus, std::vector<MidiCCConnection>> get_cc_input_connections_for_processor(int processor_id) override;
/**
* @brief Get the PC input connections for a processor
*
* @param processor_id The processor to get the PC input connections from
* @return std::pair<ControlStatus, std::vector<MidiPCConnection>>
*/
std::pair<ControlStatus, std::vector<MidiPCConnection>> get_pc_input_connections_for_processor(int processor_id) override;
/**
* @brief Get whether midi clock is enabled for a given midi output port
*
* @param port Id of the port to query
* @return If ControlStatus == Ok, then true if enabled, false if disabled
*/
std::pair<ControlStatus, bool> get_midi_clock_output_enabled(int port) const override;
/**
* @brief Enable or disable midi clock output for a given output port
*
* @param enabled true to enable, false to disable
* @param port Id of the port to set
* @return ControlStatus
*/
ControlStatus set_midi_clock_output_enabled(bool enabled, int port) override;
/**
* @brief Connect keyboard input to a track
*
* @param connection_data
* @return ControlStatus
*/
ControlStatus connect_kbd_input_to_track(MidiKbdConnection connection_data) override;
/**
* @brief Connection keyboard from a track
*
* @param connection_data
* @return ControlStatus
*/
ControlStatus connect_kbd_output_from_track(MidiKbdConnection connection_data) override;
/**
* @brief Connect CC messages to a parmeter
*
* @param connection_data
* @return ControlStatus
*/
ControlStatus connect_cc_to_parameter(MidiCCConnection connection_data) override;
/**
* @brief Connect PC messages to a processor
*
* @param connection_data
* @return ControlStatus
*/
ControlStatus connect_pc_to_processor(MidiPCConnection connection_data) override;
/**
* @brief Disconnect an existing keyboard input connection
*
* @param connection_data
* @return ControlStatus
*/
ControlStatus disconnect_kbd_input(MidiKbdConnection connection_data) override;
/**
* @brief Disconnect an existing keyboard output connection
*
* @param connection_data
* @return ControlStatus
*/
ControlStatus disconnect_kbd_output(MidiKbdConnection connection_data) override;
/**
* @brief Disconnect an existing CC connection
*
* @param connection_data
* @return ControlStatus
*/
ControlStatus disconnect_cc(MidiCCConnection connection_data) override;
/**
* @brief Disconnect an existing PC connection
*
* @param connection_data
* @return ControlStatus
*/
ControlStatus disconnect_pc(MidiPCConnection connection_data) override;
/**
* @brief Disconnect all CC connections from a processor
*
* @param processor_id
* @return ControlStatus
*/
ControlStatus disconnect_all_cc_from_processor(int processor_id) override;
/**
* @brief Disconnect all PC connection from a processor
*
* @param processor_id
* @return ControlStatus
*/
ControlStatus disconnect_all_pc_from_processor(int processor_id) override;
private:
std::unique_ptr<sushi_rpc::MidiController::Stub> _stub;
};
} // namespace sushi_controller
#endif // ELKCPP_MIDI_CONTROLLER_H