mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-17 14:10:02 +02:00
Add a way to retrieve clap_event_header_t*s
This sets the correct pointer in the SysEx events just before returning them.
This commit is contained in:
@@ -238,6 +238,12 @@ struct alignas(16) Event {
|
||||
*/
|
||||
static std::optional<Event> parse(const clap_event_header_t& generic_event);
|
||||
|
||||
/**
|
||||
* Get the `clap_event_header_t*` representation for this event. The pointer
|
||||
* is valid as long as this struct isn't moved.
|
||||
*/
|
||||
const clap_event_header_t* get() const;
|
||||
|
||||
/**
|
||||
* The actual event data. These also contain the header because storing the
|
||||
* entire `clap_event_*_t` struct is the only way to serialize the event
|
||||
@@ -247,19 +253,20 @@ struct alignas(16) Event {
|
||||
* `clap_input_events::get()`, but that would cause unexpected lifetime
|
||||
* issues.
|
||||
*/
|
||||
std::variant<payload::Note,
|
||||
payload::NoteExpression,
|
||||
payload::ParamValue,
|
||||
payload::ParamMod,
|
||||
payload::ParamGesture,
|
||||
// Most events are about the same length, but having the
|
||||
// transport in here sadly doubles this struct's size
|
||||
// TODO: Pack the events at some point, this will require
|
||||
// special handling for SysEx events
|
||||
payload::Transport,
|
||||
payload::Midi,
|
||||
payload::MidiSysex,
|
||||
payload::Midi2>
|
||||
mutable std::variant<
|
||||
payload::Note,
|
||||
payload::NoteExpression,
|
||||
payload::ParamValue,
|
||||
payload::ParamMod,
|
||||
payload::ParamGesture,
|
||||
// Most events are about the same length, but having the transport in
|
||||
// here sadly doubles this struct's size
|
||||
// TODO: Pack the events at some point, this will require special
|
||||
// handling for SysEx events
|
||||
payload::Transport,
|
||||
payload::Midi,
|
||||
payload::MidiSysex,
|
||||
payload::Midi2>
|
||||
payload;
|
||||
|
||||
template <typename S>
|
||||
|
||||
Reference in New Issue
Block a user