Modify 'libs/vamp-plugins' to be buildable with MSVC

This commit is contained in:
John Emmas 2013-07-20 08:30:40 +01:00
parent 9d774969fc
commit 53f1cb2a0f
5 changed files with 25 additions and 5 deletions

View File

@ -14,6 +14,9 @@
*/
#ifdef COMPILER_MSVC
#include <ardourext/float_cast.h>
#endif
#include <math.h>
#include "Onset.h"

View File

@ -12,6 +12,9 @@
COPYING included with this distribution for more information.
*/
#ifdef COMPILER_MSVC
#include <ardourext/float_cast.h>
#endif
#include "OnsetDetect.h"
#include "dsp/onsets/DetectionFunction.h"

View File

@ -34,6 +34,9 @@
authorization.
*/
#ifdef COMPILER_MSVC
#include <ardourext/float_cast.h>
#endif
#include "PercussionOnsetDetector.h"
using std::string;

View File

@ -34,6 +34,19 @@
authorization.
*/
#include <cmath>
#ifdef COMPILER_MSVC
#include <float.h>
// 'std::isinf()' and 'std::isnan()' are not available in MSVC.
#define isinf(val) !((bool)_finite((double)val))
#define isnan(val) (bool)_isnan((double)val)
#else
using std::isnan;
using std:isinf;
#endif
#include "SpectralCentroid.h"
using std::string;
@ -41,8 +54,6 @@ using std::vector;
using std::cerr;
using std::endl;
#include <cmath>
SpectralCentroid::SpectralCentroid(float inputSampleRate) :
Plugin(inputSampleRate),
@ -165,13 +176,13 @@ SpectralCentroid::process(const float *const *inputBuffers, Vamp::RealTime)
Feature feature;
feature.hasTimestamp = false;
if (!std::isnan(centroidLog) && !std::isinf(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)) {
if (!isnan(centroidLin) && !isinf(centroidLin)) {
feature.values.push_back(centroidLin);
}
returnFeatures[1].push_back(feature);

View File

@ -57,8 +57,8 @@ __declspec(selectany) int _forceAtlDllManifestRTM;
implementation for commonly used integer types. */
#include <stdint.h>
#if (BUILDING_ARDOUR)
#if defined(_MSC_VER) && !defined(__MINGW__) && !defined(__MINGW32__)
#if (INCLUDE_ARDOUR_MISCELLANEOUS)
#include <ardourext/misc.h>
#endif
#endif