pub enum MetaMessage<'a> {
Show 19 variants
TrackNumber(Option<u16>),
Text(&'a [u8]),
Copyright(&'a [u8]),
TrackName(&'a [u8]),
InstrumentName(&'a [u8]),
Lyric(&'a [u8]),
Marker(&'a [u8]),
CuePoint(&'a [u8]),
ProgramName(&'a [u8]),
DeviceName(&'a [u8]),
MidiChannel(u4),
MidiPort(u7),
EndOfTrack,
Tempo(u24),
SmpteOffset(SmpteTime),
TimeSignature(u8, u8, u8, u8),
KeySignature(i8, bool),
SequencerSpecific(&'a [u8]),
Unknown(u8, &'a [u8]),
}Expand description
A “meta message”, as defined by the SMF spec. These events carry metadata about the track, such as tempo, time signature, copyright, etc…
Variants§
TrackNumber(Option<u16>)
For Format::Sequential MIDI file types, TrackNumber can be empty, and defaults to
the track index.
Text(&'a [u8])
Arbitrary text associated to an instant.
Copyright(&'a [u8])
A copyright notice.
TrackName(&'a [u8])
Information about the name of the track.
InstrumentName(&'a [u8])
Information about the name of the current instrument.
Lyric(&'a [u8])
Arbitrary lyric information associated to an instant.
Marker(&'a [u8])
Arbitrary marker text associated to an instant.
CuePoint(&'a [u8])
Arbitrary cue point text associated to an instant.
ProgramName(&'a [u8])
Information about the name of the current program.
DeviceName(&'a [u8])
Name of the device that this file was intended to be played with.
MidiChannel(u4)
Number of the MIDI channel that this file was intended to be played with.
MidiPort(u7)
Number of the MIDI port that this file was intended to be played with.
EndOfTrack
Obligatory at track end.
Tempo(u24)
Amount of microseconds per beat (quarter note).
Usually appears at the beggining of a track, before any midi events are sent, but there are no guarantees.
SmpteOffset(SmpteTime)
The MIDI SMPTE offset meta message specifies an offset for the starting point of a MIDI track from the start of a sequence in terms of SMPTE time (hours:minutes:seconds:frames:subframes).
TimeSignature(u8, u8, u8, u8)
In order of the MIDI specification, numerator, denominator, MIDI clocks per click, 32nd notes per quarter
KeySignature(i8, bool)
As in the MIDI specification, negative numbers indicate number of flats and positive
numbers indicate number of sharps.
false indicates a major scale, true indicates a minor scale.
SequencerSpecific(&'a [u8])
Arbitrary data intended for the sequencer. This data is never sent to a device.
Unknown(u8, &'a [u8])
An unknown or malformed meta-message.
The first u8 is the raw meta-message identifier byte.
The slice is the actual payload of the meta-message.
Implementations§
Source§impl<'a> MetaMessage<'a>
impl<'a> MetaMessage<'a>
Sourcepub fn to_static(&self) -> MetaMessage<'static>
pub fn to_static(&self) -> MetaMessage<'static>
Remove any lifetimed data from this event to create a MidiMessage 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§
Source§impl<'a> Clone for MetaMessage<'a>
impl<'a> Clone for MetaMessage<'a>
Source§fn clone(&self) -> MetaMessage<'a>
fn clone(&self) -> MetaMessage<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for MetaMessage<'a>
impl<'a> Debug for MetaMessage<'a>
Source§impl<'a> Hash for MetaMessage<'a>
impl<'a> Hash for MetaMessage<'a>
Source§impl<'a> PartialEq for MetaMessage<'a>
impl<'a> PartialEq for MetaMessage<'a>
impl<'a> Copy for MetaMessage<'a>
impl<'a> Eq for MetaMessage<'a>
impl<'a> StructuralPartialEq for MetaMessage<'a>
Auto Trait Implementations§
impl<'a> Freeze for MetaMessage<'a>
impl<'a> RefUnwindSafe for MetaMessage<'a>
impl<'a> Send for MetaMessage<'a>
impl<'a> Sync for MetaMessage<'a>
impl<'a> Unpin for MetaMessage<'a>
impl<'a> UnwindSafe for MetaMessage<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more