pub struct MidiEvent<T: MidiMessage> { /* private fields */ }
Expand description
Generic Midi event, that easily converted to the binary format.
Implementations
sourceimpl<T: MidiMessage> MidiEvent<T>
impl<T: MidiMessage> MidiEvent<T>
sourcepub fn new(
position_in_ppq: u32,
is_selected: bool,
is_muted: bool,
cc_shape_kind: CcShapeKind,
message: T
) -> Self
pub fn new(
position_in_ppq: u32,
is_selected: bool,
is_muted: bool,
cc_shape_kind: CcShapeKind,
message: T
) -> Self
Position in ppq depends on Take. You can convert by the crate::Position::as_ppq.
sourcepub fn with_new_message<S: MidiMessage>(event: MidiEvent<S>, message: T) -> Self
pub fn with_new_message<S: MidiMessage>(event: MidiEvent<S>, message: T) -> Self
Morph Event to be of other type, replacing original message. Other contents are no moved and copied.
pub fn ppq_position(&self) -> u32
pub fn set_ppq_position(&mut self, position: u32)
pub fn selected(&self) -> bool
pub fn set_selected(&mut self, selected: bool)
pub fn muted(&self) -> bool
pub fn set_muted(&mut self, muted: bool)
pub fn cc_shape_kind(&self) -> CcShapeKind
pub fn set_cc_shape_kind(&mut self, cc_shape_kind: CcShapeKind)
pub fn message(&self) -> &T
pub fn message_mut(&mut self) -> &mut T
pub fn set_message(&mut self, message: T)
Trait Implementations
sourceimpl<T: Clone + MidiMessage> Clone for MidiEvent<T>
impl<T: Clone + MidiMessage> Clone for MidiEvent<T>
sourceimpl<T: Debug + MidiMessage> Debug for MidiEvent<T>
impl<T: Debug + MidiMessage> Debug for MidiEvent<T>
sourceimpl<T: Default + MidiMessage> Default for MidiEvent<T>
impl<T: Default + MidiMessage> Default for MidiEvent<T>
sourceimpl<T: MidiMessage> Display for MidiEvent<T>
impl<T: MidiMessage> Display for MidiEvent<T>
sourceimpl<T: PartialEq + MidiMessage> PartialEq<MidiEvent<T>> for MidiEvent<T>
impl<T: PartialEq + MidiMessage> PartialEq<MidiEvent<T>> for MidiEvent<T>
sourceimpl<T: PartialOrd + MidiMessage> PartialOrd<MidiEvent<T>> for MidiEvent<T>
impl<T: PartialOrd + MidiMessage> PartialOrd<MidiEvent<T>> for MidiEvent<T>
sourcefn partial_cmp(&self, other: &MidiEvent<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &MidiEvent<T>) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: MidiMessage> StructuralPartialEq for MidiEvent<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for MidiEvent<T>where
T: RefUnwindSafe,
impl<T> Send for MidiEvent<T>where
T: Send,
impl<T> Sync for MidiEvent<T>where
T: Sync,
impl<T> Unpin for MidiEvent<T>where
T: Unpin,
impl<T> UnwindSafe for MidiEvent<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read moresourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more