pub struct NoteBuilder(/* private fields */);Implementations§
Source§impl NoteBuilder
impl NoteBuilder
pub const fn new(kind: NoteKind) -> Self
pub fn with_note(note: &Note<'_>) -> Self
pub const fn note_id(self, value: i32) -> Self
pub const fn port_index(self, value: i16) -> Self
pub const fn channel(self, value: i16) -> Self
Sourcepub const fn key(self, value: i16) -> Self
pub const fn key(self, value: i16) -> Self
Examples found in repository?
examples/note_transpose.rs (line 78)
69 fn process(&mut self, process: &mut clap::Process) -> Result<clap::Status, clap::Error> {
70 let in_events = process.in_events();
71 let mut out_events = process.out_events();
72
73 for i in 0..in_events.size() {
74 let header = in_events.get(i);
75
76 if let Ok(note) = header.note() {
77 use clap::EventBuilder;
78 let n = note.update().key(note.key() + 7); // Transpose notes by a perfect fifth.
79 let _ = out_events.try_push(n.event());
80 }
81
82 if let Ok(note_expr) = header.note_expression() {
83 let _ = out_events.try_push(note_expr);
84 }
85
86 if let Ok(midi) = header.midi() {
87 let _ = out_events.try_push(midi);
88 }
89
90 if let Ok(midi2) = header.midi2() {
91 let _ = out_events.try_push(midi2);
92 }
93 }
94
95 Ok(clap::Continue)
96 }pub const fn velocity(self, value: f64) -> Self
pub const fn kind(self, value: NoteKind) -> Self
Trait Implementations§
Source§impl Clone for NoteBuilder
impl Clone for NoteBuilder
Source§fn clone(&self) -> NoteBuilder
fn clone(&self) -> NoteBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NoteBuilder
impl Debug for NoteBuilder
Source§impl Default for NoteBuilder
impl Default for NoteBuilder
Source§impl EventBuilder for NoteBuilder
impl EventBuilder for NoteBuilder
Source§impl PartialEq for NoteBuilder
impl PartialEq for NoteBuilder
impl Copy for NoteBuilder
impl StructuralPartialEq for NoteBuilder
Auto Trait Implementations§
impl Freeze for NoteBuilder
impl RefUnwindSafe for NoteBuilder
impl Send for NoteBuilder
impl Sync for NoteBuilder
impl Unpin for NoteBuilder
impl UnwindSafe for NoteBuilder
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
Mutably borrows from an owned value. Read more