1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

MIDI: Add span getters for MidiMessage and MidiMessageMetadata

This commit is contained in:
reuk 2025-03-06 16:26:44 +00:00
parent 85191fa50a
commit fb4f04e4d1
No known key found for this signature in database
3 changed files with 16 additions and 4 deletions

View file

@ -51,13 +51,11 @@ struct BytestreamMidiView
to a temporary.
*/
explicit BytestreamMidiView (const MidiMessage* msg)
: bytes (unalignedPointerCast<const std::byte*> (msg->getRawData()),
static_cast<size_t> (msg->getRawDataSize())),
: bytes (msg->asSpan()),
timestamp (msg->getTimeStamp()) {}
explicit BytestreamMidiView (const MidiMessageMetadata msg)
: bytes (unalignedPointerCast<const std::byte*> (msg.data),
static_cast<size_t> (msg.numBytes)),
: bytes (msg.asSpan()),
timestamp (msg.samplePosition) {}
MidiMessage getMessage() const