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

◆ remove_source()

bool MayaFlux::Buffers::MixProcessor::remove_source ( std::shared_ptr< AudioBuffer buffer)

Removes a source buffer from the mix.

Parameters
bufferBuffer to remove
Returns
true if the source was successfully removed, false if it was not found

Definition at line 94 of file MixProcessor.cpp.

95{
96 if (!buffer) {
97 return false;
98 }
99
100 auto it = std::remove_if(m_sources.begin(), m_sources.end(),
101 [&buffer](const MixSource& s) {
102 return s.matches_buffer(buffer);
103 });
104
105 if (it != m_sources.end()) {
106 m_sources.erase(it, m_sources.end());
107 return true;
108 }
109
110 return false;
111}
std::vector< MixSource > m_sources

References m_sources.