comparison rdf/RDFImporter.cpp @ 1039:b14064bd1f97 cxx11

This code now compiles. Main problem: sample rate types
author Chris Cannam
date Tue, 03 Mar 2015 17:09:19 +0000
parents 06579b8ffb7b
children a1cd5abcb38b
comparison
equal deleted inserted replaced
1038:cc27f35aa75c 1039:b14064bd1f97
79 79
80 void getDenseFeatureProperties(QString featureUri, 80 void getDenseFeatureProperties(QString featureUri,
81 int &sampleRate, int &windowLength, 81 int &sampleRate, int &windowLength,
82 int &hopSize, int &width, int &height); 82 int &hopSize, int &width, int &height);
83 83
84 void fillModel(Model *, long, long, bool, std::vector<float> &, QString); 84 void fillModel(Model *, sv_frame_t, sv_frame_t,
85 bool, std::vector<float> &, QString);
85 }; 86 };
86 87
87 QString 88 QString
88 RDFImporter::getKnownExtensions() 89 RDFImporter::getKnownExtensions()
89 { 90 {
684 } 685 }
685 686
686 model = modelMap[timeline][type][dimensions][haveDuration]; 687 model = modelMap[timeline][type][dimensions][haveDuration];
687 688
688 if (model) { 689 if (model) {
689 long ftime = RealTime::realTime2Frame(time, m_sampleRate); 690 sv_frame_t ftime = RealTime::realTime2Frame(time, m_sampleRate);
690 long fduration = RealTime::realTime2Frame(duration, m_sampleRate); 691 sv_frame_t fduration = RealTime::realTime2Frame(duration, m_sampleRate);
691 fillModel(model, ftime, fduration, haveDuration, values, label); 692 fillModel(model, ftime, fduration, haveDuration, values, label);
692 } 693 }
693 } 694 }
694 } 695 }
695 } 696 }
696 } 697 }
697 698
698 void 699 void
699 RDFImporterImpl::fillModel(Model *model, 700 RDFImporterImpl::fillModel(Model *model,
700 long ftime, 701 sv_frame_t ftime,
701 long fduration, 702 sv_frame_t fduration,
702 bool haveDuration, 703 bool haveDuration,
703 std::vector<float> &values, 704 std::vector<float> &values,
704 QString label) 705 QString label)
705 { 706 {
706 // SVDEBUG << "RDFImporterImpl::fillModel: adding point at frame " << ftime << endl; 707 // SVDEBUG << "RDFImporterImpl::fillModel: adding point at frame " << ftime << endl;
755 if (values.size() > 2) { 756 if (values.size() > 2) {
756 level = values[2]; 757 level = values[2];
757 } 758 }
758 } 759 }
759 } 760 }
760 NoteModel::Point point(ftime, value, duration, level, label); 761 NoteModel::Point point(ftime, value, sv_frame_t(lrintf(duration)),
762 level, label);
761 nm->addPoint(point); 763 nm->addPoint(point);
762 } 764 }
763 return; 765 return;
764 } 766 }
765 767
787 value = values[0]; 789 value = values[0];
788 if (values.size() > 1) { 790 if (values.size() > 1) {
789 duration = values[1]; 791 duration = values[1];
790 } 792 }
791 } 793 }
792 RegionModel::Point point(ftime, value, duration, label); 794 RegionModel::Point point(ftime, value,
795 sv_frame_t(lrintf(duration)), label);
793 rm->addPoint(point); 796 rm->addPoint(point);
794 } 797 }
795 return; 798 return;
796 } 799 }
797 800