comparison transform/FeatureExtractionModelTransformer.cpp @ 777:eea8049df526

Fix incorrect retrieval of point in model by row number if point frame values fell between model resolution boundaries
author Chris Cannam
date Wed, 27 Mar 2013 14:51:49 +0000
parents 7f76499ef4f2
children d373ced0e6e9
comparison
equal deleted inserted replaced
766:2444ef08b7eb 777:eea8049df526
671 // lrintf(m_descriptor->sampleRate)); 671 // lrintf(m_descriptor->sampleRate));
672 inputRate); 672 inputRate);
673 } else { 673 } else {
674 frame = m_output->getEndFrame(); 674 frame = m_output->getEndFrame();
675 } 675 }
676
677 // std::cerr << "Feature hasTimestamp = " << feature.hasTimestamp << ", timestamp = " << feature.timestamp << ", frame works out to " << frame << std::endl;
678
676 } 679 }
677 680
678 // Rather than repeat the complicated tests from the constructor 681 // Rather than repeat the complicated tests from the constructor
679 // to determine what sort of model we must be adding the features 682 // to determine what sort of model we must be adding the features
680 // to, we instead test what sort of model the constructor decided 683 // to, we instead test what sort of model the constructor decided
701 704
702 QString label = feature.label.c_str(); 705 QString label = feature.label.c_str();
703 if (feature.values.size() > 1) { 706 if (feature.values.size() > 1) {
704 label = QString("[%1] %2").arg(i+1).arg(label); 707 label = QString("[%1] %2").arg(i+1).arg(label);
705 } 708 }
709
710 std::cerr << "Adding point at " << frame << " with value " << value << " and label " << label << std::endl;
706 711
707 model->addPoint(SparseTimeValueModel::Point(frame, value, label)); 712 model->addPoint(SparseTimeValueModel::Point(frame, value, label));
708 } 713 }
709 714
710 } else if (isOutput<NoteModel>() || isOutput<RegionModel>()) { 715 } else if (isOutput<NoteModel>() || isOutput<RegionModel>()) {