pub enum TrackEventKind<'a> {
    Midi {
        channel: u4,
        message: MidiMessage,
    },
    SysEx(&'a [u8]),
    Escape(&'a [u8]),
    Meta(MetaMessage<'a>),
}
Expand description

Represents the different kinds of SMF events and their associated data.

It notably does not include the timing of the event; the TrackEvent struct is responsible for this.

Variants§

§

Midi

Fields

§channel: u4

The MIDI channel that this event is associated with.

§message: MidiMessage

The MIDI message type and associated data.

A message associated to a MIDI channel carrying musical data.

Usually, the bulk of MIDI data is these kind of messages.

§

SysEx(&'a [u8])

A System Exclusive message, carrying arbitrary data.

The data bytes included here do not include the implicit 0xF0 prefix.

Usually SysEx events end with an 0xF7 byte, but SysEx events that are split into several small packets may only contain the 0xF7 byte in the last packet fragment.

§

Escape(&'a [u8])

An escape sequence, intended to send arbitrary data to the MIDI synthesizer.

§

Meta(MetaMessage<'a>)

A meta-message, giving extra information for correct playback, like tempo, song name, lyrics, etc…

Implementations§

Lossy conversion from a track event to a live event.

Only channel MIDI messages and not-split SysEx messages can be converted. Meta messages and arbitrary escapes yield None when converted.

Remove any lifetimed data from this event to create a TrackEventKind with 'static lifetime that can be stored and moved everywhere, solving borrow checker issues.

WARNING: Any bytestrings in the input will be replaced by empty bytestrings.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.