Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

TSE3::MidiFileExport Class Reference

MIDI file exporter. More...

#include <MidiFile.h>

Collaboration diagram for TSE3::MidiFileExport:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MidiFileExport (int format=1, bool compact=true, int verbose=0, std::ostream &d_out=std::cout)
 ~MidiFileExport ()
void save (const std::string &filename, Song *song, Progress *progress=0)
void save (std::ostream &out, Song *song, Progress *progress=0)
int format () const
size_t size () const
int noMTrks () const
bool compact () const

Detailed Description

MIDI file exporter.

Utility to export MIDI files converted from a TSE3 Song.

Author:
Pete Goodliffe
Version:
3.00
See also:
Song

MidiFileImport


Constructor & Destructor Documentation

TSE3::MidiFileExport::MidiFileExport int  format = 1,
bool  compact = true,
int  verbose = 0,
std::ostream &  d_out = std::cout
 

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

TSE3::MidiFileExport::~MidiFileExport  ) 
 


Member Function Documentation

void TSE3::MidiFileExport::save const std::string &  filename,
Song song,
Progress progress = 0
 

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 TSE3::MidiFileExport::save std::ostream &  out,
Song song,
Progress progress = 0
 

As save above, but you specify the ostream.

int TSE3::MidiFileExport::format  )  const [inline]
 

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 TSE3::MidiFileExport::size  )  const [inline]
 

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 TSE3::MidiFileExport::noMTrks  )  const [inline]
 

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 TSE3::MidiFileExport::compact  )  const [inline]
 

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)


The documentation for this class was generated from the following file:
Generated on Wed May 25 14:46:29 2005 for TSE3 by doxygen 1.3.2