GUIDOLib  1.6.8
A Music Score Rendering Engine
Modules | Functions | Variables
Guido Engine Adapter

A C++ interface to the Guido Engine API. More...

Modules

 Building abstract and graphic representations
 
 Miscellaneous
 
 Timing measurements
 
 Parsing GMN files, strings and guido streams
 

Functions

virtual ~GuidoEngineAdapter ()
 ~GuidoEngineAdapter More...
 

Variables

class_export GuidoEngineAdapter
 
int countVoices (CARHandler inHandleAR)
 Gives the number of score pages of the graphic representation. More...
 
int getPageCount (CGRHandler inHandleGR)
 Gives the number of score pages of the graphic representation. More...
 
int getSystemCount (CGRHandler inHandleGR, int page)
 Gives the number of systems on a given page. More...
 
GuidoDate duration (CGRHandler inHandleGR)
 Returns the music duration of a score. More...
 
int findEventPage (CGRHandler inHandleGR, const GuidoDate &date)
 Finds the page which has an event (note or rest) at a given date. More...
 
int findPageAt (CGRHandler inHandleGR, const GuidoDate &date)
 Finds the page which contain a given date. More...
 
GuidoDate getPageDate (CGRHandler inHandleGR, int pageNum)
 Gives the time location of a Page. More...
 
GuidoErrCode onDraw (GuidoOnDrawDesc *desc)
 Draws one page of score into a graphic device. More...
 
std::string gr2SVG (const GRHandler handle, int page, std::ostream &out, int w, int h, bool embedFont=true)
 Exports one page of score to SVG. More...
 
GuidoErrCode gr2SVG (const GRHandler handle, int page, std::ostream &out, bool embedFont=true, const char *font=0, const int mappingMode=0)
 Exports one page of score to SVG. More...
 
std::string gr2SVG (const GRHandler handle, int page, bool embedfont=true, const int mappingMode=0)
 Exports one page of score to SVG. More...
 
std::string gr2SVGColored (const GRHandler handle, int page, int r, int g, int b, bool embedfont=true)
 Exports one page of score to SVG. More...
 
GuidoErrCode abstractExport (const GRHandler handle, int page, std::ostream &out)
 Exports an abstract representation of GUIDO draw commands. More...
 
std::string abstractExport (const GRHandler handle, int page)
 Exports an abstract representation of GUIDO draw commands. More...
 
GuidoErrCode binaryExport (const GRHandler handle, int page, std::ostream &out)
 Exports an representation of GUIDO draw commands in a data-reduced dsl. More...
 
std::string binaryExport (const GRHandler handle, int page)
 Exports an representation of GUIDO draw commands in a data-reduced dsl. More...
 
void setDrawBoundingBoxes (int bbMap)
 Control bounding boxes drawing. More...
 
int getDrawBoundingBoxes ()
 Gives bounding boxes drawing state. More...
 
GuidoPageFormat getPageFormat (CGRHandler inHandleGR, int pageNum)
 Gives a score page format. More...
 
void setDefaultPageFormat (const GuidoPageFormat &format)
 Sets the default score page format. More...
 
GuidoPageFormat getDefaultPageFormat ()
 Gives the default score page format. More...
 
float unit2CM (float val)
 Converts internal Guido units into centimeters. More...
 
float cm2Unit (float val)
 Converts centimeters into internal Guido units. More...
 
float unit2Inches (float val)
 Converts internal Guido units into inches. More...
 
float inches2Unit (float val)
 Converts inches into internal Guido units. More...
 
GuidoErrCode resizePageToMusic (GRHandler inHandleGR)
 Resize the page sizes to the music size. More...
 

Detailed Description

A C++ interface to the Guido Engine API.

Function Documentation

◆ abstractExport() [1/2]

std::string abstractExport ( const GRHandler  handle,
int  page 
)

Exports an abstract representation of GUIDO draw commands.

Parameters
handlea graphic representation.
pagethe page number.
Returns
the export in a string

◆ abstractExport() [2/2]

GuidoErrCode abstractExport ( const GRHandler  handle,
int  page,
std::ostream &  out 
)

Exports an abstract representation of GUIDO draw commands.

Parameters
handlea graphic representation.
pagethe page number.
outthe output stream.
Returns
a Guido error code

◆ binaryExport() [1/2]

std::string binaryExport ( const GRHandler  handle,
int  page 
)

Exports an representation of GUIDO draw commands in a data-reduced dsl.

Parameters
handlea graphic representation.
pagethe page number.
Returns
a Guido error code

◆ binaryExport() [2/2]

GuidoErrCode binaryExport ( const GRHandler  handle,
int  page,
std::ostream &  out 
)

Exports an representation of GUIDO draw commands in a data-reduced dsl.

Parameters
handlea graphic representation.
pagethe page number.
outthe output stream.
Returns
a Guido error code

◆ cm2Unit()

float cm2Unit ( float  val)

Converts centimeters into internal Guido units.

Parameters
valthe value to be converted
Returns
the converted value

◆ countVoices()

int countVoices ( CARHandler  inHandleAR)

Gives the number of score pages of the graphic representation.

\addtogroup Pages2 Browsing music pages
\ingroup EngineAdapter
The Guido Engine produces pages of music and therefore, the graphic representation
consists in a collection of pages.
The following functions are intended to access these pages by page number as well
as by date. Page numbers start at 1.
Parameters
inHandleARa Guido opaque handle to a AR structure.
Returns
the number of voices or a guido error code.

◆ duration()

GuidoDate duration ( CGRHandler  inHandleGR)

Returns the music duration of a score.

The duration is expressed as a fractional value where 1 represents a whole note.

Parameters
inHandleGRa Guido opaque handle to a GR structure.
Returns
the duration expressed as a fractional value.

◆ findEventPage()

int findEventPage ( CGRHandler  inHandleGR,
const GuidoDate date 
)

Finds the page which has an event (note or rest) at a given date.

Bug:
returns page + 1 when input date falls on the last system.
Parameters
inHandleGRa Guido opaque handle to a GR structure.
datethe target date.
Returns
a page number if greater than 0, 0 if no page found,

◆ findPageAt()

int findPageAt ( CGRHandler  inHandleGR,
const GuidoDate date 
)

Finds the page which contain a given date.

Bug:
returns page + 1 when input date falls on the last system.
Parameters
inHandleGRa Guido opaque handle to a GR structure.
datethe target date.
Returns
a page number if greater than 0, 0 if no page found,

◆ getDefaultPageFormat()

GuidoPageFormat getDefaultPageFormat ( )

Gives the default score page format.

Returns
the page format

◆ getDrawBoundingBoxes()

int getDrawBoundingBoxes ( )

Gives bounding boxes drawing state.

Returns
the bit field.

◆ getPageCount()

int getPageCount ( CGRHandler  inHandleGR)

Gives the number of score pages of the graphic representation.

Parameters
inHandleGRa Guido opaque handle to a GR structure.
Returns
a number of pages or a guido error code.

◆ getPageDate()

GuidoDate getPageDate ( CGRHandler  inHandleGR,
int  pageNum 
)

Gives the time location of a Page.

Parameters
inHandleGRa Guido opaque handle to a GR structure.
pageNuma page number (starts at 1).
Returns
a GuidoDate

◆ getPageFormat()

GuidoPageFormat getPageFormat ( CGRHandler  inHandleGR,
int  pageNum 
)

Gives a score page format.

Parameters
inHandleGRa Guido opaque handle to a GR structure.
pageNuma page number.
Returns
the page format

◆ getSystemCount()

int getSystemCount ( CGRHandler  inHandleGR,
int  page 
)

Gives the number of systems on a given page.

Parameters
inHandleGRa Guido opaque handle to a GR structure.
pagea page number (starts at 1).
Returns
the systems count on the given page or a guido error code.

◆ gr2SVG() [1/3]

std::string gr2SVG ( const GRHandler  handle,
int  page,
bool  embedfont = true,
const int  mappingMode = 0 
)

Exports one page of score to SVG.

Parameters
handlea graphic representation.
pagethe page number.
embedfonta boolean value. When true, the default svg guido font is embedded to the SVG.
mappingModea constant to embed a mapping
See also
GuidoMapping.
Returns
SVG code

◆ gr2SVG() [2/3]

GuidoErrCode gr2SVG ( const GRHandler  handle,
int  page,
std::ostream &  out,
bool  embedFont = true,
const char *  font = 0,
const int  mappingMode = 0 
)

Exports one page of score to SVG.

Parameters
handlea graphic representation.
pagethe page number.
outthe output stream.
embedFonta boolean value. When true, the default svg guido font is embedded to the SVG.
fontpath of the guido svg font file (ignored when embedFont is true)
mappingModea constant to embed a mapping
See also
GuidoMapping.
Returns
a Guido error code

◆ gr2SVG() [3/3]

std::string gr2SVG ( const GRHandler  handle,
int  page,
std::ostream &  out,
int  w,
int  h,
bool  embedFont = true 
)

Exports one page of score to SVG.

Parameters
handlea graphic representation.
pagethe page number.
outthe output stream.
wthe drawing area width.
hthe drawing area height.
embedFonta boolean value. When true, the default svg guido font is embedded to the SVG.
Returns
SVG code

◆ gr2SVGColored()

std::string gr2SVGColored ( const GRHandler  handle,
int  page,
int  r,
int  g,
int  b,
bool  embedfont = true 
)

Exports one page of score to SVG.

Parameters
handlea graphic representation.
pagethe page number.
rthe color red component
gthe color green component
bthe color blue component
embedfonta boolean value. When true, the default svg guido font is embedded to the SVG.
Returns
SVG code

◆ inches2Unit()

float inches2Unit ( float  val)

Converts inches into internal Guido units.

Parameters
valthe value to be converted
Returns
the converted value

◆ onDraw()

GuidoErrCode onDraw ( GuidoOnDrawDesc desc)

Draws one page of score into a graphic device.

\addtogroup Format2 Score drawing and pages formating
\ingroup EngineAdapter
The GuidoEngine makes use of internal units for graphic operations.
The functions that query or set graphic dimensions always makes use of
this internal unit. Conversion functions are provided to convert to standard
units.
Parameters
descinformations about what to draw and how to draw.
Returns
a Guido error code

◆ resizePageToMusic()

GuidoErrCode resizePageToMusic ( GRHandler  inHandleGR)

Resize the page sizes to the music size.

Parameters
inHandleGRa Guido opaque handle to a GR structure.
Returns
a Guido error code.

◆ setDefaultPageFormat()

void setDefaultPageFormat ( const GuidoPageFormat format)

Sets the default score page format.

The default page format is used when no \pageFormat tag is present. Parameters are Guido internal units. Default values for the default page format are:

  • paper size: A4
  • left margin: 2cm
  • right margin: 2cm
  • top margin: 5cm
  • bottom margin: 3cm
Parameters
formatthe page format

◆ setDrawBoundingBoxes()

void setDrawBoundingBoxes ( int  bbMap)

Control bounding boxes drawing.

Parameters
bbMapa bits field indicating the set of bounding boxes to draw (default to none).

◆ unit2CM()

float unit2CM ( float  val)

Converts internal Guido units into centimeters.

Parameters
valthe value to be converted
Returns
the converted value

◆ unit2Inches()

float unit2Inches ( float  val)

Converts internal Guido units into inches.

Parameters
valthe value to be converted
Returns
the converted value

◆ ~GuidoEngineAdapter()

virtual ~GuidoEngineAdapter ( )
virtual

~GuidoEngineAdapter

Variable Documentation

◆ GuidoEngineAdapter

class_export GuidoEngineAdapter
Initial value:
{
public:
GuidoEngineAdapter
class_export GuidoEngineAdapter
Definition: GUIDOEngineAdapter.h:64

Guido Project Copyright © 2019 Grame-CNCM