54using ProcessHook = std::function<void(
unsigned int num_frames)>;
90 std::shared_ptr<Buffers::BufferManager> manager,
100 void process(uint32_t processing_units);
108 uint32_t processing_units,
109 const std::vector<double>& node_data);
112 void process_input(
double* input_data, uint32_t num_channels, uint32_t num_frames);
142 std::shared_ptr<Nodes::NodeGraphManager> manager,
146 void process(uint32_t num_samples);
149 std::vector<double>
process_channel(uint32_t channel, uint32_t num_samples);
156 template <
typename NodeType,
typename... Args>
159 auto node = std::make_shared<NodeType>(std::forward<Args>(args)...);
160 node->set_processing_token(
m_token);
172 std::shared_ptr<MayaFlux::Vruta::TaskScheduler> task_manager,
179 void process(uint64_t processing_units);
217 std::shared_ptr<Buffers::BufferManager> buffer_manager,
218 std::shared_ptr<Nodes::NodeGraphManager> node_manager,
219 std::shared_ptr<Vruta::TaskScheduler> task_scheduler,
223 std::shared_ptr<Buffers::BufferManager> buffer_manager,
224 std::shared_ptr<Nodes::NodeGraphManager> node_manager,
225 std::shared_ptr<Vruta::TaskScheduler> task_scheduler,
226 std::shared_ptr<Core::WindowManager> window_manager,
258 return hash<int>()(
static_cast<int>(tokens.Node)) ^ hash<int>()(
static_cast<int>(tokens.Buffer)) ^ hash<int>()(
static_cast<int>(tokens.Task));
static MayaFlux::Nodes::ProcessingToken token
std::span< double > write_channel_data(uint32_t channel)
Get write access to channel data with automatic locking.
std::span< const double > read_channel_data(uint32_t channel) const
Get read-only access to channel data.
void process_channel(uint32_t channel, uint32_t processing_units)
Process specific channel.
BufferProcessingHandle & operator=(const BufferProcessingHandle &)=delete
void process(uint32_t processing_units)
Process all channels in token domain.
void acquire_write_lock()
void setup_channels(uint32_t num_channels, uint32_t buffer_size)
Configure channel layout for token domain.
BufferProcessingHandle(BufferProcessingHandle &&)=default
void process_channel_with_node_data(uint32_t channel, uint32_t processing_units, const std::vector< double > &node_data)
Process channel with node output data integration.
Buffers::ProcessingToken m_token
std::shared_ptr< Buffers::BufferManager > m_manager
BufferProcessingHandle & operator=(BufferProcessingHandle &&)=default
void process_input(double *input_data, uint32_t num_channels, uint32_t num_frames)
@brienf Process Input from backend into buffer manager
void ensure_valid() const
BufferProcessingHandle(const BufferProcessingHandle &)=delete
Thread-safe interface for buffer operations within a processing domain.
void process(uint32_t num_samples)
Process all nodes in token domain.
std::vector< double > process_channel(uint32_t channel, uint32_t num_samples)
Process nodes for specific channel and return output.
std::shared_ptr< NodeType > create_node(Args &&... args)
Create node with automatic token assignment.
Nodes::ProcessingToken m_token
std::vector< std::vector< double > > process_audio_networks(uint32_t num_samples, uint32_t channel=0)
double process_sample(uint32_t channel)
std::shared_ptr< Nodes::NodeGraphManager > m_manager
Interface for node graph operations within a processing domain.
std::map< std::string, ProcessHook > post_process_hooks
SubsystemTokens get_tokens() const
Get processing token configuration.
TaskSchedulerHandle tasks
NodeProcessingHandle nodes
Node processing interface.
WindowManagerHandle windows
std::map< std::string, ProcessHook > pre_process_hooks
BufferProcessingHandle buffers
Buffer processing interface.
Unified interface combining buffer and node processing for subsystems.
void register_token_processor(Vruta::token_processing_func_t processor)
Register custom processing function for token domain.
void process_buffer_cycle()
Process all tasks scheduled for current buffer cycle.
bool is_valid() const
Check if handle is valid.
Vruta::ProcessingToken m_token
std::shared_ptr< Vruta::TaskScheduler > m_scheduler
void process(uint64_t processing_units)
Process all tasks in token domain.
void process()
Process window events and frame hooks.
std::shared_ptr< Core::WindowManager > m_window_manager
std::vector< std::shared_ptr< Core::Window > > get_processing_windows() const
Get list of windows that are open and not minimized.
ProcessingToken
Bitfield enum defining processing characteristics and backend requirements for buffer operations.
std::function< void(unsigned int num_frames)> ProcessHook
Function type for process hooks that can be registered with the engine.
HookPosition
Defines the position in the processing cycle where a hook should be executed.
@ POST_PROCESS
Execute hook after all audio processing is complete.
@ PRE_PROCESS
Execute hook before any audio processing occurs.
ProcessingToken
Enumerates the different processing domains for nodes.
Contains the node-based computational processing system components.
std::function< void(const std::vector< std::shared_ptr< Routine > > &, uint64_t)> token_processing_func_t
Function type for processing tasks in a specific token domain.
Main namespace for the Maya Flux audio engine.
MayaFlux::Vruta::ProcessingToken Task
Processing token for task scheduling operations.
MayaFlux::Buffers::ProcessingToken Buffer
Processing token for buffer operations.
MayaFlux::Nodes::ProcessingToken Node
Processing token for node graph operations.
bool operator==(const SubsystemTokens &other) const
Equality comparison for efficient token matching.
Processing token configuration for subsystem operation.
size_t operator()(const MayaFlux::Core::SubsystemTokens &tokens) const noexcept