OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
value_port.hpp
1#pragma once
2#include <ossia/dataflow/timed_value.hpp>
3#include <ossia/dataflow/typed_value.hpp>
4#include <ossia/dataflow/value_vector.hpp>
6#include <ossia/network/common/complex_type.hpp>
8
9#include <optional>
10
11namespace ossia
12{
13enum data_mix_method : int8_t
14{
15 mix_append,
16 mix_replace,
17 mix_merge
18};
19
20struct OSSIA_EXPORT value_port
21{
22 static const constexpr int which = 2;
24 void write_value(const ossia::value& v, int64_t timestamp);
25
26 void write_value(ossia::value&& v, int64_t timestamp);
27
28 void add_local_value(const ossia::typed_value& other);
29
30 void add_port_values(const ossia::value_port& other);
31
32 void add_global_values(
33 const ossia::net::parameter_base& param, const value_vector<ossia::value>& vec);
34
35 void add_global_value(const ossia::net::parameter_base& other, ossia::value v);
36
37 void set_data(const value_vector<ossia::timed_value>& vec);
38
39 void clear();
40
41 [[nodiscard]] const value_vector<ossia::timed_value>& get_data() const;
42 value_vector<ossia::timed_value>& get_data();
43
44 ossia::domain domain;
45 ossia::complex_type type;
47 // std::optional<ossia::time_value> tween_date;
48
49 bool is_event{};
50 data_mix_method mix_method{};
51
52private:
53 value_vector<ossia::timed_value> data;
54};
55
56struct value_delay_line
57{
58 std::vector<value_vector<ossia::typed_value>> data;
59};
60
61OSSIA_EXPORT
62void process_control_value(
63 ossia::value& v, const ossia::domain& source_domain,
64 const ossia::domain& sink_domain) noexcept;
65OSSIA_EXPORT
66void process_control_value(
67 ossia::value& v, const ossia::complex_type& source_type,
68 const ossia::complex_type& sink_type) noexcept;
69OSSIA_EXPORT
70void process_control_value(
71 ossia::value& v, const ossia::domain& source_domain,
72 const ossia::domain& sink_domain, const ossia::complex_type& source_type,
73 const ossia::complex_type& sink_type) noexcept;
74}
The parameter_base class.
Definition ossia/network/base/parameter.hpp:48
The value class.
Definition value.hpp:173
Definition git_info.h:7
ossia::small_vector< int32_t, 2 > destination_index
Definition destination_index.hpp:40
domain A domain of values
Definition domain_base.hpp:23