From 6f782f237e685d3e835d084e869108c81849d86b Mon Sep 17 00:00:00 2001 From: "J.A. de Jong - Redu-Sone B.V., ASCEE V.O.F" Date: Mon, 4 Oct 2021 20:54:36 +0200 Subject: [PATCH] Bugfix: wrong #define statements, resulting in no Audio APIs at all --- CMakeLists.txt | 4 ++++ lasp/device/lasp_cppdaq.cpp | 17 +++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b3bb54..7f874e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,9 +134,13 @@ set(CMAKE_C_FLAGS_RELEASE "-O2 -mfpmath=sse -march=x86-64 -mtune=native \ +# Python searching. +set(Python_ADDITIONAL_VERSIONS "3.8") +set(python_version_windll "38") find_package(PythonLibs REQUIRED ) find_package(PythonInterp REQUIRED) +# Add FFTpack dir if used as FFT backend if(LASP_FFTPACK_BACKEND) add_subdirectory(fftpack) include_directories( diff --git a/lasp/device/lasp_cppdaq.cpp b/lasp/device/lasp_cppdaq.cpp index bcfe165..04d7aa8 100644 --- a/lasp/device/lasp_cppdaq.cpp +++ b/lasp/device/lasp_cppdaq.cpp @@ -1,23 +1,24 @@ #include "lasp_cppdaq.h" #include #include +#include "lasp_config.h" #define MAX_DEV_COUNT_PER_API 20 -#ifdef HAS_ULDAQ_API +#ifdef LASP_HAS_ULDAQ #include "lasp_cppuldaq.h" #endif -#ifdef HAS_RTAUDIO_API +#ifdef LASP_HAS_RTAUDIO #include "lasp_cpprtaudio.h" #endif vector Daq::getDeviceInfo() { vector devs; -#ifdef HAS_ULDAQ_API +#ifdef LASP_HAS_ULDAQ fillUlDaqDeviceInfo(devs); #endif -#ifdef HAS_RTAUDIO_API +#ifdef LASP_HAS_RTAUDIO fillRtAudioDeviceInfo(devs); #endif @@ -28,10 +29,10 @@ vector DaqApi::getAvailableApis() { vector apis; apis.resize(6); -#ifdef HAS_ULDAQ_API +#ifdef LASP_HAS_ULDAQ apis.at(uldaqapi.apicode) = uldaqapi; #endif -#ifdef HAS_RTAUDIO_API +#ifdef LASP_HAS_RTAUDIO apis.at(rtaudioAlsaApi.apicode) = rtaudioAlsaApi; apis.at(rtaudioPulseaudioApi.apicode) = rtaudioPulseaudioApi; apis.at(rtaudioWasapiApi.apicode) = rtaudioWasapiApi; @@ -130,12 +131,12 @@ Daq *Daq::createDaq(const DeviceInfo& devinfo, if(devinfo.api == DaqApi()) { throw std::runtime_error(string("Unable to match API: ") + devinfo.api.apiname); } -#ifdef HAS_ULDAQ_API +#ifdef LASP_HAS_ULDAQ else if (devinfo.api == uldaqapi) { return createUlDaqDevice(devinfo, config); } #endif -#ifdef HAS_RTAUDIO_API +#ifdef LASP_HAS_RTAUDIO else if(apicode >= 1 && apicode <= 5) { return createRtAudioDevice(devinfo, config); }