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
41 QObject * parent =
nullptr);
42 Q_DISABLE_COPY_MOVE (MidiControlEvent)
43 ~MidiControlEvent ()
override;
47 return qobject_cast<dsp::ContentPosition *> (ArrangerObject::position ());
50 static constexpr int kMaxChannel = 15;
51 static constexpr int kMaxController = 127;
52 static constexpr int kMaxValue7Bit = 127;
53 static constexpr int kMaxValuePitchBend = 16383;
55 EventType controlType ()
const;
56 void setControlType (EventType type);
57 Q_SIGNAL
void controlTypeChanged (EventType);
59 int channel ()
const {
return static_cast<int> (channel_); }
60 void setChannel (
int ch);
61 Q_SIGNAL
void channelChanged (
int);
63 int controller ()
const {
return static_cast<int> (controller_); }
64 void setController (
int ctrl);
65 Q_SIGNAL
void controllerChanged (
int);
67 int value ()
const {
return static_cast<int> (value_); }
68 void setValue (
int val);
69 Q_SIGNAL
void valueChanged (
int);
71 EventType controlEventType ()
const {
return type_; }
72 std::uint8_t midiChannel ()
const {
return channel_; }
73 std::uint8_t midiController ()
const {
return controller_; }
74 std::uint16_t midiValue ()
const {
return value_; }
77 int maxValueForType ()
const;
79 friend void init_from (
80 MidiControlEvent &obj,
81 const MidiControlEvent &other,
84 static constexpr auto kTypeKey =
"type"sv;
85 static constexpr auto kChannelKey =
"channel"sv;
86 static constexpr auto kControllerKey =
"controller"sv;
87 static constexpr auto kValueKey =
"value"sv;
88 friend void to_json (nlohmann::json &j,
const MidiControlEvent &ev);
89 friend void from_json (
const nlohmann::json &j, MidiControlEvent &ev);
91 EventType type_{ EventType::ControlChange };
92 std::uint8_t channel_{ 0 };
93 std::uint8_t controller_{ 0 };
94 std::uint16_t value_{ 0 };
96 BOOST_DESCRIBE_CLASS (
101 (type_, channel_, controller_, value_))
A Position whose ticks are content-space (clip-local) ticks.
ArrangerObject(Type type, const dsp::TempoMapWrapper &tempo_map_wrapper, ArrangerObjectFeatures features, QObject *parent=nullptr) noexcept
Construct a new ArrangerObject.