TestNode.hpp
1 #pragma once
2 #include <Engine/Node/SimpleApi.hpp>
3 
4 /*
5 namespace Control
6 {
7 static inline constexpr void test_nodes()
8 {
9  constexpr NodeBuilder<> n{};
10  constexpr auto res =
11  n.audio_ins({{"foo"}, {"bar"}})
12  .audio_outs({{"mimi"}});
13 
14  constexpr NodeInfo<std::array<AudioOutInfo, 1>, std::array<AudioInInfo, 2>>&
15 bld = res.build();
16 {
17  constexpr std::tuple<std::array<AudioOutInfo, 1>, std::array<AudioInInfo, 2>>
18 t{bld};
19 
20  constexpr auto res2 = std::get<std::array<AudioInInfo, 2>>(t);
21  static_assert(res2[0].name[0] == 'f');
22 
23  constexpr auto res1 = std::get<std::array<AudioOutInfo, 1>>(t);
24  static_assert(res1[0].name[0] == 'm');
25 }
26  constexpr auto res2 = std::get<std::array<AudioInInfo, 2>>(bld.v);
27  static_assert(res2[0].name[0] == 'f');
28 
29  constexpr auto res1 = std::get<std::array<AudioOutInfo, 1>>(bld.v);
30  static_assert(res1[0].name[0] == 'm');
31 
32  static_assert(get_ports<AudioInInfo>(bld.v).size() == 2);
33  static_assert(get_ports<AudioOutInfo>(bld.v).size() == 1);
34  static_assert(get_ports<AudioInInfo>(bld.v)[0].name[0] == 'f');
35  static_assert(get_ports<AudioInInfo>(bld.v)[1].name[0] == 'b');
36  constexpr auto ports = get_ports<AudioOutInfo>(bld.v);
37  constexpr auto port = ports[0];
38  constexpr auto name = port.name;
39  static_assert(name[0] == 'm');
40 }
41 }
42 
43 namespace Nodes
44 {
45 
46 struct SomeInfo
47 {
48  struct Metadata
49  {
50  static const constexpr auto prettyName = "My Funny Process";
51  static const constexpr auto objectKey = "FunnyProcess";
52  static const constexpr auto category = "Test";
53  static const constexpr auto tags = std::array<const char*, 0>{};
54  static const constexpr auto uuid =
55 make_uuid("f6b88ec9-cd56-43e8-a568-33208d5a8fb7");
56  };
57 
58  struct State
59  {
60 
61  };
62 
63  static const constexpr auto info =
64  Control::create_node()
65  .audio_ins({{"audio1"}, {"audio2"}})
66  .midi_ins()
67  .midi_outs({{"midi1"}})
68  .value_ins()
69  .value_outs()
70  .controls(Control::FloatSlider{"foo", .0, 10., 5.})
71  .build();
72  using control_policy = Control::DefaultTick;
73  static void run(
74  const ossia::audio_port& p1,
75  const ossia::audio_port& p2,
76  const ossia::timed_vec<float>& o1,
77  ossia::midi_port& p,
78  ossia::time_value tk.prev_date,
79  ossia::token_request tk,
80  ossia::exec_state_facade ,
81  State& st)
82  {
83  }
84 };
85 }*/