mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +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
|
|
@ -14,6 +14,9 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef COMPILER_MSVC
|
||||||
|
#include <ardourext/float_cast.h>
|
||||||
|
#endif
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "Onset.h"
|
#include "Onset.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,9 @@
|
||||||
COPYING included with this distribution for more information.
|
COPYING included with this distribution for more information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef COMPILER_MSVC
|
||||||
|
#include <ardourext/float_cast.h>
|
||||||
|
#endif
|
||||||
#include "OnsetDetect.h"
|
#include "OnsetDetect.h"
|
||||||
|
|
||||||
#include "dsp/onsets/DetectionFunction.h"
|
#include "dsp/onsets/DetectionFunction.h"
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,9 @@
|
||||||
authorization.
|
authorization.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef COMPILER_MSVC
|
||||||
|
#include <ardourext/float_cast.h>
|
||||||
|
#endif
|
||||||
#include "PercussionOnsetDetector.h"
|
#include "PercussionOnsetDetector.h"
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,19 @@
|
||||||
authorization.
|
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"
|
#include "SpectralCentroid.h"
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
@ -41,8 +54,6 @@ using std::vector;
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
|
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
|
|
||||||
SpectralCentroid::SpectralCentroid(float inputSampleRate) :
|
SpectralCentroid::SpectralCentroid(float inputSampleRate) :
|
||||||
Plugin(inputSampleRate),
|
Plugin(inputSampleRate),
|
||||||
|
|
@ -165,13 +176,13 @@ SpectralCentroid::process(const float *const *inputBuffers, Vamp::RealTime)
|
||||||
|
|
||||||
Feature feature;
|
Feature feature;
|
||||||
feature.hasTimestamp = false;
|
feature.hasTimestamp = false;
|
||||||
if (!std::isnan(centroidLog) && !std::isinf(centroidLog)) {
|
if (!isnan(centroidLog) && !isinf(centroidLog)) {
|
||||||
feature.values.push_back(centroidLog);
|
feature.values.push_back(centroidLog);
|
||||||
}
|
}
|
||||||
returnFeatures[0].push_back(feature);
|
returnFeatures[0].push_back(feature);
|
||||||
|
|
||||||
feature.values.clear();
|
feature.values.clear();
|
||||||
if (!std::isnan(centroidLin) && !std::isinf(centroidLin)) {
|
if (!isnan(centroidLin) && !isinf(centroidLin)) {
|
||||||
feature.values.push_back(centroidLin);
|
feature.values.push_back(centroidLin);
|
||||||
}
|
}
|
||||||
returnFeatures[1].push_back(feature);
|
returnFeatures[1].push_back(feature);
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,8 @@ __declspec(selectany) int _forceAtlDllManifestRTM;
|
||||||
implementation for commonly used integer types. */
|
implementation for commonly used integer types. */
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#if (BUILDING_ARDOUR)
|
|
||||||
#if defined(_MSC_VER) && !defined(__MINGW__) && !defined(__MINGW32__)
|
#if defined(_MSC_VER) && !defined(__MINGW__) && !defined(__MINGW32__)
|
||||||
|
#if (INCLUDE_ARDOUR_MISCELLANEOUS)
|
||||||
#include <ardourext/misc.h>
|
#include <ardourext/misc.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue