Two groups of methods:
A score is treated as a hierarchy: each score contains 0 or more staves and each staff contains `staff objects' (staffobjs). Clefs, text and chords are all different types of staff objects.
wxInt32 GetNumMeasures();
lmStaffObjIterator* CreateIterator(ETraversingOrder nOrder);
int GetNumStaves();
lmStaff* GetFirstStaff();
lmStaff* GetNextStaff();
lmStaff* GetLastStaff();
lmStaff* GetStaff(wxInt32 nStaff);
Once an iterator has been created, the iterator admits the following methods:
bool EndOfList();
lmStaffObj* GetCurrent();
void AdvanceToMeasure(int nBar);
void MoveFirst();
void MoveNext();
void MovePrev();
void MoveLast();
void BackToItemOfType(EScoreObjType nType);
void GoToItem(lmStaffObj* pSO);
Usually it is necessary to do some operation to every staff in a score, or every bar in a staff, or every note in a score.
Three posibilities:
The procedure is as follows:
Example:
lmStaffObj* pSO; lmStaffObjIterator* pIter = pVStaff->CreateIterator(eTR_ByTime); while(!pIter->EndOfList()) { pSO = pIter->GetCurrent(); // ...do something with pSO pIter->MoveNext(); } delete pIter;