[][src]Enum ghakuf::messages::MidiEvent

pub enum MidiEvent {
    NoteOff {
        ch: u8,
        note: u8,
        velocity: u8,
    },
    NoteOn {
        ch: u8,
        note: u8,
        velocity: u8,
    },
    PolyphonicKeyPressure {
        ch: u8,
        note: u8,
        velocity: u8,
    },
    ControlChange {
        ch: u8,
        control: u8,
        data: u8,
    },
    ProgramChange {
        ch: u8,
        program: u8,
    },
    ChannelPressure {
        ch: u8,
        pressure: u8,
    },
    PitchBendChange {
        ch: u8,
        data: i16,
    },
    Unknown {
        ch: u8,
    },
}

An enum representing Midi event of SMF.

Examples

use ghakuf::messages::{MessageTool, MidiEvent};

let event: MidiEvent = MidiEvent::NoteOff { ch: 0x04, note: 0x02, velocity: 0x00 };
assert_eq!(event.binary(), [0x84, 0x02, 0x00]);

Variants

NoteOff

Fields of NoteOff

ch: u8note: u8velocity: u8
NoteOn

Fields of NoteOn

ch: u8note: u8velocity: u8
PolyphonicKeyPressure

Fields of PolyphonicKeyPressure

ch: u8note: u8velocity: u8
ControlChange

Fields of ControlChange

ch: u8control: u8data: u8
ProgramChange

Fields of ProgramChange

ch: u8program: u8
ChannelPressure

Fields of ChannelPressure

ch: u8pressure: u8
PitchBendChange

Fields of PitchBendChange

ch: u8data: i16
Unknown

Fields of Unknown

ch: u8

Trait Implementations

impl Clone for MidiEvent[src]

impl Debug for MidiEvent[src]

impl Display for MidiEvent[src]

impl MessageTool for MidiEvent[src]

impl PartialEq<MidiEvent> for MidiEvent[src]

impl StructuralPartialEq for MidiEvent[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.