diff --git a/app/cmScore.c b/app/cmScore.c index 84e765e..8e43683 100644 --- a/app/cmScore.c +++ b/app/cmScore.c @@ -1231,6 +1231,17 @@ cmScoreEvt_t* cmScoreEvt( cmScH_t h, unsigned idx ) return p->array + idx; } +cmScoreEvt_t* cmScoreBarEvt( cmScH_t h, unsigned barNumb ) +{ + cmSc_t* p = _cmScHandleToPtr(h); + unsigned i = 0; + for(; icnt; ++i) + if( p->array[i].typeId==kBarEvtScId && p->array[i].barNumb==barNumb ) + return p->array + i; + + return NULL; +} + unsigned cmScoreSectionCount( cmScH_t h ) { cmSc_t* p = _cmScHandleToPtr(h); @@ -1262,6 +1273,22 @@ cmScoreLoc_t* cmScoreLoc( cmScH_t h, unsigned idx ) return p->loc + idx; } +cmScoreLoc_t* cmScoreEvtLoc( cmScH_t h, const cmScoreEvt_t* evt ) +{ + cmSc_t* p = _cmScHandleToPtr(h); + unsigned i; + if( evt != NULL ) + for(i=0; ilocCnt; ++i) + { + unsigned j; + for(j=0; jloc[i].evtCnt; ++j) + if( p->loc[i].evtArray[j] == evt ) + return p->loc + i; + } + return NULL; +} + + void cmScorePrintLoc( cmScH_t h ) { diff --git a/app/cmScore.h b/app/cmScore.h index f6cac3a..9067a0a 100644 --- a/app/cmScore.h +++ b/app/cmScore.h @@ -151,6 +151,9 @@ extern "C" { unsigned cmScoreEvtCount( cmScH_t h ); cmScoreEvt_t* cmScoreEvt( cmScH_t h, unsigned idx ); + // Given a bar number return the associated 'bar' event record. + cmScoreEvt_t* cmScoreBarEvt( cmScH_t h, unsigned barNumb ); + // Access section records unsigned cmScoreSectionCount( cmScH_t h ); cmScoreSection_t* cmScoreSection( cmScH_t h, unsigned idx ); @@ -160,6 +163,9 @@ extern "C" { cmScoreLoc_t* cmScoreLoc( cmScH_t h, unsigned idx ); void cmScorePrintLoc( cmScH_t h ); + // Return the location associated with a given score event. + cmScoreLoc_t* cmScoreEvtLoc( cmScH_t h, const cmScoreEvt_t* evt ); + // Return the count of sets. unsigned cmScoreSetCount( cmScH_t h ); @@ -169,6 +175,7 @@ extern "C" { // cmScMsg_t record. cmScRC_t cmScoreSeqNotify( cmScH_t h ); + /* void cmScoreClearPerfInfo( cmScH_t h ); // Assign 'smpIdx' and 'vel' to the event matching 'pitch' at 'locIdx' @@ -186,7 +193,8 @@ extern "C" { // Set the performed dynamic level of a score event. void cmScoreSetPerfDynLevel( cmScH_t h, unsigned evtIdx, unsigned dynLvl ); - + */ + typedef enum { kInvalidMsgScId,