GUIDOLib  1.7.7
A Music Score Rendering Engine
Classes | Typedefs | Enumerations | Functions | Variables
GUIDO Mapping

Classes

struct  GuidoElementInfos
 Information related to elements. More...
 
class  MapCollector
 an abstract class to be provided by clients to collect mappings More...
 
class  RectInfos
 information associated to a rectangle in a mapping (MapElement) More...
 
class  TimeMapCollector
 an abstract class to be provided by clients to collect time mappings More...
 

Typedefs

typedef std::pair< TimeSegment, FloatRect > TMapSegments
 
typedef std::pair< TimeSegment, TimeSegmentTTimeMapSegments
 
typedef std::vector< TMapSegmentsTime2GraphicMap
 
typedef std::vector< TTimeMapSegmentsTTime2TimeMap
 
typedef Time2GraphicMap::const_iterator Time2GraphicMapIterator
 
typedef std::pair< FloatRect, RectInfosMapElement
 
typedef std::pair< TimeSegment, TimeSegmentTimeMapElement
 

Enumerations

enum  GuidoElementSelector {
  kGuidoPage, kGuidoSystem, kGuidoSystemSlice, kGuidoStaff,
  kGuidoBar, kGuidoBarAndEvent, kGuidoEvent, kClefSel,
  kMeterSel, kGuidoScoreElementEnd
}
 
enum  GuidoElementType {
  kNote = 1, kRest, kEmpty, kBar,
  kRepeatBegin, kRepeatEnd, kStaff, kSystemSlice,
  kSystem, kPage, kGraceNote, kClef,
  kMeter
}
 

Functions

float duration () const
 gives the segment duration More...
 
bool empty () const
 check for empty segment More...
 
bool intersect (const TimeSegment &ts) const
 check for segments intersection More...
 
bool include (const GuidoDate &date) const
 check for date inclusion More...
 
bool include (const TimeSegment &ts) const
 check for segment inclusion More...
 
bool startEqual (const TimeSegment &ts) const
 check if start date is the same More...
 
bool operator< (const TimeSegment &ts) const
 order relationship: the smaller is the smaller first date More...
 
bool operator== (const TimeSegment &ts) const
 
TimeSegment operator& (const TimeSegment &ts) const
 intersection operation (may return an arbitrary empty segment) More...
 
std::ostream & operator<< (std::ostream &out, const GuidoDate &d)
 
std::ostream & operator<< (std::ostream &out, const TimeSegment &s)
 
GuidoErrCode GuidoGetMap (CGRHandler gr, int pagenum, float width, float height, GuidoElementSelector sel, MapCollector &f)
 Retrieves the graphic to time mapping, without any processing (RAW) More...
 
GuidoErrCode GuidoGetRAWStaffMap (CGRHandler gr, int pagenum, float w, float h, int staff, Time2GraphicMap &outmap)
 Retrieves a guido staff graphic to time mapping, without any processing (RAW). More...
 
GuidoErrCode GuidoGetRAWVoiceMap (CGRHandler gr, int pagenum, float w, float h, int voice, Time2GraphicMap &outmap)
 Retrieves a guido voice graphic to time mapping, without any processing (RAW). More...
 
GuidoErrCode GuidoGetRAWSystemMap (CGRHandler gr, int pagenum, float w, float h, Time2GraphicMap &outmap)
 Retrieves a guido system graphic to time mapping, without any processing (RAW). More...
 
GuidoErrCode GuidoGetPageMap (CGRHandler gr, int pagenum, float w, float h, Time2GraphicMap &outmap)
 Retrieves a guido page graphic to time mapping. More...
 
GuidoErrCode GuidoGetStaffMap (CGRHandler gr, int pagenum, float w, float h, int staff, Time2GraphicMap &outmap)
 Retrieves a guido staff graphic to time mapping. New behaviour: if a rest is at a bar start, mapping is extended toward left barline. For old behaviour, use GuidoGetStaffMapV1. More...
 
GuidoErrCode GuidoGetStaffMapV1 (CGRHandler gr, int pagenum, float w, float h, int staff, Time2GraphicMap &outmap)
 Retrieves a guido staff graphic to time mapping. To use the new behaviour, see GuidoGetStaffMap. More...
 
GuidoErrCode GuidoGetVoiceMap (CGRHandler gr, int pagenum, float w, float h, int voice, Time2GraphicMap &outmap)
 Retrieves a guido voice graphic to time mapping. More...
 
GuidoErrCode GuidoGetSystemMap (CGRHandler gr, int pagenum, float w, float h, Time2GraphicMap &outmap)
 Retrieves a guido system graphic to time mapping. New behaviour: if all staves have a rest at a same bar start, mapping is extended toward left barline. For old behaviour, use GuidoGetSystemMapV1. More...
 
GuidoErrCode GuidoGetSystemMapV1 (CGRHandler gr, int pagenum, float w, float h, Time2GraphicMap &outmap)
 Retrieves a guido system graphic to time mapping. To use the new behaviour, see GuidoGetSystemMap. More...
 
bool GuidoGetTime (const GuidoDate &date, const Time2GraphicMap map, TimeSegment &t, FloatRect &r)
 Retrieves a time segment and the associated graphic segment in a mapping. More...
 
bool GuidoGetPoint (float x, float y, const Time2GraphicMap map, TimeSegment &t, FloatRect &r)
 Retrieves a time segment and the associated graphic segment in a mapping. More...
 
GuidoErrCode GuidoGetSVGMap (GRHandler gr, int pagenum, GuidoElementSelector sel, std::vector< MapElement > &outMap) GUIDOAPI_deprecated
 Retrieves the graphic to time mapping corresponding to the SVG output. More...
 
GuidoErrCode GuidoGetTimeMap (CARHandler ar, TimeMapCollector &f)
 Retrieves the rolled to unrolled time mapping. More...
 

Variables

class_export TimeSegment
 a time segment definition and operations More...
 
class_export GuidoDate
 print the time segment More...
 

Detailed Description

Typedef Documentation

◆ MapElement

typedef std::pair<FloatRect, RectInfos> MapElement

◆ Time2GraphicMap

typedef std::vector<TMapSegments> Time2GraphicMap

◆ Time2GraphicMapIterator

typedef Time2GraphicMap::const_iterator Time2GraphicMapIterator

◆ TimeMapElement

typedef std::pair<TimeSegment, TimeSegment> TimeMapElement

◆ TMapSegments

typedef std::pair<TimeSegment, FloatRect> TMapSegments

◆ TTime2TimeMap

typedef std::vector<TTimeMapSegments> TTime2TimeMap

◆ TTimeMapSegments

Enumeration Type Documentation

◆ GuidoElementSelector

Enumerator
kGuidoPage 
kGuidoSystem 
kGuidoSystemSlice 
kGuidoStaff 
kGuidoBar 
kGuidoBarAndEvent 
kGuidoEvent 
kClefSel 
kMeterSel 
kGuidoScoreElementEnd 

◆ GuidoElementType

Enumerator
kNote 
kRest 
kEmpty 
kBar 
kRepeatBegin 
kRepeatEnd 
kStaff 
kSystemSlice 
kSystem 
kPage 
kGraceNote 
kClef 
kMeter 

Function Documentation

◆ duration()

float duration ( ) const

gives the segment duration

◆ empty()

bool empty ( ) const

check for empty segment

◆ GuidoGetMap()

GuidoErrCode GuidoGetMap ( CGRHandler  gr,
int  pagenum,
float  width,
float  height,
GuidoElementSelector  sel,
MapCollector f 
)

Retrieves the graphic to time mapping, without any processing (RAW)

Parameters
gra Guido opaque handle to a GR structure.
pagenuma page index, starting from 1.
widththe page width.
heightthe page height.
sela GuidoElementSelector to filter undesired objects out.
fa MapCollector object that will be called for each selected element.
Returns
an error code.

◆ GuidoGetPageMap()

GuidoErrCode GuidoGetPageMap ( CGRHandler  gr,
int  pagenum,
float  w,
float  h,
Time2GraphicMap outmap 
)

Retrieves a guido page graphic to time mapping.

Parameters
gra Guido opaque handle to a GR structure.
pagenuma page index, starting from 1.
wthe page width.
hthe page height.
outmapcontains the mapping on output.
Returns
an error code.

◆ GuidoGetPoint()

bool GuidoGetPoint ( float  x,
float  y,
const Time2GraphicMap  map,
TimeSegment t,
FloatRect &  r 
)

Retrieves a time segment and the associated graphic segment in a mapping.

Parameters
xa point x coordinate
ya point y coordinate
mapa time to graphic map.
ron output, the graphic segment containing the point (note that segments are right and bottom opened)
ton output, the time segment associated to the graphic segment
Returns
false when there is no segment containing the point.

◆ GuidoGetRAWStaffMap()

GuidoErrCode GuidoGetRAWStaffMap ( CGRHandler  gr,
int  pagenum,
float  w,
float  h,
int  staff,
Time2GraphicMap outmap 
)

Retrieves a guido staff graphic to time mapping, without any processing (RAW).

Parameters
gra Guido opaque handle to a GR structure.
pagenuma page index, starting from 1.
wthe page width.
hthe page height.
staffthe staff index (starting from 1).
outmapcontains the mapping on output.
Returns
an error code.

◆ GuidoGetRAWSystemMap()

GuidoErrCode GuidoGetRAWSystemMap ( CGRHandler  gr,
int  pagenum,
float  w,
float  h,
Time2GraphicMap outmap 
)

Retrieves a guido system graphic to time mapping, without any processing (RAW).

Parameters
gra Guido opaque handle to a GR structure.
pagenuma page index, starting from 1.
wthe page width.
hthe page height.
outmapcontains the mapping on output.
Returns
an error code.

◆ GuidoGetRAWVoiceMap()

GuidoErrCode GuidoGetRAWVoiceMap ( CGRHandler  gr,
int  pagenum,
float  w,
float  h,
int  voice,
Time2GraphicMap outmap 
)

Retrieves a guido voice graphic to time mapping, without any processing (RAW).

Parameters
gra Guido opaque handle to a GR structure.
pagenuma page index, starting from 1.
wthe page width.
hthe page height.
voicethe voice index (starting from 1).
outmapcontains the mapping on output.
Returns
an error code.

◆ GuidoGetStaffMap()

GuidoErrCode GuidoGetStaffMap ( CGRHandler  gr,
int  pagenum,
float  w,
float  h,
int  staff,
Time2GraphicMap outmap 
)

Retrieves a guido staff graphic to time mapping. New behaviour: if a rest is at a bar start, mapping is extended toward left barline. For old behaviour, use GuidoGetStaffMapV1.

Parameters
gra Guido opaque handle to a GR structure.
pagenuma page index, starting from 1.
wthe page width.
hthe page height.
staffthe staff index (starting from 1).
outmapcontains the mapping on output.
Returns
an error code.

◆ GuidoGetStaffMapV1()

GuidoErrCode GuidoGetStaffMapV1 ( CGRHandler  gr,
int  pagenum,
float  w,
float  h,
int  staff,
Time2GraphicMap outmap 
)

Retrieves a guido staff graphic to time mapping. To use the new behaviour, see GuidoGetStaffMap.

Parameters
gra Guido opaque handle to a GR structure.
pagenuma page index, starting from 1.
wthe page width.
hthe page height.
staffthe staff index (starting from 1).
outmapcontains the mapping on output.
Returns
an error code.

◆ GuidoGetSVGMap()

GuidoErrCode GuidoGetSVGMap ( GRHandler  gr,
int  pagenum,
GuidoElementSelector  sel,
std::vector< MapElement > &  outMap 
)

Retrieves the graphic to time mapping corresponding to the SVG output.

Parameters
gra Guido opaque handle to a GR structure.
pagenuma page index, starting from 1.
selGuidoElementSelector to filter undesired objects out.
outMapon output: a vector containing the map elements
Returns
an error code.

◆ GuidoGetSystemMap()

GuidoErrCode GuidoGetSystemMap ( CGRHandler  gr,
int  pagenum,
float  w,
float  h,
Time2GraphicMap outmap 
)

Retrieves a guido system graphic to time mapping. New behaviour: if all staves have a rest at a same bar start, mapping is extended toward left barline. For old behaviour, use GuidoGetSystemMapV1.

Parameters
gra Guido opaque handle to a GR structure.
pagenuma page index, starting from 1.
wthe page width.
hthe page height.
outmapcontains the mapping on output.
Returns
an error code.

◆ GuidoGetSystemMapV1()

GuidoErrCode GuidoGetSystemMapV1 ( CGRHandler  gr,
int  pagenum,
float  w,
float  h,
Time2GraphicMap outmap 
)

Retrieves a guido system graphic to time mapping. To use the new behaviour, see GuidoGetSystemMap.

Parameters
gra Guido opaque handle to a GR structure.
pagenuma page index, starting from 1.
wthe page width.
hthe page height.
outmapcontains the mapping on output.
Returns
an error code.

◆ GuidoGetTime()

bool GuidoGetTime ( const GuidoDate date,
const Time2GraphicMap  map,
TimeSegment t,
FloatRect &  r 
)

Retrieves a time segment and the associated graphic segment in a mapping.

Parameters
datea date used to select the container time segment
mapa time to graphic map.
ton output, the time segment containing the date (note that segments are right opened)
ron output, the graphic segment associated to the time segment
Returns
false when there is no segment containing the date.

◆ GuidoGetTimeMap()

GuidoErrCode GuidoGetTimeMap ( CARHandler  ar,
TimeMapCollector f 
)

Retrieves the rolled to unrolled time mapping.

Parameters
gra Guido opaque handle to a GR structure.
fa TimeMapCollector object that will be called for each time segment.
Returns
an error code.

◆ GuidoGetVoiceMap()

GuidoErrCode GuidoGetVoiceMap ( CGRHandler  gr,
int  pagenum,
float  w,
float  h,
int  voice,
Time2GraphicMap outmap 
)

Retrieves a guido voice graphic to time mapping.

Parameters
gra Guido opaque handle to a GR structure.
pagenuma page index, starting from 1.
wthe page width.
hthe page height.
voicethe voice index (starting from 1).
outmapcontains the mapping on output.
Returns
an error code.

◆ include() [1/2]

bool include ( const GuidoDate date) const

check for date inclusion

◆ include() [2/2]

bool include ( const TimeSegment ts) const

check for segment inclusion

◆ intersect()

bool intersect ( const TimeSegment ts) const

check for segments intersection

◆ operator&()

TimeSegment operator& ( const TimeSegment ts) const

intersection operation (may return an arbitrary empty segment)

◆ operator<()

bool operator< ( const TimeSegment ts) const

order relationship: the smaller is the smaller first date

◆ operator<<() [1/2]

std::ostream& operator<< ( std::ostream &  out,
const GuidoDate d 
)
inline

◆ operator<<() [2/2]

std::ostream& operator<< ( std::ostream &  out,
const TimeSegment s 
)
inline

◆ operator==()

bool operator== ( const TimeSegment ts) const

◆ startEqual()

bool startEqual ( const TimeSegment ts) const

check if start date is the same

Variable Documentation

◆ GuidoDate

Initial value:
{
public:
TimeSegment (const TimeSegment& s) : std::pair<GuidoDate, GuidoDate>(s.first, s.second) {}
TimeSegment (const GuidoDate& a, const GuidoDate& b) : std::pair<GuidoDate, GuidoDate>(a, b) {}
virtual ~TimeSegment () {}
void print(std::ostream& out) const

print the time segment

◆ TimeSegment

class_export TimeSegment

a time segment definition and operations

TimeSegment
class_export TimeSegment
a time segment definition and operations
Definition: GUIDOScoreMap.h:67
GuidoDate
Representation of a date as a rational value.
Definition: GUIDOEngine.h:83

Guido Project Copyright © 2019 Grame-CNCM