class MidiFileExport

MIDI file exporter. More...

Full nameTSE3::MidiFileExport
Definition#include <MidiFile.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

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:
songThe Song to convert.
formatThe MIDI file format: 0 or 1. 1 retains the most information in the file
outThe output stream to export to.
compactWhether or not to compact MidiCommand_NoteOffs to NoteOns with velocity 0 (saves a lot of extra status bytes thanks to running status)
verboseLevel of diagnostic output to produce 0: none, 1: basic reporting at chunk level 2: Include meta information 3: list all MIDI commands
d_outThe 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:
progressObject 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)