mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-05 05:05:43 +01:00
Modify 'libs/vamp-plugins' to be buildable with MSVC
This commit is contained in:
parent
9d774969fc
commit
53f1cb2a0f
5 changed files with 25 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue