Lomse library. API documentation
0.30.0
|
#include <lomse_mxl_exporter.h>
MxlExporter is responsible for generating the MusicXML source format for an score. Exporting a document is a simple operation. It is just instantiating the exporter object, specifying the desired generation options and request to generate the source code. Example:
Public Member Functions | |
MxlExporter (LibraryScope &libScope) | |
virtual | ~MxlExporter () |
Main methods for generating the source code | |
std::string | get_source (ImoObj *pImo) |
std::string | get_source (AScore score) |
Options for generating code | |
void | set_indent_spaces (int spaces) |
void | set_remove_newlines (bool value) |
void | set_remove_separator_lines (bool value) |
Getters for current options | |
int | get_indent_spaces () const |
bool | get_remove_newlines () const |
bool | get_remove_separator_lines () const |
MxlExporter::MxlExporter | ( | LibraryScope & | libScope | ) |
Constructor
|
virtual |
Destructor
|
inline |
Returns current setting for the number of spaces that will be generated for each indentation step.
|
inline |
Returns current setting: true if neither newlines nor indentation spaces will be generated.
|
inline |
Returns current setting: true for not generating separator lines.
|
inline |
This method generates the source code for the object passed as argument. The method is oriented to generate the full source code for an score but also can be used to generate partial source code for an element. This can be useful for tests or other purposes. PLEASE take into account that not all objects can directly generate source code, and that for others the code can be incomplete.
pImo | The object whose source code is requested. |
std::string MxlExporter::get_source | ( | AScore | score | ) |
This method generates the source code for the score passed as argument.
score | The score whose source code is requested. |
|
inline |
This method controls the number of spaces that will be generated for each indentation step. By default, the exporter uses three spaces per step. Indentation is supressed when remove newlines is set to true. See set_remove_newlines().
spaces | The number of spaces to use for each indentation step. |
|
inline |
This method controls generation of newlines. When set to true maximum compactness will be achieved: no newlines and no indentation spaces will be generated. Default value is false so newlines and indentation spaces will be generated. The number of indentation spaces can be controlled with method set_indent_spaces().
value | true for not generating neither newlines nor indent spaces. |
|
inline |
This method controls generation of separator lines between <measure> elements. By default, the exporter will generate separator lines.
value | true for not generating separator lines. |