# HG changeset patch # User Chris Cannam # Date 1427810978 -3600 # Node ID 692852208b6c992a9b6188e35915e2dbff1f6027 # Parent 14aa33dc2a54c93a3035aa89321129e1a97c8177 Exclude points with freq <= 0Hz on import diff -r 14aa33dc2a54 -r 692852208b6c src/Analyser.cpp --- a/src/Analyser.cpp Tue Mar 31 14:46:40 2015 +0100 +++ b/src/Analyser.cpp Tue Mar 31 15:09:38 2015 +0100 @@ -848,12 +848,24 @@ myLayer->getModel()->getEndFrame()); myLayer->deleteSelection(sel); - cerr << "deleted from " << sel.getStartFrame() << " to " << sel.getEndFrame() << endl; - sel = Selection(otherLayer->getModel()->getStartFrame(), otherLayer->getModel()->getEndFrame()); otherLayer->copy(m_pane, sel, clip); + // Remove all pitches <= 0Hz -- we now save absent pitches as 0Hz + // values when exporting a pitch track, so we need to exclude them + // here when importing again + Clipboard::PointList after; + int excl = 0; + for (auto &p: clip.getPoints()) { + if (p.haveValue() && p.getValue() > 0.f) { + after.push_back(p); + } else { + ++excl; + } + } + clip.setPoints(after); + myLayer->paste(m_pane, clip, 0, false); }