-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkeyboard_controller.h
86 lines (72 loc) · 2.89 KB
/
keyboard_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
#ifndef ELKCPP_KEYBOARD_CONTROLLER_H
#define ELKCPP_KEYBOARD_CONTROLLER_H
#include "sushi_rpc.grpc.pb.h"
#include "control_interface.h"
namespace sushi_controller
{
class KeyboardControllerClient : public KeyboardController
{
public:
KeyboardControllerClient(const std::string& address);
/**
* @brief Send note on message to a track
*
* @param track_id The id of the track that should receive the message
* @param channel The channel on which the message should be sent
* @param note The note to send. Follows the MIDI standard where middle c = 60
* @param velocity The velocity of the note. Should be in range (0.0-1.0)
* @return ControlStatus
*/
ControlStatus send_note_on(int track_id, int channel, int note, float velocity) override;
/**
* @brief Send note off message to a track
*
* @param track_id The id of the track that should receive the message
* @param note The note to send. Follows the MIDI standard where middle c = 60
* @param channel The channel on which the message should be sent
* @param velocity The velocity of the note. Should be in range (0.0-1.0)
* @return ControlStatus
*/
ControlStatus send_note_off(int track_id, int channel, int note, float velocity) override;
/**
* @brief Send note aftertouch message to a track
*
* @param track_id The id of the track that should receive the message
* @param channel The channel on which the message should be sent
* @param note The note to send. Follows the MIDI standard where middle c = 60
* @param value
* @return ControlStatus
*/
ControlStatus send_note_aftertouch(int track_id, int channel, int note, float value) override;
/**
* @brief Send aftertouch message to a track
*
* @param track_id The id of the track that should receive the message
* @param channel The channel on which the message should be sent
* @param value
* @return ControlStatus
*/
ControlStatus send_aftertouch(int track_id, int channel, float value) override;
/**
* @brief Send pitch bend message to a track
*
* @param track_id The id of the track that should receive the message
* @param channel The channel on which the message should be sent
* @param value
* @return ControlStatus
*/
ControlStatus send_pitch_bend(int track_id, int channel, float value) override;
/**
* @brief Send modulation message to a track
*
* @param track_id The id of the track that should receive the message
* @param channel The channel on which the message should be sent
* @param value
* @return ControlStatus
*/
ControlStatus send_modulation(int track_id, int channel, float value) override;
private:
std::unique_ptr<sushi_rpc::KeyboardController::Stub> _stub;
};
} // namespace sushi_controller
#endif // ELKCPP_KEYBOARD_CONTROLLER_H