class FileRecogniser

Object used to work out a file's type. More...

Full nameTSE3::FileRecogniser
Definition#include <TSE3MDL.h>
List of all Methods
Annotated List

Public Types

Public Methods

Detailed Description

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)


Creates a FileRecogniser for a particular file.

filenameThe name of the file to query

enum { Type_Error, Type_Unknown, Type_TSE3MDL, Type_TSE2MDL, Type_Midi }

int  type ()



Returns the type of the file. The value will be one of the below:

Returns: The type of the specified file

size_t  size ()



Returns the size of the file.

Returns: The size of the file in bytes.

Song * load (Progress *progress)


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.

progressA callback progress interface, or zero for none

Returns: A newly loaded Song, or zero for faliure