src/tool-tassoize.cpp
void Tool_tassoize::addTerminalLongs(HumdrumFile& infile) {
	int scount = infile.getStrandCount();
	for (int i=0; i<scount; i++) {
		HTp cur = infile.getStrandEnd(i);
		if (*cur != "*-") {
			continue;
		}
		if (!cur->isKern()) {
			continue;
		}
		while (cur) {
			if (!cur->isData()) {
				cur = cur->getPreviousToken();
				continue;
			}
			if (cur->isNull()) {
				cur = cur->getPreviousToken();
				continue;
			}
			if (cur->isRest()) {
				cur = cur->getPreviousToken();
				continue;
			}
			if (cur->isSecondaryTiedNote()) {
				cur = cur->getPreviousToken();
				continue;
			}
			if (cur->find("l") != std::string::npos) {
				// already marked so do not do it again
				break;
			}
			// mark this note with "l"
			string newtext = *cur;
			newtext += "l";
			cur->setText(newtext);
			break;
		}
	}
}
//////////////////////////////
//
// Tool_tassoize::addTerminalLongs -- Convert all last notes to terminal longs
//    Also probably add terminal longs before double barlines as in JRP.
//
:addTerminalLongs -- Convert all last notes to terminal longs
Also probably add terminal longs before double barlines as in JRP.
: addTerminalLongs -- Convert all last notes to terminal longs Also probably add terminal longs before double barlines as in JRP .
void Tool_tassoize::addTerminalLongs(HumdrumFile& infile) {
	int scount = infile.getStrandCount();
	for (int i=0; i<scount; i++) {
		HTp cur = infile.getStrandEnd(i);
		if (*cur != "*-") {
			continue;
		}
		if (!cur->isKern()) {
			continue;
		}
		while (cur) {
			if (!cur->isData()) {
				cur = cur->getPreviousToken();
				continue;
			}
			if (cur->isNull()) {
				cur = cur->getPreviousToken();
				continue;
			}
			if (cur->isRest()) {
				cur = cur->getPreviousToken();
				continue;
			}
			if (cur->isSecondaryTiedNote()) {
				cur = cur->getPreviousToken();
				continue;
			}
			if (cur->find("l") != std::string::npos) {
				break;
			}
			string newtext = *cur;
			newtext += "l";
			cur->setText(newtext);
			break;
		}
	}
}
void Tool_tassoize :: addTerminalLongs ( HumdrumFile & infile ) { int scount = infile . getStrandCount ( ) ; for ( int i = 0 ; i < scount ; i ++ ) { HTp cur = infile . getStrandEnd ( i ) ; if ( * cur != " " ) { continue ; } if ( ! cur -> isKern ( ) ) { continue ; } while ( cur ) { if ( ! cur -> isData ( ) ) { cur = cur -> getPreviousToken ( ) ; continue ; } if ( cur -> isNull ( ) ) { cur = cur -> getPreviousToken ( ) ; continue ; } if ( cur -> isRest ( ) ) { cur = cur -> getPreviousToken ( ) ; continue ; } if ( cur -> isSecondaryTiedNote ( ) ) { cur = cur -> getPreviousToken ( ) ; continue ; } if ( cur -> find ( " " ) != std :: string :: npos ) { break ; } string newtext = * cur ; newtext += " " ; cur -> setText ( newtext ) ; break ; } } }
Tool_tassoize::addTerminalLongs -- Convert all last notes to terminal longs
Also probably add terminal longs before double barlines as in JRP.
Tool_tassoize :: addTerminalLongs -- Convert all last notes to terminal longs Also probably add terminal longs before double barlines as in JRP .
// already marked so do not do it again // mark this note with "l"