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

TSE3::MidiFileImport Class Reference

MIDI file importer. More...

#include <MidiFile.h>

Inheritance diagram for TSE3::MidiFileImport:

Inheritance graph
[legend]
Collaboration diagram for TSE3::MidiFileImport:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MidiFileImport (const std::string &filename, int verbose=0, std::ostream &out=std::cout)
 ~MidiFileImport ()
Songload (Progress *progress=0)
virtual PlayableIteratoriterator (Clock index)
virtual Clock lastClock () const

Friends

class MidiFileImportIterator

Detailed Description

MIDI file importer.

Utility to import a MIDI file and convert it into a TSE3 Song.

There are two ways to play a standard MIDI file. One is to create a MidiFileImport object, use it to generate a Song and then play that. You will also be able to edit the Song and save it again.

The second way to play a MIDI file it to use the MidiFileImport class' Playable interface - this will generate a MidiFileImportIterator object. The advantage of this is that you do not have to delay for the import process (which for large MIDI files can be significant). On the other hand, the data will not be editable or modifiable.

If you only need to play the MIDI file, use the second method. If you need to modify the MIDI file data you need to use the load method to generate a Song.

Author:
Pete Goodliffe
Version:
3.00
See also:
Song

MidiFileExport


Constructor & Destructor Documentation

TSE3::MidiFileImport::MidiFileImport const std::string &  filename,
int  verbose = 0,
std::ostream &  out = std::cout
 

Creates a MidiFileImport object for the given MIDI file.

If the file fails to open, then a MidiFileImportError exception is thrown.

Parameters:
filename Filename of MIDI file to import.
verbose Level of diagnostic output to produce 0: none, 1: basic reporting at chunk level 2: Include meta information 3: list all MIDI commands
out ostream to produce output on.
Exceptions:
MidiFileImportError 

TSE3::MidiFileImport::~MidiFileImport  ) 
 


Member Function Documentation

Song* TSE3::MidiFileImport::load Progress progress = 0  ) 
 

Performs the MIDI file import, and returns a pointer to a Song object holding the imported MIDI data.

This Song object has been newed by the MidiFileImport object; it is your responsability to delete it.

Parameters:
progress Object to call back to, or zero for no progress information
Returns:
New imported Song - you must delete it
Exceptions:
MidiFileImportError 

virtual PlayableIterator* TSE3::MidiFileImport::iterator Clock  index  )  [virtual]
 

Implements TSE3::Playable.

virtual Clock TSE3::MidiFileImport::lastClock  )  const [virtual]
 

Calling this is likely to take longer than for most other Playable objects since the entire MIDI file has to be scanned to determine the last clock time. This delay will probably not be noticeable for any but the largest MIDI files.

After you have done this once the result is cached for faster subsequent access.

Implements TSE3::Playable.


Friends And Related Function Documentation

friend class MidiFileImportIterator [friend]
 


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