|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
Specialized timer for controlling computational nodes, buffers, and networks. More...
#include <Timers.hpp>
Collaboration diagram for MayaFlux::Kriya::TemporalActivation:Public Member Functions | |
| void | activate_buffer (const std::shared_ptr< Buffers::Buffer > &buffer, double duration_seconds, Buffers::ProcessingToken token=Buffers::ProcessingToken::AUDIO_BACKEND, uint32_t channel=0) |
| Activates a buffer for a specified duration. | |
| void | activate_network (const std::shared_ptr< Nodes::Network::NodeNetwork > &network, double duration_seconds, Nodes::ProcessingToken token=Nodes::ProcessingToken::AUDIO_RATE, const std::vector< uint32_t > &channels={}) |
| Activates a node network for a specified duration. | |
| void | activate_node (const std::shared_ptr< Nodes::Node > &node, double duration_seconds, Nodes::ProcessingToken token=Nodes::ProcessingToken::AUDIO_RATE, const std::vector< uint32_t > &channels={}) |
| Activates a node for a specified duration. | |
| void | cancel () |
| Cancels any currently active node. | |
| bool | is_active () const |
| Checks if a node is currently active. | |
| TemporalActivation (Vruta::TaskScheduler &scheduler, Nodes::NodeGraphManager &graph_manager, Buffers::BufferManager &buffer_manager) | |
| Constructs a TemporalActivation with the specified scheduler and manager. | |
| ~TemporalActivation ()=default | |
Private Types | |
| enum class | ActiveType : uint8_t { NONE , NODE , BUFFER , NETWORK } |
Private Member Functions | |
| void | cleanup_current_operation () |
| Cleans up the current operation, disconnecting the entity and resetting state. | |
Private Attributes | |
| ActiveType | m_active_type = ActiveType::NONE |
| Buffers::BufferManager & | m_buffer_manager |
| Reference to the buffer manager that manages processing buffers. | |
| Buffers::ProcessingToken | m_buffer_token |
| The processing token associated with the currently active buffer. | |
| std::vector< uint32_t > | m_channels |
| The output channels the current node is connected to. | |
| std::shared_ptr< Buffers::Buffer > | m_current_buffer |
| The currently active buffer being played. | |
| std::shared_ptr< Nodes::Network::NodeNetwork > | m_current_network |
| The currently active network being played. | |
| std::shared_ptr< Nodes::Node > | m_current_node |
| The currently active node being played. | |
| Nodes::NodeGraphManager & | m_node_graph_manager |
| Reference to the graph manager that manages processing nodes. | |
| Nodes::ProcessingToken | m_node_token |
| The processing token associated with the currently active node or buffer. | |
| Vruta::TaskScheduler & | m_scheduler |
| Reference to the scheduler that manages this timer. | |
| Timer | m_timer |
| The timer used to schedule processing duration. | |
Specialized timer for controlling computational nodes, buffers, and networks.
The TemporalActivation class provides a high-level interface for activating nodes, buffers, or entire networks for a specified duration. It manages the lifecycle of the activated entity, ensuring that it is properly connected to the processing graph when activated and cleanly disconnected when the timer expires.
Usage example:
Definition at line 232 of file Timers.hpp.