Planeshift
ScoreContext Class Reference

This is used to keep track of everything needed to play a score and provide some utility functions for this purpose. More...

#include <scoreelements.h>

Public Member Functions

int GetNPerformedRepeats (int measureID) const
 Return the number of times the eventual repeat in the given measure has been performed. More...
 
int RestoreLastStartRepeat ()
 Restore the context of the last measure containing a start repeat. More...
 
 ScoreContext ()
 Constructor. More...
 
void Update (int measureID, const Measure< MeasureElement > &measure)
 Update the context with the new measure. More...
 
void Update (const MeasureElement &element)
 Keep the list of previous accidentals updated. More...
 

Public Attributes

Measure< MeasureElement >::MeasureAttributes measureAttributes
 Attributes specified in the score up to now. More...
 
Note::NoteContext noteContext
 Used to keep track of previous accidentals in the same measure. More...
 

Detailed Description

This is used to keep track of everything needed to play a score and provide some utility functions for this purpose.

This class make sense only when it refers to a specific point in the musical score.

Definition at line 596 of file scoreelements.h.

Constructor & Destructor Documentation

ScoreContext::ScoreContext ( )

Constructor.

Member Function Documentation

int ScoreContext::GetNPerformedRepeats ( int  measureID) const

Return the number of times the eventual repeat in the given measure has been performed.

Returns
The number of times the repeat in the given measure has been performed or 0 if the measure does not end a repeat section.
int ScoreContext::RestoreLastStartRepeat ( )

Restore the context of the last measure containing a start repeat.

If no explicit start repeats have been found, the function assumes it to be the first measure. It is not necessary to call Update(int, Measure<MeasureElement> &) afterwards.

Returns
The ID of the last measure encountered that starts a repeat.
void ScoreContext::Update ( int  measureID,
const Measure< MeasureElement > &  measure 
)

Update the context with the new measure.

This resets also previous accidentals. Note that you still have to call Update(MeasureElement &) if you want to update the list of previous accidentals with the first element of this measure.

Parameters
measureIDThe ID of the updated measure.
measureThe new measure reached by the cursor.
void ScoreContext::Update ( const MeasureElement element)

Keep the list of previous accidentals updated.

Parameters
elementThe new element reached by the cursor.

Member Data Documentation

Measure<MeasureElement>::MeasureAttributes ScoreContext::measureAttributes

Attributes specified in the score up to now.

Must be updated at every measure.

Definition at line 607 of file scoreelements.h.

Note::NoteContext ScoreContext::noteContext

Used to keep track of previous accidentals in the same measure.

Definition at line 602 of file scoreelements.h.


The documentation for this class was generated from the following file: