Some comment improvement and cleanup

This commit is contained in:
Anne de Jong 2022-07-25 22:29:42 +02:00
parent 6a006e27f9
commit da99618fc3
3 changed files with 121 additions and 120 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.16) cmake_minimum_required (VERSION 3.16)
project(LASP LANGUAGES CXX) project(LASP LANGUAGES C CXX)
# To allow linking to static libs from other directories # To allow linking to static libs from other directories
cmake_policy(SET CMP0079 NEW) cmake_policy(SET CMP0079 NEW)
@ -10,10 +10,6 @@ include("BuildType")
include("QueryPythonForPybind11") include("QueryPythonForPybind11")
# Generate stubs for the Python module
option(WITH_PY_STUBS
"Generate Python stub files (.pyi) for the Python module." On)
# Find the pybind11 package # Find the pybind11 package
find_pybind11_python_first() find_pybind11_python_first()
@ -50,7 +46,6 @@ find_package(BLAS REQUIRED)
add_definitions(-DLASP_MAX_NFFT=33554432) # 2**25 add_definitions(-DLASP_MAX_NFFT=33554432) # 2**25
# ####################################### End of user-adjustable variables section # ####################################### End of user-adjustable variables section
include(OSSpecific) include(OSSpecific)

View File

@ -122,7 +122,7 @@ class RtAudioDaq : public Daq {
std::atomic<StreamStatus> _streamStatus{}; std::atomic<StreamStatus> _streamStatus{};
public: public:
RtAudioDaq(const DeviceInfo &devinfo, const DaqConfiguration &config) RtAudioDaq(const DeviceInfo &devinfo, const DaqConfiguration &config)
: Daq(devinfo, config), : Daq(devinfo, config),
rtaudio(static_cast<RtAudio::Api>(devinfo.api.api_specific_subcode)), rtaudio(static_cast<RtAudio::Api>(devinfo.api.api_specific_subcode)),
@ -236,6 +236,7 @@ public:
"Output callback given, but stream does not provide output data"); "Output callback given, but stream does not provide output data");
} }
} }
rtaudio.startStream(); rtaudio.startStream();
// If we are here, we are running without errors. // If we are here, we are running without errors.
@ -251,6 +252,10 @@ public:
if (getStreamStatus().runningOK()) { if (getStreamStatus().runningOK()) {
rtaudio.stopStream(); rtaudio.stopStream();
} }
StreamStatus s = _streamStatus;
s.isRunning = false;
s.errorType = StreamStatus::StreamError::noError;
_streamStatus = s;
} }
int streamCallback(void *outputBuffer, void *inputBuffer, int streamCallback(void *outputBuffer, void *inputBuffer,
@ -268,6 +273,7 @@ public:
StreamStatus stat = _streamStatus; StreamStatus stat = _streamStatus;
stat.errorType = e; stat.errorType = e;
stat.isRunning = false; stat.isRunning = false;
_streamStatus = stat;
rval = 1; rval = 1;
}; };

View File

@ -6,4 +6,4 @@ add_library(fftpack
# Ling fft to math # Ling fft to math
target_link_libraries(fftpack PRIVATE m) target_link_libraries(fftpack PRIVATE m)
interface_include_directories(fftpack .) target_include_directories(fftpack PUBLIC .)