MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ mark_stream_open()

static void MayaFlux::Core::RtAudioSingleton::mark_stream_open ( )
inlinestatic

Registers an active audio stream in the system.

Exceptions
std::runtime_errorif a stream is already open

Thread-safe method that enforces the constraint of having only one active audio stream at any time. This prevents resource conflicts that could lead to audio glitches or system instability.

Definition at line 96 of file RtAudioSingleton.hpp.

97 {
98 std::lock_guard<std::mutex> lock(s_mutex);
99 if (s_stream_open) {
100 error<std::runtime_error>(
103 std::source_location::current(),
104 "Attempted to open a second RtAudio stream when one is already open");
105 }
106 s_stream_open = true;
107 }
static bool s_stream_open
Stream state flag to enforce exclusive stream ownership.
static std::mutex s_mutex
Synchronization primitive for thread-safe access to the singleton.
@ AudioBackend
Audio processing backend (RtAudio, JACK, ASIO)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::AudioBackend, MayaFlux::Journal::Core, s_mutex, and s_stream_open.

Referenced by MayaFlux::Core::RtAudioStream::open().

+ Here is the caller graph for this function: