comparison src/Analyser.cpp @ 441:692852208b6c

Exclude points with freq <= 0Hz on import
author Chris Cannam
date Tue, 31 Mar 2015 15:09:38 +0100
parents 093c1fb2fb31
children abd0dea16584
comparison
equal deleted inserted replaced
440:14aa33dc2a54 441:692852208b6c
846 846
847 Selection sel = Selection(myLayer->getModel()->getStartFrame(), 847 Selection sel = Selection(myLayer->getModel()->getStartFrame(),
848 myLayer->getModel()->getEndFrame()); 848 myLayer->getModel()->getEndFrame());
849 myLayer->deleteSelection(sel); 849 myLayer->deleteSelection(sel);
850 850
851 cerr << "deleted from " << sel.getStartFrame() << " to " << sel.getEndFrame() << endl;
852
853 sel = Selection(otherLayer->getModel()->getStartFrame(), 851 sel = Selection(otherLayer->getModel()->getStartFrame(),
854 otherLayer->getModel()->getEndFrame()); 852 otherLayer->getModel()->getEndFrame());
855 otherLayer->copy(m_pane, sel, clip); 853 otherLayer->copy(m_pane, sel, clip);
854
855 // Remove all pitches <= 0Hz -- we now save absent pitches as 0Hz
856 // values when exporting a pitch track, so we need to exclude them
857 // here when importing again
858 Clipboard::PointList after;
859 int excl = 0;
860 for (auto &p: clip.getPoints()) {
861 if (p.haveValue() && p.getValue() > 0.f) {
862 after.push_back(p);
863 } else {
864 ++excl;
865 }
866 }
867 clip.setPoints(after);
856 868
857 myLayer->paste(m_pane, clip, 0, false); 869 myLayer->paste(m_pane, clip, 0, false);
858 } 870 }
859 871
860 void 872 void