MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kakshya::PlotContainer Class Reference

SignalSourceContainer holding N named scalar series for plotting and signal use. More...

#include <PlotContainer.hpp>

+ Inheritance diagram for MayaFlux::Kakshya::PlotContainer:
+ Collaboration diagram for MayaFlux::Kakshya::PlotContainer:

Public Member Functions

void add_region_group (const RegionGroup &group) override
 Add a named group of regions to the container.
 
uint32_t add_series (std::string name, uint64_t count, DataDimension::Role role=DataDimension::Role::CUSTOM, DataModality modality=DataModality::TENSOR_ND)
 Add a named series with a given capacity, zero-initialised.
 
std::vector< DataAccessall_channel_data () override
 Get all channel data as accessors.
 
bool all_dimensions_consumed () const override
 Check if all active dimensions have been consumed in this cycle.
 
void bind (uint32_t series_index, std::function< void(std::vector< double > &)> fn)
 Bind a series to a callable.
 
void bind (uint32_t series_index, std::shared_ptr< Buffers::AudioBuffer > buffer)
 Bind a series to an AudioBuffer.
 
void bind (uint32_t series_index, std::shared_ptr< Nodes::Network::NodeNetwork > network)
 Bind a series to a NodeNetwork with audio output.
 
void bind (uint32_t series_index, std::shared_ptr< Nodes::Node > node)
 Bind a series to a Node.
 
DataAccess channel_data (size_t index) override
 Get channel data with semantic interpretation.
 
void clear () override
 Clear all data in the container.
 
uint64_t coordinates_to_linear_index (const std::vector< uint64_t > &coordinates) const override
 Convert coordinates to linear index based on current memory layout.
 
void create_default_processor () override
 Create and configure a default processor for this container.
 
std::unordered_map< std::string, RegionGroupget_all_region_groups () const override
 Get all region groups in the container.
 
const std::vector< DataVariant > & get_data () override
 Get a reference to the raw data stored in the container.
 
std::shared_ptr< DataProcessorget_default_processor () const override
 Get the current default data processor.
 
std::vector< DataDimensionget_dimensions () const override
 Get the dimensions describing the structure of the data.
 
std::span< const double > get_frame (uint64_t frame_index) const override
 Get a single frame of data efficiently.
 
uint64_t get_frame_size () const override
 Get the number of elements that constitute one "frame".
 
void get_frames (std::span< double > output, uint64_t start_frame, uint64_t num_frames) const override
 Get multiple frames efficiently.
 
MemoryLayout get_memory_layout () const override
 Get the memory layout used by this container.
 
uint64_t get_num_frames () const override
 Get the number of frames in the primary (temporal) dimension.
 
const std::vector< DataVariant > & get_processed_data () const override
 Get a const reference to the processed data buffer.
 
std::vector< DataVariant > & get_processed_data () override
 Get a mutable reference to the processed data buffer.
 
std::shared_ptr< DataProcessingChainget_processing_chain () override
 Get the current processing chain for this container.
 
ProcessingState get_processing_state () const override
 Get the current processing state of the container.
 
const void * get_raw_data () const override
 Get a raw pointer to the underlying data storage.
 
std::vector< DataVariantget_region_data (const Region &region) const override
 Extract a sample range from a single series.
 
const RegionGroupget_region_group (const std::string &name) const override
 Get a region group by name.
 
std::vector< DataVariantget_region_group_data (const RegionGroup &group) const override
 Get data for multiple regions efficiently.
 
std::vector< DataVariantget_segments_data (const std::vector< RegionSegment > &segments) const override
 Get data for multiple region segments efficiently.
 
const ContainerDataStructureget_structure () const override
 
ContainerDataStructureget_structure () override
 Get the data structure defining this container's layout.
 
uint64_t get_total_elements () const override
 Get the total number of elements in the container.
 
double get_value_at (const std::vector< uint64_t > &coordinates) const override
 Get a single value at the specified coordinates.
 
bool has_active_readers () const override
 Check if any dimensions currently have active readers.
 
bool has_data () const override
 Check if the container currently holds any data.
 
bool is_ready_for_processing () const override
 Check if the container is ready for processing.
 
bool is_region_loaded (const Region &) const override
 Check if a region is loaded in memory.
 
std::vector< uint64_t > linear_index_to_coordinates (uint64_t linear_index) const override
 Convert linear index to coordinates based on current memory layout.
 
void load_region (const Region &) override
 Load a region into memory.
 
void lock () override
 Acquire a lock for thread-safe access.
 
void mark_buffers_for_processing (bool) override
 Mark associated buffers for processing in the next cycle.
 
void mark_buffers_for_removal () override
 Mark associated buffers for removal from the system.
 
void mark_dimension_consumed (uint32_t, uint32_t) override
 Mark a dimension as consumed for the current processing cycle.
 
void mark_ready_for_processing (bool ready) override
 Mark the container as ready or not ready for processing.
 
PlotContaineroperator= (const PlotContainer &)=delete
 
PlotContaineroperator= (PlotContainer &&)=delete
 
 PlotContainer ()
 Construct an empty container.
 
 PlotContainer (const PlotContainer &)=delete
 
 PlotContainer (PlotContainer &&)=delete
 
void process_default () override
 Process the container's data using the default processor.
 
uint32_t register_dimension_reader (uint32_t) override
 Register a reader for a specific dimension.
 
void register_state_change_callback (std::function< void(const std::shared_ptr< SignalSourceContainer > &, ProcessingState)> cb) override
 Register a callback to be invoked on processing state changes.
 
void remove_region_group (const std::string &name) override
 Remove a region group by name.
 
void resize_series (uint32_t index, uint64_t count)
 Resize a series.
 
uint32_t series_count () const
 Return the number of series.
 
const std::string & series_name (uint32_t index) const
 Return the name of a series.
 
DataDimension::Role series_role (uint32_t index) const
 Return the role of a series.
 
uint64_t series_size (uint32_t index) const
 Return the sample count of a series.
 
void set_default_processor (const std::shared_ptr< DataProcessor > &processor) override
 Set the default data processor for this container.
 
void set_memory_layout (MemoryLayout) override
 Set the memory layout for this container.
 
void set_processing_chain (const std::shared_ptr< DataProcessingChain > &chain) override
 Set the processing chain for this container.
 
void set_raw (uint32_t series_index, std::vector< double > data)
 Push raw sample data into a series.
 
void set_region_data (const Region &region, const std::vector< DataVariant > &data) override
 Write a sample range back into a series.
 
void set_structure (ContainerDataStructure s) override
 Set the data structure for this container.
 
void set_value_at (const std::vector< uint64_t > &coordinates, double value) override
 Set a single value at the specified coordinates.
 
bool try_lock () override
 Attempt to acquire a lock without blocking.
 
void unbind (uint32_t series_index)
 Remove the source binding for a series.
 
void unload_region (const Region &) override
 Unload a region from memory.
 
void unlock () override
 Release a previously acquired lock.
 
void unregister_dimension_reader (uint32_t) override
 Unregister a reader for a specific dimension.
 
void unregister_state_change_callback () override
 Unregister the state change callback, if any.
 
void update_processing_state (ProcessingState state) override
 Update the processing state of the container.
 
void write_sample (uint32_t index, uint64_t sample_index, double value)
 Write a single sample within a series.
 
void write_series (uint32_t index, std::span< const double > samples)
 Write the full sample buffer for a series.
 
 ~PlotContainer () override=default
 
- Public Member Functions inherited from MayaFlux::Kakshya::SignalSourceContainer
 ~SignalSourceContainer () override=default
 
- Public Member Functions inherited from MayaFlux::Kakshya::NDDataContainer
virtual ~NDDataContainer ()=default
 

Private Member Functions

PlotProcessorensure_processor ()
 Return the PlotProcessor, creating and attaching it if absent.
 

Private Attributes

std::shared_ptr< DataProcessingChainm_chain
 
std::vector< DataVariantm_data
 
std::vector< double > m_frame_cache
 
std::vector< DataVariantm_processed_data
 
std::atomic< ProcessingStatem_processing_state { ProcessingState::IDLE }
 
std::shared_ptr< DataProcessorm_processor
 
std::atomic< bool > m_ready_for_processing { false }
 
std::unordered_map< std::string, RegionGroupm_region_groups
 
std::function< void(const std::shared_ptr< SignalSourceContainer > &, ProcessingState)> m_state_cb
 
ContainerDataStructure m_structure
 

Detailed Description

SignalSourceContainer holding N named scalar series for plotting and signal use.

Each series is a named std::vector<double> stored as a DataVariant in m_data, with a corresponding DataDimension (Role::CUSTOM, size = sample count, name = series name). processed_data mirrors m_data after PlotProcessor::process() — one DataVariant per series, index-stable, suitable for direct consumption by Forma geometry functions.

Series are append-only by index. Resize via resize_series() when the sample count changes. Region semantics apply per-series: a Region with start/end coordinates on the TIME-equivalent axis (dim 0) selects a sample range within that series. get_region_data() returns the selected slice as vector<double>, enabling wavetable read-back and drag-to-select interaction.

Dimension tracking, frame/stream navigation, and processing-token machinery inherited from SignalSourceContainer are no-op stubs here, grown into as needed.

Definition at line 37 of file PlotContainer.hpp.


The documentation for this class was generated from the following files: