Mercurial > hg > vamp-simple-cepstrum
changeset 18:791e5c115b8d track
Another small fix
author | Chris Cannam |
---|---|
date | Sat, 30 Jun 2012 10:12:08 +0100 |
parents | edc7f59404da |
children | c9cac05ef9f2 |
files | CepstrumPitchTracker.cpp |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/CepstrumPitchTracker.cpp Sat Jun 30 10:10:05 2012 +0100 +++ b/CepstrumPitchTracker.cpp Sat Jun 30 10:12:08 2012 +0100 @@ -489,9 +489,13 @@ } if (!m_accepted.test(e)) { + int candidate = -1; + bool accepted = false; + for (int i = 0; i < m_possible.size(); ++i) { if (m_possible[i].test(e)) { + accepted = true; if (m_possible[i].getState() == Hypothesis::Satisfied) { candidate = i; } @@ -499,6 +503,12 @@ } } + if (!accepted) { + Hypothesis h; + h.test(e); //!!! must succeed as h is new, so perhaps there should be a ctor for this + m_possible.push_back(h); + } + if (m_accepted.getState() == Hypothesis::Expired) { m_accepted.addFeatures(fs[0]); }