MCPcopy Create free account
hub / github.com/LabSound/LabSound / error

Method error

src/backends/RtAudio/RtAudio.cpp:10950–10981  ·  view source on GitHub ↗

This method can be modified to control the behavior of error message printing.

Source from the content-addressed store, hash-verified

10948// This method can be modified to control the behavior of error
10949// message printing.
10950void RtApi ::error(RtAudioError::Type type)
10951{
10952 errorStream_.str(""); // clear the ostringstream
10953
10954 RtAudioErrorCallback errorCallback = (RtAudioErrorCallback) stream_.callbackInfo.errorCallback;
10955 if (errorCallback)
10956 {
10957 // abortStream() can generate new error messages. Ignore them. Just keep original one.
10958
10959 if (firstErrorOccurred_)
10960 return;
10961
10962 firstErrorOccurred_ = true;
10963 const std::string errorMessage = errorText_;
10964
10965 if (type != RtAudioError::WARNING && stream_.state != STREAM_STOPPED)
10966 {
10967 stream_.callbackInfo.isRunning = false; // exit from the thread
10968 abortStream();
10969 }
10970
10971 errorCallback(type, errorMessage);
10972 firstErrorOccurred_ = false;
10973 return;
10974 }
10975
10976 if (type == RtAudioError::WARNING && showWarnings_ == true)
10977 std::cerr << '\n'
10978 << errorText_ << "\n\n";
10979 else if (type != RtAudioError::WARNING)
10980 throw(RtAudioError(errorText_, type));
10981}
10982
10983void RtApi ::verifyStream()
10984{

Callers

nothing calls this directly

Calls 1

RtAudioErrorFunction · 0.85

Tested by

no test coverage detected