diff transform/FeatureExtractionPluginTransform.cpp @ 61:963e3187d920

* Fix slowness in serving FFT values to feature extraction plugin transform (failure to call resume() on FFT model) * Fix failure to update completion from time/value model
author Chris Cannam
date Tue, 17 Oct 2006 13:49:31 +0000
parents ca1e3f5657d5
children 51f34d378a3a
line wrap: on
line diff
--- a/transform/FeatureExtractionPluginTransform.cpp	Tue Oct 17 13:04:49 2006 +0000
+++ b/transform/FeatureExtractionPluginTransform.cpp	Tue Oct 17 13:49:31 2006 +0000
@@ -251,14 +251,16 @@
 
     if (frequencyDomain) {
         for (size_t ch = 0; ch < channelCount; ++ch) {
-            fftModels.push_back(new FFTModel
+            FFTModel *model = new FFTModel
                                   (getInput(),
                                    channelCount == 1 ? m_context.channel : ch,
                                    m_context.windowType,
                                    m_context.blockSize,
                                    m_context.stepSize,
                                    m_context.blockSize,
-                                   false));
+                                   false);
+            model->resume();
+            fftModels.push_back(model);
         }
     }
 
@@ -292,15 +294,6 @@
                     fftModels[ch]->getValuesAt
                         (column, i, buffers[ch][i*2], buffers[ch][i*2+1]);
                 }
-/*!!!
-                float sum = 0.0;
-                for (size_t i = 0; i < m_context.blockSize/2; ++i) {
-                    sum += buffers[ch][i*2];
-                }
-                if (fabs(sum) < 0.0001) {
-                    std::cerr << "WARNING: small sum for column " << column << " (sum is " << sum << ")" << std::endl;
-                }
-*/
             } else {
                 getFrames(ch, channelCount, 
                           blockFrame, m_context.blockSize, buffers[ch]);
@@ -477,14 +470,12 @@
 
 	SparseOneDimensionalModel *model = getOutput<SparseOneDimensionalModel>();
 	if (!model) return;
-        std::cerr << "setting on SparseOneDimensionalModel" << std::endl;
 	model->setCompletion(completion);
 
     } else if (binCount == 1) {
 
 	SparseTimeValueModel *model = getOutput<SparseTimeValueModel>();
 	if (!model) return;
-        std::cerr << "setting on SparseTimeValueModel" << std::endl;
 	model->setCompletion(completion);
 
     } else if (m_descriptor->sampleType ==
@@ -492,7 +483,6 @@
 
 	NoteModel *model = getOutput<NoteModel>();
 	if (!model) return;
-        std::cerr << "setting on NoteModel" << std::endl;
 	model->setCompletion(completion);
 
     } else {
@@ -500,7 +490,6 @@
 	EditableDenseThreeDimensionalModel *model =
             getOutput<EditableDenseThreeDimensionalModel>();
 	if (!model) return;
-        std::cerr << "setting on EditableDenseThreeDimensionalModel" << std::endl;
 	model->setCompletion(completion);
     }
 }