diff --git a/CMakeLists.txt b/CMakeLists.txt index f286cb3502..235c5fa206 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -405,6 +405,19 @@ else() set(LZO lzo2) endif() +if(OPENAL_FOUND) + if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + check_lib(SOUNDTOUCH SoundTouch soundtouch/soundtouch.h QUIET) + endif() + if (SOUNDTOUCH_FOUND) + message("Using shared soundtouch") + else() + message("Using static soundtouch from Externals") + add_subdirectory(Externals/soundtouch) + include_directories(Externals/soundtouch) + endif() +endif() + if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") include(FindSDL2 OPTIONAL) endif() @@ -452,17 +465,6 @@ else() include_directories(Externals/SOIL) endif() -if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - check_lib(SoundTouch SoundTouch SoundTouch.h QUIET) -endif() -if(SOUNDTOUCH_FOUND) - message("Using shared SoundTouch") -else() - message("Using static SoundTouch from Externals") - add_subdirectory(Externals/SoundTouch) - include_directories(Externals/SoundTouch) -endif() - # If zlib has already been found on a previous run of cmake don't check again # as the check seems to take a long time. if(NOT ZLIB_FOUND) diff --git a/Externals/SoundTouch/AAFilter.cpp b/Externals/soundtouch/AAFilter.cpp similarity index 100% rename from Externals/SoundTouch/AAFilter.cpp rename to Externals/soundtouch/AAFilter.cpp diff --git a/Externals/SoundTouch/AAFilter.h b/Externals/soundtouch/AAFilter.h similarity index 100% rename from Externals/SoundTouch/AAFilter.h rename to Externals/soundtouch/AAFilter.h diff --git a/Externals/SoundTouch/BPMDetect.cpp b/Externals/soundtouch/BPMDetect.cpp similarity index 100% rename from Externals/SoundTouch/BPMDetect.cpp rename to Externals/soundtouch/BPMDetect.cpp diff --git a/Externals/SoundTouch/BPMDetect.h b/Externals/soundtouch/BPMDetect.h similarity index 100% rename from Externals/SoundTouch/BPMDetect.h rename to Externals/soundtouch/BPMDetect.h diff --git a/Externals/SoundTouch/CMakeLists.txt b/Externals/soundtouch/CMakeLists.txt similarity index 100% rename from Externals/SoundTouch/CMakeLists.txt rename to Externals/soundtouch/CMakeLists.txt diff --git a/Externals/SoundTouch/FIFOSampleBuffer.cpp b/Externals/soundtouch/FIFOSampleBuffer.cpp similarity index 100% rename from Externals/SoundTouch/FIFOSampleBuffer.cpp rename to Externals/soundtouch/FIFOSampleBuffer.cpp diff --git a/Externals/SoundTouch/FIFOSampleBuffer.h b/Externals/soundtouch/FIFOSampleBuffer.h similarity index 100% rename from Externals/SoundTouch/FIFOSampleBuffer.h rename to Externals/soundtouch/FIFOSampleBuffer.h diff --git a/Externals/SoundTouch/FIFOSamplePipe.h b/Externals/soundtouch/FIFOSamplePipe.h similarity index 100% rename from Externals/SoundTouch/FIFOSamplePipe.h rename to Externals/soundtouch/FIFOSamplePipe.h diff --git a/Externals/SoundTouch/FIRFilter.cpp b/Externals/soundtouch/FIRFilter.cpp similarity index 100% rename from Externals/SoundTouch/FIRFilter.cpp rename to Externals/soundtouch/FIRFilter.cpp diff --git a/Externals/SoundTouch/FIRFilter.h b/Externals/soundtouch/FIRFilter.h similarity index 100% rename from Externals/SoundTouch/FIRFilter.h rename to Externals/soundtouch/FIRFilter.h diff --git a/Externals/SoundTouch/PeakFinder.cpp b/Externals/soundtouch/PeakFinder.cpp similarity index 100% rename from Externals/SoundTouch/PeakFinder.cpp rename to Externals/soundtouch/PeakFinder.cpp diff --git a/Externals/SoundTouch/PeakFinder.h b/Externals/soundtouch/PeakFinder.h similarity index 100% rename from Externals/SoundTouch/PeakFinder.h rename to Externals/soundtouch/PeakFinder.h diff --git a/Externals/SoundTouch/RateTransposer.cpp b/Externals/soundtouch/RateTransposer.cpp similarity index 100% rename from Externals/SoundTouch/RateTransposer.cpp rename to Externals/soundtouch/RateTransposer.cpp diff --git a/Externals/SoundTouch/RateTransposer.h b/Externals/soundtouch/RateTransposer.h similarity index 100% rename from Externals/SoundTouch/RateTransposer.h rename to Externals/soundtouch/RateTransposer.h diff --git a/Externals/SoundTouch/STTypes.h b/Externals/soundtouch/STTypes.h similarity index 100% rename from Externals/SoundTouch/STTypes.h rename to Externals/soundtouch/STTypes.h diff --git a/Externals/SoundTouch/SoundTouch.cpp b/Externals/soundtouch/SoundTouch.cpp similarity index 100% rename from Externals/SoundTouch/SoundTouch.cpp rename to Externals/soundtouch/SoundTouch.cpp diff --git a/Externals/SoundTouch/SoundTouch.h b/Externals/soundtouch/SoundTouch.h similarity index 100% rename from Externals/SoundTouch/SoundTouch.h rename to Externals/soundtouch/SoundTouch.h diff --git a/Externals/SoundTouch/SoundTouch.vcxproj b/Externals/soundtouch/SoundTouch.vcxproj similarity index 100% rename from Externals/SoundTouch/SoundTouch.vcxproj rename to Externals/soundtouch/SoundTouch.vcxproj diff --git a/Externals/SoundTouch/SoundTouch.vcxproj.filters b/Externals/soundtouch/SoundTouch.vcxproj.filters similarity index 100% rename from Externals/SoundTouch/SoundTouch.vcxproj.filters rename to Externals/soundtouch/SoundTouch.vcxproj.filters diff --git a/Externals/SoundTouch/TDStretch.cpp b/Externals/soundtouch/TDStretch.cpp similarity index 100% rename from Externals/SoundTouch/TDStretch.cpp rename to Externals/soundtouch/TDStretch.cpp diff --git a/Externals/SoundTouch/TDStretch.h b/Externals/soundtouch/TDStretch.h similarity index 100% rename from Externals/SoundTouch/TDStretch.h rename to Externals/soundtouch/TDStretch.h diff --git a/Externals/SoundTouch/cpu_detect.h b/Externals/soundtouch/cpu_detect.h similarity index 100% rename from Externals/SoundTouch/cpu_detect.h rename to Externals/soundtouch/cpu_detect.h diff --git a/Externals/SoundTouch/cpu_detect_x86.cpp b/Externals/soundtouch/cpu_detect_x86.cpp similarity index 100% rename from Externals/SoundTouch/cpu_detect_x86.cpp rename to Externals/soundtouch/cpu_detect_x86.cpp diff --git a/Externals/SoundTouch/mmx_optimized.cpp b/Externals/soundtouch/mmx_optimized.cpp similarity index 100% rename from Externals/SoundTouch/mmx_optimized.cpp rename to Externals/soundtouch/mmx_optimized.cpp diff --git a/Externals/SoundTouch/sse_optimized.cpp b/Externals/soundtouch/sse_optimized.cpp similarity index 100% rename from Externals/SoundTouch/sse_optimized.cpp rename to Externals/soundtouch/sse_optimized.cpp diff --git a/Source/Core/AudioCommon/CMakeLists.txt b/Source/Core/AudioCommon/CMakeLists.txt index be8c58d14a..93547681b0 100644 --- a/Source/Core/AudioCommon/CMakeLists.txt +++ b/Source/Core/AudioCommon/CMakeLists.txt @@ -18,7 +18,7 @@ endif(AO_FOUND) if(OPENAL_FOUND) set(SRCS ${SRCS} Src/OpenALStream.cpp Src/aldlist.cpp) - set(LIBS ${LIBS} ${OPENAL_LIBRARY}) + set(LIBS ${LIBS} ${OPENAL_LIBRARY} SoundTouch ) endif(OPENAL_FOUND) if(PULSEAUDIO_FOUND) diff --git a/Source/Core/AudioCommon/Src/OpenALStream.cpp b/Source/Core/AudioCommon/Src/OpenALStream.cpp index 85685b42cb..b0c856dcad 100644 --- a/Source/Core/AudioCommon/Src/OpenALStream.cpp +++ b/Source/Core/AudioCommon/Src/OpenALStream.cpp @@ -22,8 +22,7 @@ #if defined HAVE_OPENAL && HAVE_OPENAL -using namespace soundtouch; -SoundTouch soundTouch; +soundtouch::SoundTouch soundTouch; // // AyuanX: Spec says OpenAL1.1 is thread safe already diff --git a/Source/Core/AudioCommon/Src/OpenALStream.h b/Source/Core/AudioCommon/Src/OpenALStream.h index c6dfe519ae..6f39c8a49c 100644 --- a/Source/Core/AudioCommon/Src/OpenALStream.h +++ b/Source/Core/AudioCommon/Src/OpenALStream.h @@ -34,11 +34,11 @@ #include #endif -#include "../../Core/Src/Core.h" -#include "../../Core/Src/HW/SystemTimers.h" -#include "../../Core/Src/HW/AudioInterface.h" -#include "../../../../Externals/SoundTouch/STTypes.h" -#include "../../../../Externals/SoundTouch/SoundTouch.h" +#include "Core.h" +#include "HW/SystemTimers.h" +#include "HW/AudioInterface.h" +#include +#include // 16 bit Stereo #define SFX_MAX_SOURCE 1