|
MayaFlux 0.3.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 | |
| TemporalActivation (Vruta::TaskScheduler &scheduler, Nodes::NodeGraphManager &graph_manager, Buffers::BufferManager &buffer_manager) | |
| Constructs a TemporalActivation with the specified scheduler and manager. | |
| ~TemporalActivation ()=default | |
| 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 | 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_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 | cancel () |
| Cancels any currently active node. | |
| bool | is_active () const |
| Checks if a node is currently active. | |
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 | |
| Vruta::TaskScheduler & | m_scheduler |
| Reference to the scheduler that manages this timer. | |
| Nodes::NodeGraphManager & | m_node_graph_manager |
| Reference to the graph manager that manages processing nodes. | |
| Buffers::BufferManager & | m_buffer_manager |
| Reference to the buffer manager that manages processing buffers. | |
| Timer | m_timer |
| The timer used to schedule processing duration. | |
| std::shared_ptr< Nodes::Node > | m_current_node |
| The currently active node being played. | |
| std::shared_ptr< Nodes::Network::NodeNetwork > | m_current_network |
| The currently active network being played. | |
| std::shared_ptr< Buffers::Buffer > | m_current_buffer |
| The currently active buffer being played. | |
| Nodes::ProcessingToken | m_node_token |
| The processing token associated with the currently active node or buffer. | |
| 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. | |
| ActiveType | m_active_type = ActiveType::NONE |
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.