Struct rimd::SMFWriter [] [src]

pub struct SMFWriter { /* fields omitted */ }

An SMFWriter is used to write an SMF to a file. It can be either constructed empty and have tracks added, or created from an existing rimd::SMF.

Writing an existing SMF to a file

use rimd::{SMF,SMFWriter};
// Create smf
let writer = SMFWriter::from_smf(smf);
let result = writer.write_to_file(Path::new("/path/to/file.smf"));
// handle result

Methods

impl SMFWriter
[src]

Create a new SMFWriter with the given number of units per beat. The SMFWriter will initially have no tracks.

Create a new SMFWriter with the given format and number of units per beat. The SMFWriter will initially have no tracks.

Create a writer that has all the tracks from the given SMF already added

Add any sequence of AbsoluteEvents as a track to this writer

Add any sequence of AbsoluteEvents as a track to this writer. A meta event with the given name will be added at the start of the track

Write out all the tracks that have been added to this SMFWriter to the passed writer

Write out the result of the tracks that have been added to a file. Warning: This will overwrite an existing file