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

◆ set_value_impl()

void MayaFlux::Kakshya::SoundStreamContainer::set_value_impl ( const std::vector< uint64_t > &  coords,
const void *  in,
const std::type_info &  type 
)
overrideprotectedvirtual

Type-erased single-element write.

Implementations copy from in into their storage at coords if type matches their native type, otherwise no-op. in points to a caller-owned buffer of exactly sizeof(native type) bytes.

Implements MayaFlux::Kakshya::NDDataContainer< DataVariant >.

Definition at line 899 of file SoundStreamContainer.cpp.

903{
904 if (type != typeid(double) || coords.size() != 2)
905 return;
906
907 const uint64_t frame = coords[0];
908 const uint64_t channel = coords[1];
909
910 if (frame >= m_num_frames || channel >= m_num_channels)
911 return;
912
913 const auto& spans = get_span_cache();
914
916 if (spans.empty())
917 return;
918 const uint64_t idx = frame * m_num_channels + channel;
919 if (idx >= spans[0].size())
920 return;
921 const_cast<std::span<double>&>(spans[0])[idx] = *static_cast<const double*>(in);
922 } else {
923 if (channel >= spans.size() || frame >= spans[channel].size())
924 return;
925 const_cast<std::span<double>&>(spans[channel])[frame] = *static_cast<const double*>(in);
926 }
927
929 m_double_extraction_dirty.store(true, std::memory_order_release);
930}
bool size
std::vector< glm::ivec3 > coords
Definition VDBWriter.cpp:25
vk::PhysicalDeviceType type
Definition VKDevice.cpp:126
const std::vector< std::span< double > > & get_span_cache() const
Get the cached spans for each channel, recomputing if dirty.
void invalidate_span_cache()
Invalidate the span cache when data or layout changes.
@ INTERLEAVED
Single DataVariant with interleaved data (LRLRLR for stereo)

References coords, get_span_cache(), MayaFlux::Kakshya::INTERLEAVED, invalidate_span_cache(), m_double_extraction_dirty, m_num_channels, m_num_frames, m_structure, MayaFlux::Kakshya::ContainerDataStructure::organization, size, and type.

+ Here is the call graph for this function: