diff examples/SpectralCentroid.cpp @ 190:1982246a3902

* Provide PluginWrapper method for getting hold of a nested wrapper directly (a bit gross, but useful) * Use the above to enable the simple host to adjust timestamps appropriately when printing out results from input domain adapter wrapped plugins
author cannam
date Wed, 17 Sep 2008 13:16:09 +0000
parents aa64a46320d4
children a5187dad96cd
line wrap: on
line diff
--- a/examples/SpectralCentroid.cpp	Wed Sep 17 11:00:51 2008 +0000
+++ b/examples/SpectralCentroid.cpp	Wed Sep 17 13:16:09 2008 +0000
@@ -133,8 +133,10 @@
     return list;
 }
 
+//static int scount = 0;
+
 SpectralCentroid::FeatureSet
-SpectralCentroid::process(const float *const *inputBuffers, Vamp::RealTime)
+SpectralCentroid::process(const float *const *inputBuffers, Vamp::RealTime timestamp)
 {
     if (m_stepSize == 0) {
 	cerr << "ERROR: SpectralCentroid::process: "
@@ -143,6 +145,8 @@
 	return FeatureSet();
     }
 
+//    std::cerr << "SpectralCentroid::process: count = " << scount++ << ", timestamp = " << timestamp << ", total power = ";
+
     double numLin = 0.0, numLog = 0.0, denom = 0.0;
 
     for (size_t i = 1; i <= m_blockSize/2; ++i) {
@@ -155,10 +159,10 @@
 	denom += power;
     }
 
+//    std::cerr << denom << std::endl;
+
     FeatureSet returnFeatures;
 
-//    std::cerr << "power " << denom << ", block size " << m_blockSize << std::endl;
-
     if (denom != 0.0) {
 	float centroidLin = float(numLin / denom);
 	float centroidLog = powf(10, float(numLog / denom));