diff transform/FeatureExtractionModelTransformer.cpp @ 687:06f13a3b9e9e debug-output

Convert many cerrs to DEBUGs
author Chris Cannam
date Mon, 16 May 2011 17:19:09 +0100
parents b4a8d8221eaf
children 1424aa29ae95
line wrap: on
line diff
--- a/transform/FeatureExtractionModelTransformer.cpp	Thu May 12 17:31:24 2011 +0100
+++ b/transform/FeatureExtractionModelTransformer.cpp	Mon May 16 17:19:09 2011 +0100
@@ -43,7 +43,7 @@
     m_descriptor(0),
     m_outputFeatureNo(0)
 {
-//    std::cerr << "FeatureExtractionModelTransformer::FeatureExtractionModelTransformer: plugin " << pluginId << ", outputName " << m_transform.getOutput() << std::endl;
+//    DEBUG << "FeatureExtractionModelTransformer::FeatureExtractionModelTransformer: plugin " << pluginId << ", outputName " << m_transform.getOutput() << endl;
 
     QString pluginId = transform.getPluginIdentifier();
 
@@ -86,9 +86,9 @@
 	return;
     }
 
-    std::cerr << "Initialising feature extraction plugin with channels = "
+    DEBUG << "Initialising feature extraction plugin with channels = "
               << channelCount << ", step = " << m_transform.getStepSize()
-              << ", block = " << m_transform.getBlockSize() << std::endl;
+              << ", block = " << m_transform.getBlockSize() << endl;
 
     if (!m_plugin->initialise(channelCount,
                               m_transform.getStepSize(),
@@ -152,7 +152,7 @@
     }
     
     for (size_t i = 0; i < outputs.size(); ++i) {
-//        std::cerr << "comparing output " << i << " name \"" << outputs[i].identifier << "\" with expected \"" << m_transform.getOutput() << "\"" << std::endl;
+//        DEBUG << "comparing output " << i << " name \"" << outputs[i].identifier << "\" with expected \"" << m_transform.getOutput() << "\"" << endl;
 	if (m_transform.getOutput() == "" ||
             outputs[i].identifier == m_transform.getOutput().toStdString()) {
 	    m_outputFeatureNo = i;
@@ -378,7 +378,7 @@
 
 FeatureExtractionModelTransformer::~FeatureExtractionModelTransformer()
 {
-//    std::cerr << "FeatureExtractionModelTransformer::~FeatureExtractionModelTransformer()" << std::endl;
+//    DEBUG << "FeatureExtractionModelTransformer::~FeatureExtractionModelTransformer()" << endl;
     delete m_plugin;
     delete m_descriptor;
 }
@@ -386,12 +386,12 @@
 DenseTimeValueModel *
 FeatureExtractionModelTransformer::getConformingInput()
 {
-//    std::cerr << "FeatureExtractionModelTransformer::getConformingInput: input model is " << getInputModel() << std::endl;
+//    DEBUG << "FeatureExtractionModelTransformer::getConformingInput: input model is " << getInputModel() << endl;
 
     DenseTimeValueModel *dtvm =
 	dynamic_cast<DenseTimeValueModel *>(getInputModel());
     if (!dtvm) {
-	std::cerr << "FeatureExtractionModelTransformer::getConformingInput: WARNING: Input model is not conformable to DenseTimeValueModel" << std::endl;
+	DEBUG << "FeatureExtractionModelTransformer::getConformingInput: WARNING: Input model is not conformable to DenseTimeValueModel" << endl;
     }
     return dtvm;
 }
@@ -405,7 +405,7 @@
     if (!m_output) return;
 
     while (!input->isReady() && !m_abandoned) {
-        std::cerr << "FeatureExtractionModelTransformer::run: Waiting for input model to be ready..." << std::endl;
+        DEBUG << "FeatureExtractionModelTransformer::run: Waiting for input model to be ready..." << endl;
         usleep(500000);
     }
     if (m_abandoned) return;
@@ -499,9 +499,9 @@
                 contextStart + contextDuration) break;
         }
 
-//	std::cerr << "FeatureExtractionModelTransformer::run: blockFrame "
+//	DEBUG << "FeatureExtractionModelTransformer::run: blockFrame "
 //		  << blockFrame << ", endFrame " << endFrame << ", blockSize "
-//                  << blockSize << std::endl;
+//                  << blockSize << endl;
 
 	long completion =
 	    (((blockFrame - contextStart) / stepSize) * 99) /
@@ -636,8 +636,8 @@
 {
     size_t inputRate = m_input.getModel()->getSampleRate();
 
-//    std::cerr << "FeatureExtractionModelTransformer::addFeature("
-//	      << blockFrame << ")" << std::endl;
+//    DEBUG << "FeatureExtractionModelTransformer::addFeature("
+//	      << blockFrame << ")" << endl;
 
     int binCount = 1;
     if (m_descriptor->hasFixedBinCount) {
@@ -777,7 +777,7 @@
 	model->setColumn(frame / model->getResolution(), values);
 
     } else {
-        std::cerr << "FeatureExtractionModelTransformer::addFeature: Unknown output model type!" << std::endl;
+        DEBUG << "FeatureExtractionModelTransformer::addFeature: Unknown output model type!" << endl;
     }
 }
 
@@ -789,8 +789,8 @@
 	binCount = m_descriptor->binCount;
     }
 
-//    std::cerr << "FeatureExtractionModelTransformer::setCompletion("
-//              << completion << ")" << std::endl;
+//    DEBUG << "FeatureExtractionModelTransformer::setCompletion("
+//              << completion << ")" << endl;
 
     if (isOutput<SparseOneDimensionalModel>()) {