MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kakshya::RegionSegment Struct Reference

Represents a discrete segment of audio data with caching capabilities. More...

#include <RegionSegment.hpp>

+ Collaboration diagram for MayaFlux::Kakshya::RegionSegment:

Public Member Functions

 RegionSegment ()=default
 
 RegionSegment (const Region &region)
 Construct a segment from a region (full region).
 
 RegionSegment (Region region, const std::vector< uint64_t > &offset, const std::vector< uint64_t > &size)
 Construct a segment from a region with offset and size.
 
uint64_t get_total_elements () const
 Get the total number of elements in the segment.
 
bool contains_position (const std::vector< uint64_t > &pos) const
 Check if a position is within this segment.
 
double get_cache_age_seconds () const
 Get the age of the cache in seconds.
 
void mark_active ()
 
void mark_inactive ()
 
void mark_cached (const std::vector< DataVariant > &data)
 Mark this segment as cached and store the data.
 
void clear_cache ()
 Clear the cache for this segment.
 
void reset_position ()
 Reset the current position within the segment.
 
bool advance_position (uint64_t steps=1, uint32_t dimension=0)
 Advance the current position within the segment.
 
bool is_at_end () const
 Check if the current position is at the end of the segment.
 
void set_processing_metadata (const std::string &key, std::any value)
 Set processing metadata for this segment.
 
template<typename T >
std::optional< T > get_processing_metadata (const std::string &key) const
 Get processing metadata for this segment.
 

Public Attributes

Region source_region
 Associated region.
 
std::vector< uint64_t > offset_in_region
 Offset within the source region.
 
std::vector< uint64_t > segment_size
 Size in each dimension.
 
RegionCache cache
 Multi-channel cached audio data.
 
bool is_cached = false
 Flag indicating if data is cached.
 
std::vector< uint64_t > current_position { 0 }
 Current position within segment.
 
bool is_active = false
 
RegionState state = RegionState::IDLE
 
std::unordered_map< std::string, std::any > processing_metadata
 Arbitrary processing metadata.
 

Detailed Description

Represents a discrete segment of audio data with caching capabilities.

Defines a time-bounded segment of audio that can be cached for efficient playback and manipulation in non-linear processing contexts.

Definition at line 41 of file RegionSegment.hpp.


The documentation for this struct was generated from the following file: