Bugfix: wrong #define statements, resulting in no Audio APIs at all

This commit is contained in:
Anne de Jong 2021-10-04 20:54:36 +02:00
parent 5a82367a45
commit 6f782f237e
2 changed files with 13 additions and 8 deletions

View File

@ -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(

View File

@ -1,23 +1,24 @@
#include "lasp_cppdaq.h"
#include <algorithm>
#include <cassert>
#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<DeviceInfo> Daq::getDeviceInfo() {
vector<DeviceInfo> 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> DaqApi::getAvailableApis() {
vector<DaqApi> 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);
}