comparison transform/FeatureExtractionModelTransformer.cpp @ 843:e802e550a1f2

Drop std:: from cout, cerr, endl -- pull these in through Debug.h
author Chris Cannam
date Tue, 26 Nov 2013 13:35:08 +0000
parents 98cf98a217d2
children 2d53205f70cd 786ee8d1f30e
comparison
equal deleted inserted replaced
842:23d3a6eca5c3 843:e802e550a1f2
175 void 175 void
176 FeatureExtractionModelTransformer::createOutputModel() 176 FeatureExtractionModelTransformer::createOutputModel()
177 { 177 {
178 DenseTimeValueModel *input = getConformingInput(); 178 DenseTimeValueModel *input = getConformingInput();
179 179
180 // std::cerr << "FeatureExtractionModelTransformer::createOutputModel: sample type " << m_descriptor->sampleType << ", rate " << m_descriptor->sampleRate << std::endl; 180 // cerr << "FeatureExtractionModelTransformer::createOutputModel: sample type " << m_descriptor->sampleType << ", rate " << m_descriptor->sampleRate << endl;
181 181
182 PluginRDFDescription description(m_transform.getPluginIdentifier()); 182 PluginRDFDescription description(m_transform.getPluginIdentifier());
183 QString outputId = m_transform.getOutput(); 183 QString outputId = m_transform.getOutput();
184 184
185 int binCount = 1; 185 int binCount = 1;
188 188
189 if (m_descriptor->hasFixedBinCount) { 189 if (m_descriptor->hasFixedBinCount) {
190 binCount = m_descriptor->binCount; 190 binCount = m_descriptor->binCount;
191 } 191 }
192 192
193 // std::cerr << "FeatureExtractionModelTransformer: output bin count " 193 // cerr << "FeatureExtractionModelTransformer: output bin count "
194 // << binCount << std::endl; 194 // << binCount << endl;
195 195
196 if (binCount > 0 && m_descriptor->hasKnownExtents) { 196 if (binCount > 0 && m_descriptor->hasKnownExtents) {
197 minValue = m_descriptor->minValue; 197 minValue = m_descriptor->minValue;
198 maxValue = m_descriptor->maxValue; 198 maxValue = m_descriptor->maxValue;
199 haveExtents = true; 199 haveExtents = true;
203 size_t modelResolution = 1; 203 size_t modelResolution = 1;
204 204
205 if (m_descriptor->sampleType != 205 if (m_descriptor->sampleType !=
206 Vamp::Plugin::OutputDescriptor::OneSamplePerStep) { 206 Vamp::Plugin::OutputDescriptor::OneSamplePerStep) {
207 if (m_descriptor->sampleRate > input->getSampleRate()) { 207 if (m_descriptor->sampleRate > input->getSampleRate()) {
208 std::cerr << "WARNING: plugin reports output sample rate as " 208 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; 209 << m_descriptor->sampleRate << " (can't display features with finer resolution than the input rate of " << input->getSampleRate() << ")" << endl;
210 } 210 }
211 } 211 }
212 212
213 switch (m_descriptor->sampleType) { 213 switch (m_descriptor->sampleType) {
214 214
525 buffers[ch][i*2] = reals[i]; 525 buffers[ch][i*2] = reals[i];
526 buffers[ch][i*2+1] = imaginaries[i]; 526 buffers[ch][i*2+1] = imaginaries[i];
527 } 527 }
528 error = fftModels[ch]->getError(); 528 error = fftModels[ch]->getError();
529 if (error != "") { 529 if (error != "") {
530 std::cerr << "FeatureExtractionModelTransformer::run: Abandoning, error is " << error << std::endl; 530 cerr << "FeatureExtractionModelTransformer::run: Abandoning, error is " << error << endl;
531 m_abandoned = true; 531 m_abandoned = true;
532 m_message = error; 532 m_message = error;
533 } 533 }
534 } 534 }
535 } else { 535 } else {
640 FeatureExtractionModelTransformer::addFeature(size_t blockFrame, 640 FeatureExtractionModelTransformer::addFeature(size_t blockFrame,
641 const Vamp::Plugin::Feature &feature) 641 const Vamp::Plugin::Feature &feature)
642 { 642 {
643 size_t inputRate = m_input.getModel()->getSampleRate(); 643 size_t inputRate = m_input.getModel()->getSampleRate();
644 644
645 // std::cerr << "FeatureExtractionModelTransformer::addFeature: blockFrame = " 645 // cerr << "FeatureExtractionModelTransformer::addFeature: blockFrame = "
646 // << blockFrame << ", hasTimestamp = " << feature.hasTimestamp 646 // << blockFrame << ", hasTimestamp = " << feature.hasTimestamp
647 // << ", timestamp = " << feature.timestamp << ", hasDuration = " 647 // << ", timestamp = " << feature.timestamp << ", hasDuration = "
648 // << feature.hasDuration << ", duration = " << feature.duration 648 // << feature.hasDuration << ", duration = " << feature.duration
649 // << std::endl; 649 // << endl;
650 650
651 int binCount = 1; 651 int binCount = 1;
652 if (m_descriptor->hasFixedBinCount) { 652 if (m_descriptor->hasFixedBinCount) {
653 binCount = m_descriptor->binCount; 653 binCount = m_descriptor->binCount;
654 } 654 }
657 657
658 if (m_descriptor->sampleType == 658 if (m_descriptor->sampleType ==
659 Vamp::Plugin::OutputDescriptor::VariableSampleRate) { 659 Vamp::Plugin::OutputDescriptor::VariableSampleRate) {
660 660
661 if (!feature.hasTimestamp) { 661 if (!feature.hasTimestamp) {
662 std::cerr 662 cerr
663 << "WARNING: FeatureExtractionModelTransformer::addFeature: " 663 << "WARNING: FeatureExtractionModelTransformer::addFeature: "
664 << "Feature has variable sample rate but no timestamp!" 664 << "Feature has variable sample rate but no timestamp!"
665 << std::endl; 665 << endl;
666 return; 666 return;
667 } else { 667 } else {
668 frame = Vamp::RealTime::realTime2Frame(feature.timestamp, inputRate); 668 frame = Vamp::RealTime::realTime2Frame(feature.timestamp, inputRate);
669 } 669 }
670 670