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

◆ stop()

void MayaFlux::Core::AudioSubsystem::stop ( )
overridevirtual

Stop audio processing and streaming.

Implements MayaFlux::Core::ISubsystem.

Definition at line 382 of file AudioSubsystem.cpp.

383{
384 if (!m_is_running.load()) {
385 return;
386 }
387
389 "Stopping AudioSubsystem...");
390
391 m_is_running.store(false, std::memory_order_release);
392
393 if (m_audio_stream && m_audio_stream->is_running()) {
394 m_audio_stream->stop();
395 }
396
397 if (m_callback_active.load() > 0) {
399 "Stopped while {} callback(s) active", m_callback_active.load());
400 }
401
402 m_notify_running.store(false, std::memory_order_release);
403 m_snapshot_generation.fetch_add(1, std::memory_order_release);
404 m_snapshot_generation.notify_all();
405
406 if (m_notify_thread.joinable())
407 m_notify_thread.join();
408
410 "AudioSubsystem stopped");
411}
#define MF_INFO(comp, ctx,...)
std::atomic< uint64_t > m_snapshot_generation
std::atomic< int > m_callback_active
Active callback counter.
std::atomic< bool > m_is_running
Subsystem running state.
std::atomic< bool > m_notify_running
std::unique_ptr< AudioStream > m_audio_stream
Audio stream manager.
@ AudioSubsystem
Audio subsystem operations (backend, device, stream management)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::AudioSubsystem, MayaFlux::Journal::Core, m_audio_stream, m_callback_active, m_is_running, m_notify_running, m_notify_thread, m_snapshot_generation, and MF_INFO.

Referenced by shutdown().

+ Here is the caller graph for this function: