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

◆ remove_audio_sink()

void MayaFlux::Nexus::remove_audio_sink ( std::vector< AudioSink > &  sinks,
Buffers::BufferManager mgr,
uint32_t  channel 
)

Unregister and destroy the audio sink on channel.

Parameters
sinksSink vector owned by the calling Emitter or Agent.
mgrBufferManager the AudioBuffer was registered with.
channelChannel index passed to add_audio_sink().

Definition at line 43 of file Sinks.cpp.

47{
48 auto it = std::ranges::find_if(sinks,
49 [channel](const AudioSink& s) { return s.channel == channel; });
50
51 if (it == sinks.end()) {
52 MF_WARN(Journal::Component::Buffers, Journal::Context::Init,
53 "Nexus: remove_audio_sink called for channel {} but no sink found", channel);
54 return;
55 }
56
57 mgr.remove_buffer(it->buf, Buffers::ProcessingToken::AUDIO_BACKEND, channel);
58 sinks.erase(it);
59
60 MF_DEBUG(Journal::Component::Buffers, Journal::Context::Init,
61 "Nexus: audio sink removed from channel {}", channel);
62}
#define MF_WARN(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
uint32_t channel
void remove_buffer(const std::shared_ptr< Buffer > &buffer, ProcessingToken token, uint32_t channel=0)
Removes a buffer from a token.
Holds the plumbing for one audio output registered from a Nexus object.
Definition Sinks.hpp:42

References MayaFlux::Buffers::AUDIO_BACKEND, MayaFlux::Journal::Buffers, MayaFlux::Nexus::AudioSink::channel, channel, MayaFlux::Journal::Init, MF_DEBUG, MF_WARN, and MayaFlux::Buffers::BufferManager::remove_buffer().

Referenced by MayaFlux::Nexus::Agent::remove_audio_sink(), and MayaFlux::Nexus::Emitter::remove_audio_sink().

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