diff options
Diffstat (limited to 'libs/rubberband/src')
-rw-r--r-- | libs/rubberband/src/Profiler.h | 2 | ||||
-rw-r--r-- | libs/rubberband/src/RingBuffer.h | 4 | ||||
-rw-r--r-- | libs/rubberband/src/Scavenger.h | 2 | ||||
-rw-r--r-- | libs/rubberband/src/StretchCalculator.cpp | 3 | ||||
-rw-r--r-- | libs/rubberband/src/StretcherImpl.cpp | 3 | ||||
-rw-r--r-- | libs/rubberband/src/Thread.cpp | 10 | ||||
-rw-r--r-- | libs/rubberband/src/Thread.h | 14 | ||||
-rw-r--r-- | libs/rubberband/src/bsd-3rdparty/float_cast/float_cast.h | 5 | ||||
-rw-r--r-- | libs/rubberband/src/main.cpp | 12 | ||||
-rw-r--r-- | libs/rubberband/src/sysutils.h | 6 |
10 files changed, 37 insertions, 24 deletions
diff --git a/libs/rubberband/src/Profiler.h b/libs/rubberband/src/Profiler.h index 616a553ecb..d6897b817b 100644 --- a/libs/rubberband/src/Profiler.h +++ b/libs/rubberband/src/Profiler.h @@ -31,7 +31,7 @@ #include <time.h> #else #include "sysutils.h" -#ifndef _WIN32 +#ifndef PLATFORM_WINDOWS #include <sys/time.h> #endif #endif diff --git a/libs/rubberband/src/RingBuffer.h b/libs/rubberband/src/RingBuffer.h index 07312169a6..a9262c8cdc 100644 --- a/libs/rubberband/src/RingBuffer.h +++ b/libs/rubberband/src/RingBuffer.h @@ -20,7 +20,7 @@ #include <cstring> -#ifndef _WIN32 +#ifndef PLATFORM_WINDOWS #include <sys/mman.h> #endif @@ -30,7 +30,7 @@ //#define DEBUG_RINGBUFFER 1 -#ifdef _WIN32 +#ifdef PLATFORM_WINDOWS #define MLOCK(a,b) 1 #define MUNLOCK(a,b) 1 #else diff --git a/libs/rubberband/src/Scavenger.h b/libs/rubberband/src/Scavenger.h index d1b6ca9ffa..a922d7ec6e 100644 --- a/libs/rubberband/src/Scavenger.h +++ b/libs/rubberband/src/Scavenger.h @@ -19,7 +19,7 @@ #include <list> #include <iostream> -#ifndef WIN32 +#ifndef PLATFORM_WINDOWS #include <sys/time.h> #endif diff --git a/libs/rubberband/src/StretchCalculator.cpp b/libs/rubberband/src/StretchCalculator.cpp index 1541759762..18ee9cc9c3 100644 --- a/libs/rubberband/src/StretchCalculator.cpp +++ b/libs/rubberband/src/StretchCalculator.cpp @@ -12,6 +12,9 @@ COPYING included with this distribution for more information. */ +#ifdef COMPILER_MSVC +#include "bsd-3rdparty/float_cast/float_cast.h" +#endif #include "StretchCalculator.h" #include <algorithm> diff --git a/libs/rubberband/src/StretcherImpl.cpp b/libs/rubberband/src/StretcherImpl.cpp index 200c8771a8..d15a71d68e 100644 --- a/libs/rubberband/src/StretcherImpl.cpp +++ b/libs/rubberband/src/StretcherImpl.cpp @@ -12,6 +12,9 @@ COPYING included with this distribution for more information. */ +#ifdef COMPILER_MSVC +#include "bsd-3rdparty/float_cast/float_cast.h" +#endif #include "StretcherImpl.h" #include "PercussiveAudioCurve.h" #include "HighFrequencyAudioCurve.h" diff --git a/libs/rubberband/src/Thread.cpp b/libs/rubberband/src/Thread.cpp index 49f75b5b65..d5a7b2f6ff 100644 --- a/libs/rubberband/src/Thread.cpp +++ b/libs/rubberband/src/Thread.cpp @@ -16,11 +16,11 @@ #include <cstdlib> #include <iostream> -#include <cstdlib> -#include <cstdlib> +#ifndef COMPILER_MSVC #include <sys/time.h> #include <time.h> +#endif using std::cerr; using std::endl; @@ -29,7 +29,7 @@ using std::string; namespace RubberBand { -#ifdef _WIN32 +#ifdef PLATFORM_WINDOWS Thread::Thread() : m_id(0), @@ -289,7 +289,7 @@ Condition::signal() SetEvent(m_condition); } -#else /* !_WIN32 */ +#else /* !PLATFORM_WINDOWS */ Thread::Thread() : @@ -562,7 +562,7 @@ Condition::signal() pthread_cond_signal(&m_condition); } -#endif /* !_WIN32 */ +#endif /* !PLATFORM_WINDOWS */ MutexLocker::MutexLocker(Mutex *mutex) : m_mutex(mutex) diff --git a/libs/rubberband/src/Thread.h b/libs/rubberband/src/Thread.h index 061469297e..63a5a65b67 100644 --- a/libs/rubberband/src/Thread.h +++ b/libs/rubberband/src/Thread.h @@ -15,11 +15,11 @@ #ifndef _RUBBERBAND_THREAD_H_ #define _RUBBERBAND_THREAD_H_ -#ifdef _WIN32 +#ifdef PLATFORM_WINDOWS #include <windows.h> -#else /* !_WIN32 */ +#else /* !PLATFORM_WINDOWS */ #include <pthread.h> -#endif /* !_WIN32 */ +#endif /* !PLATFORM_WINDOWS */ #include <string> @@ -33,7 +33,7 @@ namespace RubberBand class Thread { public: -#ifdef _WIN32 +#ifdef PLATFORM_WINDOWS typedef HANDLE Id; #else typedef pthread_t Id; @@ -53,7 +53,7 @@ protected: virtual void run() = 0; private: -#ifdef _WIN32 +#ifdef PLATFORM_WINDOWS HANDLE m_id; bool m_extant; static DWORD WINAPI staticRun(LPVOID lpParam); @@ -75,7 +75,7 @@ public: bool trylock(); private: -#ifdef _WIN32 +#ifdef PLATFORM_WINDOWS HANDLE m_mutex; #ifndef NO_THREAD_CHECKS DWORD m_lockedBy; @@ -123,7 +123,7 @@ public: private: -#ifdef _WIN32 +#ifdef PLATFORM_WINDOWS HANDLE m_mutex; HANDLE m_condition; bool m_locked; diff --git a/libs/rubberband/src/bsd-3rdparty/float_cast/float_cast.h b/libs/rubberband/src/bsd-3rdparty/float_cast/float_cast.h index 1ba0e03bdc..0e3d8a4040 100644 --- a/libs/rubberband/src/bsd-3rdparty/float_cast/float_cast.h +++ b/libs/rubberband/src/bsd-3rdparty/float_cast/float_cast.h @@ -35,6 +35,9 @@ ** long int lrint (double x) ; */ +#ifndef __FLOAT_CAST_H__ // Added by JE - 30-11-2009 +#define __FLOAT_CAST_H__ + #if (defined (WIN32) || defined (_WIN32)) #include <math.h> @@ -69,5 +72,5 @@ #endif - +#endif // __FLOAT_CAST_H__ diff --git a/libs/rubberband/src/main.cpp b/libs/rubberband/src/main.cpp index 1c80696180..cdc62e8afa 100644 --- a/libs/rubberband/src/main.cpp +++ b/libs/rubberband/src/main.cpp @@ -23,7 +23,7 @@ #include <cstring> #include "sysutils.h" -#ifdef __MSVC__ +#ifdef COMPILER_MSVC #include "bsd-3rdparty/getopt/getopt.h" #else #include <getopt.h> @@ -36,7 +36,7 @@ using namespace std; using namespace RubberBand; -#ifdef _WIN32 +#ifdef PLATFORM_WINDOWS using RubberBand::gettimeofday; using RubberBand::usleep; #endif @@ -324,7 +324,7 @@ int main(int argc, char **argv) cerr << "Using time ratio " << ratio; cerr << " and frequency ratio " << frequencyshift << endl; -#ifdef _WIN32 +#ifdef PLATFORM_WINDOWS RubberBand:: #endif timeval tv; @@ -495,7 +495,11 @@ int main(int argc, char **argv) } delete[] obf; } else { +#ifdef PLATFORM_WINDOWS + RubberBand::usleep(10000); +#else usleep(10000); +#endif } } @@ -506,7 +510,7 @@ int main(int argc, char **argv) cerr << "in: " << countIn << ", out: " << countOut << ", ratio: " << float(countOut)/float(countIn) << ", ideal output: " << lrint(countIn * ratio) << ", error: " << abs(lrint(countIn * ratio) - int(countOut)) << endl; -#ifdef _WIN32 +#ifdef PLATFORM_WINDOWS RubberBand:: #endif timeval etv; diff --git a/libs/rubberband/src/sysutils.h b/libs/rubberband/src/sysutils.h index a529afde0d..3883c59ff5 100644 --- a/libs/rubberband/src/sysutils.h +++ b/libs/rubberband/src/sysutils.h @@ -15,7 +15,7 @@ #ifndef _RUBBERBAND_SYSINFO_H_ #define _RUBBERBAND_SYSINFO_H_ -#ifdef __MSVC__ +#ifdef COMPILER_MSVC #include "bsd-3rdparty/float_cast/float_cast.h" #define R__ __restrict #endif @@ -28,11 +28,11 @@ #define R__ #endif -#ifdef __MINGW32__ +#ifdef COMPILER_MINGW #include <malloc.h> #endif -#ifdef __MSVC__ +#ifdef COMPILER_MSVC #define alloca _alloca #endif |