|
|
The TSE3MDL object provides file operations for the TSE3 library, being the main entry point for saving/loading in the TSE3MDL file format.
It uses the Serializable interface implemented by the various TSE3 classes.
See also: Serializable
TSE3MDL (const std::string &appname = "",
int verbose = 0,
std::ostream &diag = std::cout)
| TSE3MDL |
Create a TSE3MDL file operations object.
Parameters:
appname | Name of the application using TSE3. This is saved into the TSE3MDL file header |
verbose | Diagnostic level, normally you want to ignore this and accept the default value |
diag | Where to send any diagnostic output |
void save (const std::string &filename, const Song *song)
| save |
Save the given Song to the file specified. If the file already exists it will be overwritten.
This will save the appropriate fill header and then call the Song class's save method.
Parameters:
filename | Filename to save to |
song | Song object to save |
Throws: SerializableError
void save (std::ostream &out, const Song *song)
| save |
As save above, but you specify the ostream.
Song * load (const std::string &filename, Progress *progress = 0)
| load |
Load a Song from the file specified. The returned Song will have been newed from the free store, and so when you have finished with it it is your responsibility to delete it.
Parameters:
filename | Filename to save to |
progress | The progress callback to keep informed of progress, or zero for no callback |
Returns: The loaded Song - you must delete it
Throws: SerializableError
static const int MajorVersion | MajorVersion |
static const int MinorVersion | MinorVersion |