src/tool-semitones.cpp
int Tool_semitones::filterData(HTp token) {
	vector<HTp> toks = getTieGroup(token);
	HumRegex hre;
	if (!m_exclude.empty()) {
		for (int i=0; i<(int)toks.size(); i++) {
			if (hre.search(toks[i], m_exclude)) {
				return -1;
			}
		}
		return 1;
	} else if (!m_include.empty()) {
		for (int i=0; i<(int)toks.size(); i++) {
			if (hre.search(toks[i], m_include)) {
				return 1;
			}
		}
		return 0;
	}
	return 0;
}
//////////////////////////////
//
// Tool_semitones::filterData -- select or deselect an interval based
//    on regular expression pattern.  Return true if the note should
//    be kept; otherwise, return false.
//
:filterData -- select or deselect an interval based
on regular expression pattern.  Return true if the note should
be kept; otherwise, return false.
: filterData -- select or deselect an interval based on regular expression pattern . Return true if the note should be kept ; otherwise return false .
int Tool_semitones::filterData(HTp token) {
	vector<HTp> toks = getTieGroup(token);
	HumRegex hre;
	if (!m_exclude.empty()) {
		for (int i=0; i<(int)toks.size(); i++) {
			if (hre.search(toks[i], m_exclude)) {
				return -1;
			}
		}
		return 1;
	} else if (!m_include.empty()) {
		for (int i=0; i<(int)toks.size(); i++) {
			if (hre.search(toks[i], m_include)) {
				return 1;
			}
		}
		return 0;
	}
	return 0;
}
int Tool_semitones :: filterData ( HTp token ) { vector < HTp > toks = getTieGroup ( token ) ; HumRegex hre ; if ( ! m_exclude . empty ( ) ) { for ( int i = 0 ; i < ( int ) toks . size ( ) ; i ++ ) { if ( hre . search ( toks [ i ] , m_exclude ) ) { return -1 ; } } return 1 ; } else if ( ! m_include . empty ( ) ) { for ( int i = 0 ; i < ( int ) toks . size ( ) ; i ++ ) { if ( hre . search ( toks [ i ] , m_include ) ) { return 1 ; } } return 0 ; } return 0 ; }
Tool_semitones::filterData -- select or deselect an interval based
on regular expression pattern.
Tool_semitones :: filterData -- select or deselect an interval based on regular expression pattern .