Mercurial > hg > tony
diff src/Analyser.cpp @ 198:bb391844e2aa
Switching pitch candidate no longer wraps around: you can't go higher than the highest or lower than the lowest (though you can go either "up" or "down" if none of the alternate candidates has been selected yet, regardless of whether the candidates are higher or lower than the actual pitch track)
author | Chris Cannam |
---|---|
date | Wed, 05 Mar 2014 11:39:28 +0000 |
parents | 73fafd70996e |
children | 0ba33d6c0a71 |
line wrap: on
line diff
--- a/src/Analyser.cpp Wed Mar 05 11:31:55 2014 +0000 +++ b/src/Analyser.cpp Wed Mar 05 11:39:28 2014 +0000 @@ -372,6 +372,21 @@ emit layersChanged(); } +bool +Analyser::haveHigherPitchCandidate() const +{ + if (m_reAnalysisCandidates.empty()) return false; + return (m_currentCandidate < 0 || + (m_currentCandidate + 1 < (int)m_reAnalysisCandidates.size())); +} + +bool +Analyser::haveLowerPitchCandidate() const +{ + if (m_reAnalysisCandidates.empty()) return false; + return (m_currentCandidate < 0 || m_currentCandidate >= 1); +} + void Analyser::switchPitchCandidate(Selection sel, bool up) {