comparison src/Analyser.cpp @ 570:c6c8c1645ab6

Update subrepos and switch to single-point event types
author Chris Cannam
date Wed, 19 Jun 2019 13:33:33 +0100
parents 30fbc53d8150
children 3f0b44418a19
comparison
equal deleted inserted replaced
569:9a292b2f244e 570:c6c8c1645ab6
677 t->setBaseColour 677 t->setBaseColour
678 (ColourDatabase::getInstance()->getColourIndex(tr("Bright Orange"))); 678 (ColourDatabase::getInstance()->getColourIndex(tr("Bright Orange")));
679 t->setPresentationName("candidate"); 679 t->setPresentationName("candidate");
680 m_document->addLayerToView(m_pane, t); 680 m_document->addLayerToView(m_pane, t);
681 m_reAnalysisCandidates.push_back(t); 681 m_reAnalysisCandidates.push_back(t);
682 /*
682 cerr << "New re-analysis candidate model has " 683 cerr << "New re-analysis candidate model has "
683 << ((SparseTimeValueModel *)t->getModel())->getPoints().size() << " point(s)" << endl; 684 << ((SparseTimeValueModel *)t->getModel())->getAllEvents().size() << " point(s)" << endl;
685 */
684 } 686 }
685 } 687 }
686 688
687 if (!all.empty()) { 689 if (!all.empty()) {
688 bool show = m_candidatesVisible; 690 bool show = m_candidatesVisible;
766 Clipboard clip; 768 Clipboard clip;
767 layer->copy(m_pane, sel, clip); 769 layer->copy(m_pane, sel, clip);
768 layer->deleteSelection(sel); 770 layer->deleteSelection(sel);
769 771
770 Clipboard shifted; 772 Clipboard shifted;
771 foreach (Clipboard::Point p, clip.getPoints()) { 773 foreach (Event e, clip.getPoints()) {
772 if (p.haveValue()) { 774 if (e.hasValue()) {
773 Clipboard::Point sp = p.withValue(p.getValue() * factor); 775 Event se = e.withValue(e.getValue() * factor);
774 shifted.addPoint(sp); 776 shifted.addPoint(se);
775 } else { 777 } else {
776 shifted.addPoint(p); 778 shifted.addPoint(e);
777 } 779 }
778 } 780 }
779 781
780 layer->paste(m_pane, shifted, 0, false); 782 layer->paste(m_pane, shifted, 0, false);
781 } 783 }
861 otherLayer->copy(m_pane, sel, clip); 863 otherLayer->copy(m_pane, sel, clip);
862 864
863 // Remove all pitches <= 0Hz -- we now save absent pitches as 0Hz 865 // Remove all pitches <= 0Hz -- we now save absent pitches as 0Hz
864 // values when exporting a pitch track, so we need to exclude them 866 // values when exporting a pitch track, so we need to exclude them
865 // here when importing again 867 // here when importing again
866 Clipboard::PointList after; 868 EventVector after;
867 int excl = 0; 869 int excl = 0;
868 for (auto &p: clip.getPoints()) { 870 for (const auto &p: clip.getPoints()) {
869 if (p.haveValue() && p.getValue() > 0.f) { 871 if (p.hasValue() && p.getValue() > 0.f) {
870 after.push_back(p); 872 after.push_back(p);
871 } else { 873 } else {
872 ++excl; 874 ++excl;
873 } 875 }
874 } 876 }