Enum MetaEvent

Source
pub enum MetaEvent<'src> {
Show 19 variants SequenceNumber(u16), Text(&'src [u8]), Copyright(&'src [u8]), SequenceOrTrackName(&'src [u8]), InstrumentName(&'src [u8]), Lyric(&'src [u8]), Marker(&'src [u8]), CuePoint(&'src [u8]), ProgramName(&'src [u8]), DeviceName(&'src [u8]), MidiChannelPrefix(u8), MidiPort(u8), EndOfTrack, Tempo(u32), SMPTEOffset(SMPTEOffset), TimeSignature(TimeSignature), KeySignature(KeySignature), SequencerSpecificEvent(&'src [u8]), Unknown(u8, &'src [u8]),
}
Expand description

A special non-MIDI event

Variants§

§

SequenceNumber(u16)

The sequence number (as would be used in a MIDI Cue message)

§

Text(&'src [u8])

Free text, can include comments and other useful information, if that information doesn’t naturally fit in another text-based field

§

Copyright(&'src [u8])

A copyright notice

§

SequenceOrTrackName(&'src [u8])

The name of the current sequence or track (depending on context)

§

InstrumentName(&'src [u8])

The name of the current track The name of the instrument for this track (e.g. “Flute”, “Piano”, “Tenor”, etc.)

§

Lyric(&'src [u8])

A syllable or set of syllables to be sung as part of a vocal track.

§

Marker(&'src [u8])

A useful position-dependent note in the music (e.g. rehersal mark “A”, loop point, section name)

§

CuePoint(&'src [u8])

A marker to indicate this event should be synchronized with some non-midi event, e.g. “car crash on screen”, “actors leave stage”, etc.

§

ProgramName(&'src [u8])

Indicates what patch or program name should be used by the immediately subsequent Bank Select and Program Change messages.

§

DeviceName(&'src [u8])

The name of the hardware device used to produce sounds for this track. Might be inserted for example if using a branded synth or keyboard to generate midi events.

§

MidiChannelPrefix(u8)

Indicate which channel subsequent SysEx and Meta events apply to. Lasts until the next event of this type, or a normal MIDI event

§

MidiPort(u8)

Specify which port future MIDI event apply to. This exists to increase the 4-bit channel limit, and so it’s functionality overlaps with channels

§

EndOfTrack

This event must be at the end of each track, and must not be anywhere else

§

Tempo(u32)

Specifies the number of microseconds per quarter note for future MIDI events.

§

SMPTEOffset(SMPTEOffset)

This is complicated and I don’t understand it.

§

TimeSignature(TimeSignature)

Set the time signature. If no time signature event occurs before a MIDI event the default is (4, 4)

§

KeySignature(KeySignature)

Set the key signature. The default is C major.

§

SequencerSpecificEvent(&'src [u8])

Vendor specific events. I don’t try to parse them - just return the data

§

Unknown(u8, &'src [u8])

An unrecognised event. To be future-compatible, just ignore these

Trait Implementations§

Source§

impl<'src> Clone for MetaEvent<'src>

Source§

fn clone(&self) -> MetaEvent<'src>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'src> Debug for MetaEvent<'src>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'src> PartialEq for MetaEvent<'src>

Source§

fn eq(&self, other: &MetaEvent<'src>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'src> StructuralPartialEq for MetaEvent<'src>

Auto Trait Implementations§

§

impl<'src> Freeze for MetaEvent<'src>

§

impl<'src> RefUnwindSafe for MetaEvent<'src>

§

impl<'src> Send for MetaEvent<'src>

§

impl<'src> Sync for MetaEvent<'src>

§

impl<'src> Unpin for MetaEvent<'src>

§

impl<'src> UnwindSafe for MetaEvent<'src>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.