19 EventType controlType READ controlType WRITE setControlType NOTIFY
21 Q_PROPERTY (
int channel READ channel WRITE setChannel NOTIFY channelChanged)
23 int controller READ controller WRITE setController NOTIFY controllerChanged)
24 Q_PROPERTY (
int value READ value WRITE setValue NOTIFY valueChanged)
29 enum class EventType : std::uint8_t
39 MidiControlEvent (
const dsp::TempoMap &tempo_map, QObject * parent =
nullptr);
40 Q_DISABLE_COPY_MOVE (MidiControlEvent)
41 ~MidiControlEvent ()
override;
43 static constexpr int kMaxChannel = 15;
44 static constexpr int kMaxController = 127;
45 static constexpr int kMaxValue7Bit = 127;
46 static constexpr int kMaxValuePitchBend = 16383;
48 EventType controlType ()
const;
49 void setControlType (EventType type);
50 Q_SIGNAL
void controlTypeChanged (EventType);
52 int channel ()
const {
return static_cast<int> (channel_); }
53 void setChannel (
int ch);
54 Q_SIGNAL
void channelChanged (
int);
56 int controller ()
const {
return static_cast<int> (controller_); }
57 void setController (
int ctrl);
58 Q_SIGNAL
void controllerChanged (
int);
60 int value ()
const {
return static_cast<int> (value_); }
61 void setValue (
int val);
62 Q_SIGNAL
void valueChanged (
int);
64 EventType controlEventType ()
const {
return type_; }
65 std::uint8_t midiChannel ()
const {
return channel_; }
66 std::uint8_t midiController ()
const {
return controller_; }
67 std::uint16_t midiValue ()
const {
return value_; }
70 int maxValueForType ()
const;
72 friend void init_from (
73 MidiControlEvent &obj,
74 const MidiControlEvent &other,
77 static constexpr auto kTypeKey =
"type"sv;
78 static constexpr auto kChannelKey =
"channel"sv;
79 static constexpr auto kControllerKey =
"controller"sv;
80 static constexpr auto kValueKey =
"value"sv;
81 friend void to_json (nlohmann::json &j,
const MidiControlEvent &ev);
82 friend void from_json (
const nlohmann::json &j, MidiControlEvent &ev);
84 EventType type_{ EventType::ControlChange };
85 std::uint8_t channel_{ 0 };
86 std::uint8_t controller_{ 0 };
87 std::uint16_t value_{ 0 };
89 BOOST_DESCRIBE_CLASS (
94 (type_, channel_, controller_, value_))