src/tool-chantize.cpp
vector<bool> Tool_chantize::getTerminalRestStates(HumdrumFile& infile) {
	vector<bool> output(infile.getLineCount(), false);

	for (int i=infile.getLineCount() - 1; i>=0; i--) {
		if (!infile[i].isData()) {
			continue;
		}
		HTp token = infile.token(i, 0);
		if (token->isRest()) {
			output[i] = true;
		} else {
			break;
		}
	}

	return output;

}
//////////////////////////////
//
// Tool_chantize::getTerminalRestStates -- return a vector of each line,
//    setting true if the line is a data line containing a rest at the end of the 
//    music after the last note.
//
:getTerminalRestStates -- return a vector of each line,
setting true if the line is a data line containing a rest at the end of the
music after the last note.
: getTerminalRestStates -- return a vector of each line setting true if the line is a data line containing a rest at the end of the music after the last note .
vector<bool> Tool_chantize::getTerminalRestStates(HumdrumFile& infile) {
	vector<bool> output(infile.getLineCount(), false);
	for (int i=infile.getLineCount() - 1; i>=0; i--) {
		if (!infile[i].isData()) {
			continue;
		}
		HTp token = infile.token(i, 0);
		if (token->isRest()) {
			output[i] = true;
		} else {
			break;
		}
	}
	return output;
}
vector < bool > Tool_chantize :: getTerminalRestStates ( HumdrumFile & infile ) { vector < bool > output ( infile . getLineCount ( ) , false ) ; for ( int i = infile . getLineCount ( ) - 1 ; i >= 0 ; i -- ) { if ( ! infile [ i ] . isData ( ) ) { continue ; } HTp token = infile . token ( i , 0 ) ; if ( token -> isRest ( ) ) { output [ i ] = true ; } else { break ; } } return output ; }
Tool_chantize::getTerminalRestStates -- return a vector of each line,
setting true if the line is a data line containing a rest at the end of the
music after the last note.
Tool_chantize :: getTerminalRestStates -- return a vector of each line setting true if the line is a data line containing a rest at the end of the music after the last note .