Mercurial > hg > svcore
comparison transform/FeatureExtractionModelTransformer.cpp @ 799:c808c57e5560 qt5 sonic-annotator-1.0
Merge from the default branch
author | Chris Cannam |
---|---|
date | Wed, 08 May 2013 09:37:21 +0100 |
parents | ebe3ca2bb556 |
children | 98cf98a217d2 |
comparison
equal
deleted
inserted
replaced
797:c1fcfdf43a01 | 799:c808c57e5560 |
---|---|
199 haveExtents = true; | 199 haveExtents = true; |
200 } | 200 } |
201 | 201 |
202 size_t modelRate = input->getSampleRate(); | 202 size_t modelRate = input->getSampleRate(); |
203 size_t modelResolution = 1; | 203 size_t modelResolution = 1; |
204 | |
205 if (m_descriptor->sampleType != | |
206 Vamp::Plugin::OutputDescriptor::OneSamplePerStep) { | |
207 if (m_descriptor->sampleRate > input->getSampleRate()) { | |
208 std::cerr << "WARNING: plugin reports output sample rate as " | |
209 << m_descriptor->sampleRate << " (can't display features with finer resolution than the input rate of " << input->getSampleRate() << ")" << std::endl; | |
210 } | |
211 } | |
204 | 212 |
205 switch (m_descriptor->sampleType) { | 213 switch (m_descriptor->sampleType) { |
206 | 214 |
207 case Vamp::Plugin::OutputDescriptor::VariableSampleRate: | 215 case Vamp::Plugin::OutputDescriptor::VariableSampleRate: |
208 if (m_descriptor->sampleRate != 0.0) { | 216 if (m_descriptor->sampleRate != 0.0) { |
672 } | 680 } |
673 | 681 |
674 frame = lrintf((m_fixedRateFeatureNo / m_descriptor->sampleRate) | 682 frame = lrintf((m_fixedRateFeatureNo / m_descriptor->sampleRate) |
675 * inputRate); | 683 * inputRate); |
676 | 684 |
677 std::cerr << "Feature hasTimestamp = " << feature.hasTimestamp << ", timestamp = " << feature.timestamp << ", frame works out to " << frame << std::endl; | 685 // std::cerr << "Feature hasTimestamp = " << feature.hasTimestamp << ", timestamp = " << feature.timestamp << ", frame works out to " << frame << std::endl; |
678 | |
679 } | 686 } |
680 | 687 |
681 // Rather than repeat the complicated tests from the constructor | 688 // Rather than repeat the complicated tests from the constructor |
682 // to determine what sort of model we must be adding the features | 689 // to determine what sort of model we must be adding the features |
683 // to, we instead test what sort of model the constructor decided | 690 // to, we instead test what sort of model the constructor decided |
704 | 711 |
705 QString label = feature.label.c_str(); | 712 QString label = feature.label.c_str(); |
706 if (feature.values.size() > 1) { | 713 if (feature.values.size() > 1) { |
707 label = QString("[%1] %2").arg(i+1).arg(label); | 714 label = QString("[%1] %2").arg(i+1).arg(label); |
708 } | 715 } |
709 | |
710 std::cerr << "Adding point at " << frame << " with value " << value << " and label " << label << std::endl; | |
711 | 716 |
712 model->addPoint(SparseTimeValueModel::Point(frame, value, label)); | 717 model->addPoint(SparseTimeValueModel::Point(frame, value, label)); |
713 } | 718 } |
714 | 719 |
715 } else if (isOutput<NoteModel>() || isOutput<RegionModel>()) { | 720 } else if (isOutput<NoteModel>() || isOutput<RegionModel>()) { |