#[non_exhaustive]pub struct MidiFileSequencer { /* private fields */ }Expand description
An instance of the MIDI file sequencer.
Implementations§
Source§impl MidiFileSequencer
impl MidiFileSequencer
Sourcepub fn new(synthesizer: Synthesizer) -> Self
pub fn new(synthesizer: Synthesizer) -> Self
Initializes a new instance of the sequencer.
§Arguments
synthesizer- The synthesizer to be handled by the sequencer.
Sourcepub fn play(&mut self, midi_file: &Arc<MidiFile>, play_loop: bool)
pub fn play(&mut self, midi_file: &Arc<MidiFile>, play_loop: bool)
Plays the MIDI file.
§Arguments
midi_file- The MIDI file to be played.play_loop- Iftrue, the MIDI file loops after reaching the end.
Sourcepub fn get_synthesizer(&self) -> &Synthesizer
pub fn get_synthesizer(&self) -> &Synthesizer
Gets the synthesizer handled by the sequencer.
Sourcepub fn get_midi_file(&self) -> Option<&MidiFile>
pub fn get_midi_file(&self) -> Option<&MidiFile>
Gets the currently playing MIDI file.
Sourcepub fn get_position(&self) -> f64
pub fn get_position(&self) -> f64
Gets the current playback position in seconds.
Sourcepub fn end_of_sequence(&self) -> bool
pub fn end_of_sequence(&self) -> bool
Gets a value that indicates whether the current playback position is at the end of the sequence.
§Remarks
If the play method has not yet been called, this value will be true.
This value will never be true if loop playback is enabled.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MidiFileSequencer
impl RefUnwindSafe for MidiFileSequencer
impl Send for MidiFileSequencer
impl Sync for MidiFileSequencer
impl Unpin for MidiFileSequencer
impl UnwindSafe for MidiFileSequencer
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