# HG changeset patch # User cannam # Date 1224280775 0 # Node ID a5187dad96cd095c9f6609135c3719c9e04c11b1 # Parent 0f6616ef0e1823e3715f378fd74f31be56891f8f * Add example plugins VC project -- though it doesn't produce a working library yet diff -r 0f6616ef0e18 -r a5187dad96cd VampExamplePlugins.vcproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/VampExamplePlugins.vcproj Fri Oct 17 21:59:35 2008 +0000 @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 0f6616ef0e18 -r a5187dad96cd examples/PercussionOnsetDetector.cpp --- a/examples/PercussionOnsetDetector.cpp Thu Oct 16 16:26:00 2008 +0000 +++ b/examples/PercussionOnsetDetector.cpp Fri Oct 17 21:59:35 2008 +0000 @@ -267,7 +267,7 @@ Feature onset; onset.hasTimestamp = true; onset.timestamp = ts - Vamp::RealTime::frame2RealTime - (m_stepSize, lrintf(m_inputSampleRate)); + (m_stepSize, int(m_inputSampleRate + 0.5)); returnFeatures[0].push_back(onset); } diff -r 0f6616ef0e18 -r a5187dad96cd examples/SpectralCentroid.cpp --- 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 +#include +#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); }