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

◆ get_channel_frames() [2/2]

std::span< const double > MayaFlux::Kakshya::DynamicSoundStream::get_channel_frames ( uint32_t  channel,
uint64_t  start_frame,
uint64_t  num_frames 
) const

Get the fixed capacity of the circular buffer if enabled.

Returns
Capacity in frames if circular mode is active, 0 otherwise

Definition at line 221 of file DynamicSoundStream.cpp.

222{
223 if (channel >= get_num_channels())
224 return {};
225
228 "Direct span access not supported for interleaved data. "
229 "Use get_frames() or Kakshya::extract_channel_data() instead.");
230 return {};
231 }
232
233 std::span<const double> result;
235 if (channel >= m_data.size())
236 return;
237 const auto& channel_data = std::get<std::vector<double>>(m_data[channel]);
238 if (start_frame >= channel_data.size())
239 return;
240 uint64_t available_frames = channel_data.size() - start_frame;
241 uint64_t actual_frames = std::min(num_frames, available_frames);
242 result = { channel_data.data() + start_frame, actual_frames };
243 });
244 return result;
245}
#define MF_WARN(comp, ctx,...)
DataAccess channel_data(size_t channel) override
Get channel data with semantic interpretation.
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.
@ INTERLEAVED
Single DataVariant with interleaved data (LRLRLR for stereo)
bool seqlock_read_void(const Seqlock &lock, uint32_t max_attempts, Fn &&fn)
Invoke a void read functor under a Seqlock with a bounded retry count.
Definition SeqLock.hpp:222

References MayaFlux::Kakshya::SoundStreamContainer::channel_data(), MayaFlux::Journal::ContainerProcessing, MayaFlux::Kakshya::SoundStreamContainer::get_num_channels(), MayaFlux::Kakshya::INTERLEAVED, MayaFlux::Journal::Kakshya, MayaFlux::Kakshya::SoundStreamContainer::m_data, MayaFlux::Kakshya::SoundStreamContainer::m_data_lock, MayaFlux::Kakshya::SoundStreamContainer::m_structure, MF_WARN, and MayaFlux::Kakshya::ContainerDataStructure::organization.

+ Here is the call graph for this function: