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

◆ write_to_buffer()

void MayaFlux::Buffers::AudioWriteProcessor::write_to_buffer ( AudioBuffer buf) const
private

Definition at line 116 of file AudioWriteProcessor.cpp.

117{
118 auto& dst = buf.get_data();
119 const size_t dst_n = dst.size();
120
121 if (m_active.empty()) {
122 std::ranges::fill(dst, 0.0);
123 return;
124 }
125
126 const size_t copy_n = std::min(dst_n, m_active.size());
127 std::ranges::copy_n(m_active.begin(), static_cast<std::ptrdiff_t>(copy_n), dst.begin());
128
129 if (copy_n < dst_n) {
130 std::fill(dst.begin() + static_cast<std::ptrdiff_t>(copy_n), dst.end(), 0.0);
131 }
132}

References MayaFlux::Buffers::AudioBuffer::get_data(), and m_active.

Referenced by processing_function().

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