MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ operator|() [1/7]

std::shared_ptr< Buffers::Buffer > MayaFlux::operator| ( const TemporalWrapper< Buffers::Buffer > &  wrapper,
const CreationContext ctx 
)

Definition at line 43 of file Temporal.cpp.

44{
45 auto buffer = wrapper.entity();
46 const auto& spec = wrapper.spec();
47 auto buffer_token = get_buffer_token(ctx.domain.value());
48
49 auto activation = std::make_shared<Kriya::TemporalActivation>(
51
52 if (ctx.channel.has_value()) {
53 activation->activate_buffer(buffer, spec.seconds, buffer_token, ctx.channel.value());
54 } else if (ctx.channels.has_value() && !ctx.channels.value().empty()) {
55 activation->activate_buffer(buffer, spec.seconds, buffer_token, ctx.channels.value()[0]);
56 } else {
57 activation->activate_buffer(buffer, spec.seconds, buffer_token);
58 }
59
60 static std::vector<std::shared_ptr<Kriya::TemporalActivation>> active_timers;
61 active_timers.push_back(activation);
62
63 if (active_timers.size() > 100) {
64 std::erase_if(active_timers, [](const std::shared_ptr<Kriya::TemporalActivation>& t) {
65 return !t->is_active();
66 });
67 }
68
69 return buffer;
70}
std::shared_ptr< Nodes::NodeGraphManager > get_node_graph_manager()
Gets the node graph manager from the default engine.
Definition Graph.cpp:35
std::shared_ptr< Buffers::BufferManager > get_buffer_manager()
Gets the buffer manager from the default engine.
Definition Graph.cpp:132
std::shared_ptr< Vruta::TaskScheduler > get_scheduler()
Gets the task scheduler from the default engine.
Definition Chronie.cpp:22
MAYAFLUX_API Buffers::ProcessingToken get_buffer_token(Domain domain)
Extracts buffer processing token from domain.
Definition Domain.hpp:184
std::optional< uint32_t > channel
Definition Creator.hpp:22
std::optional< std::vector< uint32_t > > channels
Definition Creator.hpp:23
std::optional< Domain > domain
Definition Creator.hpp:21

References MayaFlux::CreationContext::channel, MayaFlux::CreationContext::channels, MayaFlux::CreationContext::domain, get_buffer_manager(), get_buffer_token(), get_node_graph_manager(), and get_scheduler().

+ Here is the call graph for this function: