From 01f4d9f386d225675d12cea7fedc1144dd2e02d4 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Wed, 9 Jan 2013 10:26:12 -0600 Subject: [PATCH] Fix include paths and compiling in Linux. Externals soundtouch is 1.7.1, while Ubuntu 12.10 is 1.6.x. Externals soundtouch is compiled with integer samples, while ubuntu is compiled with float samples. Float samples is probably the more common route. If you're going to use soundtouch, you should probably use SAMPLETYPE instead of explicitly choosing short. This probably breaks the windows build since its includes aren't setup. --- CMakeLists.txt | 24 ++++++++++--------- .../{SoundTouch => soundtouch}/AAFilter.cpp | 0 .../{SoundTouch => soundtouch}/AAFilter.h | 0 .../{SoundTouch => soundtouch}/BPMDetect.cpp | 0 .../{SoundTouch => soundtouch}/BPMDetect.h | 0 .../{SoundTouch => soundtouch}/CMakeLists.txt | 0 .../FIFOSampleBuffer.cpp | 0 .../FIFOSampleBuffer.h | 0 .../FIFOSamplePipe.h | 0 .../{SoundTouch => soundtouch}/FIRFilter.cpp | 0 .../{SoundTouch => soundtouch}/FIRFilter.h | 0 .../{SoundTouch => soundtouch}/PeakFinder.cpp | 0 .../{SoundTouch => soundtouch}/PeakFinder.h | 0 .../RateTransposer.cpp | 0 .../RateTransposer.h | 0 .../{SoundTouch => soundtouch}/STTypes.h | 0 .../{SoundTouch => soundtouch}/SoundTouch.cpp | 0 .../{SoundTouch => soundtouch}/SoundTouch.h | 0 .../SoundTouch.vcxproj | 0 .../SoundTouch.vcxproj.filters | 0 .../{SoundTouch => soundtouch}/TDStretch.cpp | 0 .../{SoundTouch => soundtouch}/TDStretch.h | 0 .../{SoundTouch => soundtouch}/cpu_detect.h | 0 .../cpu_detect_x86.cpp | 0 .../mmx_optimized.cpp | 0 .../sse_optimized.cpp | 0 Source/Core/AudioCommon/CMakeLists.txt | 2 +- Source/Core/AudioCommon/Src/OpenALStream.cpp | 3 +-- Source/Core/AudioCommon/Src/OpenALStream.h | 10 ++++---- 29 files changed, 20 insertions(+), 19 deletions(-) rename Externals/{SoundTouch => soundtouch}/AAFilter.cpp (100%) rename Externals/{SoundTouch => soundtouch}/AAFilter.h (100%) rename Externals/{SoundTouch => soundtouch}/BPMDetect.cpp (100%) rename Externals/{SoundTouch => soundtouch}/BPMDetect.h (100%) rename Externals/{SoundTouch => soundtouch}/CMakeLists.txt (100%) rename Externals/{SoundTouch => soundtouch}/FIFOSampleBuffer.cpp (100%) rename Externals/{SoundTouch => soundtouch}/FIFOSampleBuffer.h (100%) rename Externals/{SoundTouch => soundtouch}/FIFOSamplePipe.h (100%) rename Externals/{SoundTouch => soundtouch}/FIRFilter.cpp (100%) rename Externals/{SoundTouch => soundtouch}/FIRFilter.h (100%) rename Externals/{SoundTouch => soundtouch}/PeakFinder.cpp (100%) rename Externals/{SoundTouch => soundtouch}/PeakFinder.h (100%) rename Externals/{SoundTouch => soundtouch}/RateTransposer.cpp (100%) rename Externals/{SoundTouch => soundtouch}/RateTransposer.h (100%) rename Externals/{SoundTouch => soundtouch}/STTypes.h (100%) rename Externals/{SoundTouch => soundtouch}/SoundTouch.cpp (100%) rename Externals/{SoundTouch => soundtouch}/SoundTouch.h (100%) rename Externals/{SoundTouch => soundtouch}/SoundTouch.vcxproj (100%) rename Externals/{SoundTouch => soundtouch}/SoundTouch.vcxproj.filters (100%) rename Externals/{SoundTouch => soundtouch}/TDStretch.cpp (100%) rename Externals/{SoundTouch => soundtouch}/TDStretch.h (100%) rename Externals/{SoundTouch => soundtouch}/cpu_detect.h (100%) rename Externals/{SoundTouch => soundtouch}/cpu_detect_x86.cpp (100%) rename Externals/{SoundTouch => soundtouch}/mmx_optimized.cpp (100%) rename Externals/{SoundTouch => soundtouch}/sse_optimized.cpp (100%) 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