#include <MidiFile.h>
Inheritance diagram for TSE3::MidiFileImport:
Public Member Functions | |
MidiFileImport (const std::string &filename, int verbose=0, std::ostream &out=std::cout) | |
~MidiFileImport () | |
Song * | load (Progress *progress=0) |
virtual PlayableIterator * | iterator (Clock index) |
virtual Clock | lastClock () const |
Friends | |
class | MidiFileImportIterator |
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.
|
Creates a MidiFileImport object for the given MIDI file. If the file fails to open, then a MidiFileImportError exception is thrown.
|
|
|
|
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.
|
|
Implements TSE3::Playable. |
|
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. |
|
|