LibMusicXML 3.22
unrolled_xml_tree_browser Class Reference

An xml tree browser that "unroll" the score. More...

#include <unrolled_xml_tree_browser.h>

Inheritance diagram for unrolled_xml_tree_browser:
browser< xmlelement > visitor< Sxmlelement > visitor< S_measure > visitor< S_ending > visitor< S_repeat > visitor< S_part > visitor< S_sound > basevisitor basevisitor basevisitor basevisitor basevisitor basevisitor

Public Member Functions

 unrolled_xml_tree_browser (basevisitor *v)
virtual void visitStart (Sxmlelement &elt)
virtual void visitStart (S_measure &elt)
virtual void visitStart (S_ending &elt)
virtual void visitStart (S_repeat &elt)
virtual void visitStart (S_part &elt)
virtual void visitStart (S_sound &elt)
virtual void browse (xmlelement &t)
virtual void forwardBrowse (xmlelement &t)
virtual void enter (xmlelement &t)
virtual void leave (xmlelement &t)
Public Member Functions inherited from visitor< Sxmlelement >
virtual void visitEnd (Sxmlelement &elt)
Public Member Functions inherited from visitor< S_measure >
virtual void visitEnd (S_measure &elt)
Public Member Functions inherited from visitor< S_ending >
virtual void visitEnd (S_ending &elt)
Public Member Functions inherited from visitor< S_repeat >
virtual void visitEnd (S_repeat &elt)
Public Member Functions inherited from visitor< S_part >
virtual void visitEnd (S_part &elt)
Public Member Functions inherited from visitor< S_sound >
virtual void visitEnd (S_sound &elt)

Protected Attributes

basevisitorfVisitor
ctree< xmlelement >::literator fFirstMeasure
 the first measure iterator
ctree< xmlelement >::literator fForwardRepeat
 the forward repeat location
ctree< xmlelement >::literator fEndIterator
 indicates the end of to visit
ctree< xmlelement >::literator fNextIterator
 indicates the next elt to visit
ctree< xmlelement >::literator fSegnoIterator
 the segno location
ctree< xmlelement >::literator fCodaIterator
 the segno location
ctree< xmlelement >::literator * fStoreIterator
 a pointer to store the current iterator
int fStoreDelay
 an iterations counter for delayed store

Detailed Description

To "unroll" the score, structural information denoted by repeat, ending, coda and segno signs is interpreted and the score is visited similarly to a musician that would play the score ie: for example a section repeated twice is visited twice.

The unrolled_xml_tree_browser makes use of iterators collected along the visit and makes arbitrary jumps to these iterators to modify the tree visit. These iterators are expected to contains S_measure iterators only. This is ensured by the visit(S_part) method.

When visiting measures, forwarding the visit to the embedded visitor depends on the current state. In particular, it is verified that the current time a given measure is played corresponds to the expected time (if any), and that we're not currently jumping to a coda, which location could be unknown at the time of the jump.

Todo
Management of multiple jump and sound ForwardRepeat attribute.

Member Function Documentation

◆ browse()

virtual void browse ( xmlelement & t)
virtual

Implements browser< xmlelement >.

◆ visitStart() [1/6]

virtual void visitStart ( S_ending & elt)
virtual

Reimplemented from visitor< S_ending >.

◆ visitStart() [2/6]

virtual void visitStart ( S_measure & elt)
virtual

Reimplemented from visitor< S_measure >.

◆ visitStart() [3/6]

virtual void visitStart ( S_part & elt)
virtual

Reimplemented from visitor< S_part >.

◆ visitStart() [4/6]

virtual void visitStart ( S_repeat & elt)
virtual

Reimplemented from visitor< S_repeat >.

◆ visitStart() [5/6]

virtual void visitStart ( S_sound & elt)
virtual

Reimplemented from visitor< S_sound >.

◆ visitStart() [6/6]

virtual void visitStart ( Sxmlelement & elt)
virtual

Reimplemented from visitor< Sxmlelement >.