diff transform/FeatureExtractionModelTransformer.cpp @ 877:b109b88bfa85 tonioni

Callback handler for additional models at end of processing
author Chris Cannam
date Wed, 29 Jan 2014 15:58:15 +0000
parents 47aa3aeb687b
children 4cbf8c6a462d 8db820ad2b8f
line wrap: on
line diff
--- a/transform/FeatureExtractionModelTransformer.cpp	Wed Jan 29 09:31:22 2014 +0000
+++ b/transform/FeatureExtractionModelTransformer.cpp	Wed Jan 29 15:58:15 2014 +0000
@@ -418,8 +418,8 @@
         // descriptor to a list of models indexed by bin-1). But we
         // don't create the additional models yet, as this case has to
         // work even if the number of bins is unknown at this point --
-        // we just create an additional model (copying its parameters
-        // from the default one) each time a new bin is encountered.
+        // we create an additional model (copying its parameters from
+        // the default one) each time a new bin is encountered.
 
         if (!haveBinCount || binCount > 1) {
             m_needAdditionalModels[n] = true;
@@ -499,6 +499,17 @@
     return mm;
 }
 
+bool
+FeatureExtractionModelTransformer::willHaveAdditionalOutputModels()
+{
+    for (std::map<int, bool>::const_iterator i =
+             m_needAdditionalModels.begin(); 
+         i != m_needAdditionalModels.end(); ++i) {
+        if (i->second) return true;
+    }
+    return false;
+}
+
 SparseTimeValueModel *
 FeatureExtractionModelTransformer::getAdditionalModel(int n, int binNo)
 {
@@ -558,7 +569,7 @@
     Transform primaryTransform = m_transforms[0];
 
     while (!input->isReady() && !m_abandoned) {
-        SVDEBUG << "FeatureExtractionModelTransformer::run: Waiting for input model to be ready..." << endl;
+        cerr << "FeatureExtractionModelTransformer::run: Waiting for input model to be ready..." << endl;
         usleep(500000);
     }
     if (m_abandoned) return;