#[repr(C, packed(4))]pub struct MIDIPacket {
pub timeStamp: MIDITimeStamp,
pub length: u16,
pub data: [u8; 256],
}MIDIServices only.Expand description
A collection of simultaneous MIDI events.
WARNING: When using MIDIPacket in C++ be aware of the following:
MIDIPacket is a variable-length struct and should ALWAYS be passed-by-pointer rather than passed-by-reference. Conversion from a MIDIPacket reference to a pointer is undefined behavior and can lead to the unintended truncation of data.
Field: timeStamp The time at which the events occurred, if receiving MIDI, or, if sending MIDI, the time at which the events are to be played. Zero means “now.” The time stamp applies to the first MIDI byte in the packet. Field: length The number of valid MIDI bytes which follow, in data. (It may be larger than 256 bytes if the packet is dynamically allocated.) Field: data A variable-length stream of MIDI messages. Running status is not allowed. In the case of system-exclusive messages, a packet may only contain a single message, or portion of one, with no other MIDI events.
The MIDI messages in the packet must always be complete, except for system-exclusive.
(This is declared to be 256 bytes in length so clients don’t have to create custom data structures in simple situations.)
See also Apple’s documentation
Fields§
§timeStamp: MIDITimeStamp§length: u16§data: [u8; 256]Trait Implementations§
Source§impl Clone for MIDIPacket
impl Clone for MIDIPacket
Source§fn clone(&self) -> MIDIPacket
fn clone(&self) -> MIDIPacket
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MIDIPacket
impl Debug for MIDIPacket
Source§impl Encode for MIDIPacket
Available on crate feature objc2 only.
impl Encode for MIDIPacket
objc2 only.Source§impl PartialEq for MIDIPacket
impl PartialEq for MIDIPacket
Source§impl RefEncode for MIDIPacket
Available on crate feature objc2 only.
impl RefEncode for MIDIPacket
objc2 only.