cmScore.c : Changed _cmScParseMarkers() to allow multiple recd/play markers on the same line.
This commit is contained in:
parent
5851b40dc1
commit
5c36dfcf9a
@ -613,8 +613,10 @@ cmScRC_t _cmScParseMarkers( cmSc_t* p, unsigned scoreIdx, const cmChar_t* text,
|
|||||||
if( cmSymTblIsValid(p->stH) == false )
|
if( cmSymTblIsValid(p->stH) == false )
|
||||||
return kOkScRC;
|
return kOkScRC;
|
||||||
|
|
||||||
|
for(;(cp = cmTextNextNonWhiteC(cp)) != NULL; cp=ep )
|
||||||
|
{
|
||||||
// go to command/id space
|
// go to command/id space
|
||||||
if((ip = cmTextNextWhiteOrEosC(text)) == NULL )
|
if((ip = cmTextNextWhiteOrEosC(cp)) == NULL )
|
||||||
goto errLabel;
|
goto errLabel;
|
||||||
|
|
||||||
// goto label
|
// goto label
|
||||||
@ -629,11 +631,11 @@ cmScRC_t _cmScParseMarkers( cmSc_t* p, unsigned scoreIdx, const cmChar_t* text,
|
|||||||
unsigned n = (ep-ip)+1;
|
unsigned n = (ep-ip)+1;
|
||||||
cmChar_t markTextStr[n+1];
|
cmChar_t markTextStr[n+1];
|
||||||
strncpy(markTextStr,ip,n);
|
strncpy(markTextStr,ip,n);
|
||||||
|
markTextStr[n] = 0;
|
||||||
|
|
||||||
|
// remove any trailing white space
|
||||||
|
cmTextTrimEnd(markTextStr);
|
||||||
|
|
||||||
// for each command code
|
|
||||||
// (there may be more than one character)
|
|
||||||
for(; *cp && !isspace(*cp); ++cp)
|
|
||||||
{
|
|
||||||
cmMarkScMId_t cmdId = kInvalidScMId;
|
cmMarkScMId_t cmdId = kInvalidScMId;
|
||||||
|
|
||||||
switch( *cp )
|
switch( *cp )
|
||||||
@ -653,6 +655,8 @@ cmScRC_t _cmScParseMarkers( cmSc_t* p, unsigned scoreIdx, const cmChar_t* text,
|
|||||||
mp->scoreIdx = scoreIdx;
|
mp->scoreIdx = scoreIdx;
|
||||||
mp->csvRowIdx = rowIdx;
|
mp->csvRowIdx = rowIdx;
|
||||||
|
|
||||||
|
//printf("%i %c '%s'\n",rowIdx,*cp,markTextStr);
|
||||||
|
|
||||||
// insert the new mark at the end of the list
|
// insert the new mark at the end of the list
|
||||||
if( p->markList == NULL )
|
if( p->markList == NULL )
|
||||||
p->markList = mp;
|
p->markList = mp;
|
||||||
@ -665,7 +669,9 @@ cmScRC_t _cmScParseMarkers( cmSc_t* p, unsigned scoreIdx, const cmChar_t* text,
|
|||||||
ep->link = mp;
|
ep->link = mp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return kOkScRC;
|
return kOkScRC;
|
||||||
|
|
||||||
errLabel:
|
errLabel:
|
||||||
|
Loading…
Reference in New Issue
Block a user