OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
percentage.hpp
1#pragma once
2#include <ossia/dataflow/graph_node.hpp>
3#include <ossia/dataflow/port.hpp>
5
6namespace ossia::nodes
7{
8class percentage final : public ossia::nonowning_graph_node
9{
10public:
11 ossia::value_outlet outlet;
12 percentage(ossia::destination d)
13 : outlet{&d.address()}
14 {
15 m_outlets.push_back(&outlet);
16 }
17
18 std::string label() const noexcept override { return "percentage"; }
19 void run(const ossia::token_request& tk, ossia::exec_state_facade e) noexcept override
20 {
21 const auto [tick_start, d] = e.timings(tk);
22 outlet->write_value((float)tk.position(), tick_start);
23 }
24};
25}