diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index f9060100c0..41a4379022 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -620,6 +620,12 @@ LuaBindings::common (lua_State* L) .addConst ("Curved", Evoral::ControlList::InterpolationStyle(Evoral::ControlList::Curved)) .endNamespace () + .beginNamespace ("EventType") + .addConst ("NO_EVENT", Evoral::EventType(Evoral::NO_EVENT)) + .addConst ("MIDI_EVENT", Evoral::EventType(Evoral::MIDI_EVENT)) + .addConst ("LIVE_MIDI_EVENT", Evoral::EventType(Evoral::LIVE_MIDI_EVENT)) + .endNamespace () + .endNamespace (); // Evoral luabridge::getGlobalNamespace (L) diff --git a/libs/evoral/evoral/Event.h b/libs/evoral/evoral/Event.h index 6780b4e636..43a60c3a02 100644 --- a/libs/evoral/evoral/Event.h +++ b/libs/evoral/evoral/Event.h @@ -123,6 +123,9 @@ public: inline const uint8_t* buffer() const { return _buf; } inline uint8_t* buffer() { return _buf; } + inline bool is_midi () const { return _type == LIVE_MIDI_EVENT || _type == MIDI_EVENT; } + inline bool is_live_midi () const { return _type == LIVE_MIDI_EVENT; } + inline void set_event_type(EventType t) { _type = t; } inline void set_time(Time t) { _time = t; } diff --git a/libs/evoral/evoral/types.h b/libs/evoral/evoral/types.h index 610e34de72..09d2946ca4 100644 --- a/libs/evoral/evoral/types.h +++ b/libs/evoral/evoral/types.h @@ -51,7 +51,8 @@ typedef int32_t event_id_t; */ enum EventType { NO_EVENT, - MIDI_EVENT + MIDI_EVENT, + LIVE_MIDI_EVENT }; /** Type of a parameter (opaque, mapped by application, e.g. gain) */