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

◆ close()

void MayaFlux::Core::RtAudioStream::close ( )
overridevirtual

Terminates the audio stream and releases all resources.

Closes the RtAudio stream, releasing all allocated resources and disconnecting from hardware endpoints.

Implements MayaFlux::Core::AudioStream.

Definition at line 314 of file RtAudioBackend.cpp.

315{
316 if (!m_isOpen || !m_context) {
317 return;
318 }
319
320 if (is_running()) {
321 stop();
322 }
323
324 try {
325 if (m_context->isStreamOpen()) {
326 m_context->closeStream();
328 }
329 m_isOpen = false;
330 } catch (const RtAudioErrorType& e) {
331 m_isOpen = false;
333
337 std::source_location::current(),
338 "Failed to close RtAudio stream: {}",
339 m_context->getErrorText());
340 }
341}
static void mark_stream_closed()
Deregisters an active audio stream from the system.
void stop() override
Deactivates the audio stream and halts data transfer.
bool m_isOpen
Flag indicating if the stream is currently open.
RtAudio * m_context
Pointer to the underlying RtAudio context.
bool is_running() const override
Checks if the stream is actively processing audio data.
@ AudioBackend
Audio processing backend (RtAudio, JACK, ASIO)
void error_rethrow(Component component, Context context, std::source_location location=std::source_location::current(), std::string_view additional_context="")
Catch and log an exception, then rethrow it.
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::AudioBackend, MayaFlux::Journal::Core, is_running(), m_context, m_isOpen, MayaFlux::Core::RtAudioSingleton::mark_stream_closed(), and stop().

Referenced by ~RtAudioStream().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: