|
|
The FileRegoniser class will return information about a given file.
It can recognise three file types - the three types that TSE3 provides support for. These are:
FileRecogniser (const std::string &filename)
| FileRecogniser |
Creates a FileRecogniser for a particular file.
Parameters:
filename | The name of the file to query |
enum { Type_Error, Type_Unknown, Type_TSE3MDL, Type_TSE2MDL, Type_Midi } |
int type ()
| type |
[const]
Returns the type of the file. The value will be one of the below:
Returns: The type of the specified file
size_t size ()
| size |
[const]
Returns the size of the file.
Returns: The size of the file in bytes.
Song * load (Progress *progress)
| load |
Loads the file in the appropriate way.
This will use either the TSE3MDL, MidiImport or TSE2MDL classes to create a Song from the data in the file.
If the file is of an unknown type, this will return zero.
Any exception that may be thrown by the three file loading classes may pass from this method.
The loaded Song will have been created with new, it is now your responsibility to delete it.
Parameters:
progress | A callback progress interface, or zero for none |
Returns: A newly loaded Song, or zero for faliure