Mercurial > hg > vamp-plugin-sdk
diff examples/SpectralCentroid.cpp @ 210:a5187dad96cd
* Add example plugins VC project -- though it doesn't produce a working library yet
author | cannam |
---|---|
date | Fri, 17 Oct 2008 21:59:35 +0000 |
parents | 1982246a3902 |
children |
line wrap: on
line diff
--- a/examples/SpectralCentroid.cpp Thu Oct 16 16:26:00 2008 +0000 +++ b/examples/SpectralCentroid.cpp Fri Oct 17 21:59:35 2008 +0000 @@ -41,8 +41,12 @@ using std::cerr; using std::endl; -#include <cmath> +#include <math.h> +#ifdef WIN32 +#define isnan(x) false +#define isinf(x) false +#endif SpectralCentroid::SpectralCentroid(float inputSampleRate) : Plugin(inputSampleRate), @@ -169,15 +173,15 @@ Feature feature; feature.hasTimestamp = false; - if (!std::isnan(centroidLog) && !std::isinf(centroidLog)) { - feature.values.push_back(centroidLog); - } + if (!isnan(centroidLog) && !isinf(centroidLog)) { + feature.values.push_back(centroidLog); + } returnFeatures[0].push_back(feature); - feature.values.clear(); - if (!std::isnan(centroidLin) && !std::isinf(centroidLin)) { - feature.values.push_back(centroidLin); - } + feature.values.clear(); + if (!isnan(centroidLin) && !isinf(centroidLin)) { + feature.values.push_back(centroidLin); + } returnFeatures[1].push_back(feature); }