MayaFlux 0.3.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 331 of file RtAudioBackend.cpp.

332{
333 if (!m_isOpen || !m_context) {
334 return;
335 }
336
337 if (is_running()) {
338 stop();
339 }
340
341 try {
342 if (m_context->isStreamOpen()) {
343 m_context->closeStream();
345 }
346 m_isOpen = false;
347 } catch (const RtAudioErrorType& e) {
348 m_isOpen = false;
350
354 std::source_location::current(),
355 "Failed to close RtAudio stream: {}",
356 m_context->getErrorText());
357 }
358}
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: