pub struct MidiFile { /* private fields */ }
Expand description
Represents a MIDI file, which consists of a header identifying the type of MIDI file, and tracks with MIDI data.
Implementations§
Source§impl MidiFile
impl MidiFile
Sourcepub fn running_status(&self) -> bool
pub fn running_status(&self) -> bool
A getter for the running_status
field.
Sourcepub fn new_with_settings(settings: Settings) -> Self
pub fn new_with_settings(settings: Settings) -> Self
Create a new MidiFile
with customizable Settings
.
Sourcepub fn tracks_len(&self) -> u32
pub fn tracks_len(&self) -> u32
The number of tracks, i.e. the length of the vector of tracks.
Sourcepub fn track(&self, index: u32) -> Option<&Track>
pub fn track(&self, index: u32) -> Option<&Track>
Get a reference to the track at index
if it exists.
Sourcepub fn push_track(&mut self, track: Track) -> Result<()>
pub fn push_track(&mut self, track: Track) -> Result<()>
Add a track to the file.
Sourcepub fn insert_track(&mut self, index: u32, track: Track) -> Result<()>
pub fn insert_track(&mut self, index: u32, track: Track) -> Result<()>
Insert a track at a certain place in the vector of tracks.
Sourcepub fn remove_track(&mut self, index: u32) -> Result<Track>
pub fn remove_track(&mut self, index: u32) -> Result<Track>
Remove a track from the file. Same behavior as vec.remove(index)
.
Trait Implementations§
Source§impl Ord for MidiFile
impl Ord for MidiFile
Source§impl PartialOrd for MidiFile
impl PartialOrd for MidiFile
impl Eq for MidiFile
impl StructuralPartialEq for MidiFile
Auto Trait Implementations§
impl Freeze for MidiFile
impl RefUnwindSafe for MidiFile
impl Send for MidiFile
impl Sync for MidiFile
impl Unpin for MidiFile
impl UnwindSafe for MidiFile
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