|
|
Utility to export MIDI files converted from a TSE3 Song.
See also: Song, MidiFileImport
| MidiFileExport (int format = 1,
bool compact = true,
int verbose = 0,
std::ostream &d_out = std::cout)
| MidiFileExport |
Creates a MidiFileExport object for the given Song.
Parameters:
| song | The Song to convert. |
| format | The MIDI file format: 0 or 1. 1 retains the most information in the file |
| out | The output stream to export to. |
| compact | Whether or not to compact MidiCommand_NoteOffs to NoteOns with velocity 0 (saves a lot of extra status bytes thanks to running status) |
| verbose | Level of diagnostic output to produce 0: none, 1: basic reporting at chunk level 2: Include meta information 3: list all MIDI commands |
| d_out | The output stream to produce diagnostics on |
| ~MidiFileExport ()
| ~MidiFileExport |
| void save (const std::string &filename, Song *song,
Progress *progress = 0)
| save |
Performs the MIDI file export.
If the file fails to open, then a MidiFileExportError exception is thrown.
Parameters:
| progress | Object to call back to, or zero for no progress information |
| void save (std::ostream &out, Song *song, Progress *progress = 0)
| save |
As save above, but you specify the ostream.
| int format ()
| format |
[const]
Returns MIDI file format.
This method can be used to find out information after the MIDI file has been exported.
Returns: MIDI file format as supplied to constructor
| size_t size ()
| size |
[const]
Returns the size of the exported MIDI file.
This method can be used to find out information after the MIDI file has been exported.
Returns: Size in bytes of the exported MIDI file
| int noMTrks ()
| noMTrks |
[const]
Returns the number of MTrks in the exported MIDI file.
This method can be used to find out information after the MIDI file has been exported.
Returns: The number of MTrks in the exported MIDI file
| bool compact ()
| compact |
[const]
Returns whether MidiCommand_NoteOffs were compacted.
This method can be used to find out information after the MIDI file has been exported.
Returns: Whether compaction was applied (as supplied to constructor)