Mercurial > hg > svcore
comparison rdf/RDFImporter.cpp @ 1649:1cc9a0d4b1b6 single-point
Update RegionModel following NoteModel, er, model. They have quite a bit in common that we should now pull out some of
author | Chris Cannam |
---|---|
date | Fri, 15 Mar 2019 14:23:50 +0000 |
parents | 513192aa9b03 |
children | 7a56bb85030f |
comparison
equal
deleted
inserted
replaced
1648:86bbccb79c9b | 1649:1cc9a0d4b1b6 |
---|---|
777 value = m_labelValueMap[model][label]; | 777 value = m_labelValueMap[model][label]; |
778 } else { | 778 } else { |
779 value = values[0]; | 779 value = values[0]; |
780 } | 780 } |
781 if (haveDuration) { | 781 if (haveDuration) { |
782 RegionModel::Point point(ftime, value, fduration, label); | 782 Event e(ftime, value, fduration, label); |
783 rm->addPoint(point); | 783 rm->add(e); |
784 } else { | 784 } else { |
785 // This won't actually happen -- we only create region models | 785 // This won't actually happen -- we only create region models |
786 // if we do have duration -- but just for completeness | 786 // if we do have duration -- but just for completeness |
787 float duration = 1.f; | 787 float duration = 1.f; |
788 if (!values.empty()) { | 788 if (!values.empty()) { |
789 value = values[0]; | 789 value = values[0]; |
790 if (values.size() > 1) { | 790 if (values.size() > 1) { |
791 duration = values[1]; | 791 duration = values[1]; |
792 } | 792 } |
793 } | 793 } |
794 RegionModel::Point point(ftime, value, | 794 Event e(ftime, value, sv_frame_t(lrintf(duration)), label); |
795 sv_frame_t(lrintf(duration)), label); | 795 rm->add(e); |
796 rm->addPoint(point); | |
797 } | 796 } |
798 return; | 797 return; |
799 } | 798 } |
800 | 799 |
801 cerr << "WARNING: RDFImporterImpl::fillModel: Unknown or unexpected model type" << endl; | 800 cerr << "WARNING: RDFImporterImpl::fillModel: Unknown or unexpected model type" << endl; |