Types.hpp
1 #pragma once
2 #include <Engine/Node/CommonWidgets.hpp>
3 
4 #include <ossia/detail/pod_vector.hpp>
5 #include <ossia/detail/small_vector.hpp>
6 #include <ossia/detail/variant.hpp>
7 
8 #include <halp/audio.hpp>
9 #include <halp/callback.hpp>
10 #include <halp/controls.hpp>
11 #include <halp/meta.hpp>
12 #include <halp/midi.hpp>
13 #include <halp/polyfill.hpp>
14 #include <halp/static_string.hpp>
15 #include <libremidi/message.hpp>
16 
17 namespace Nodes
18 {
19 static constexpr auto multichannel_max_count = 8;
20 using multichannel_output_vector = ossia::small_pod_vector<float, multichannel_max_count>;
21 using multichannel_output_type = ossia::variant<float, multichannel_output_vector>;
22 using midi_out = halp::midi_out_bus<"out", libremidi::message>;
23 using value_output_callback = halp::basic_callback<void(ossia::value)>;
24 using value_out = halp::callback<"out", ossia::value>;
25 template <halp::static_string Str>
26 using midi_spinbox = halp::spinbox_i32<Str, halp::irange{0, 127, 64}>;
27 template <halp::static_string Str>
28 using midi_channel = halp::spinbox_i32<Str, halp::irange{1, 16, 1}>;
29 template <halp::static_string Str>
30 using midi_slider = halp::hslider_i32<Str, halp::irange{0, 127, 64}>;
31 template <halp::static_string Str>
32 using default_slider = halp::hslider_f32<Str>;
33 template <halp::static_string Str, int neg_oct, int pos_oct>
34 using octave_slider
35  = halp::hslider_i32<Str, halp::irange{12 * neg_oct, 12 * pos_oct, 0}>;
36 
37 template <halp::static_string lit, typename T, bool event = true>
38 struct ossia_port
39 {
40  halp_meta(is_event, event)
41  static clang_buggy_consteval auto name() { return std::string_view{lit.value}; }
42 
43  T* value{};
44 };
45 
46 template <halp::static_string lit, auto* array, int init_idx>
48 {
49  static clang_buggy_consteval auto name() { return std::string_view{lit.value}; }
50  enum widget
51  {
52  combobox
53  };
54  struct range
55  {
56  decltype(Control::Widgets::notes) values = Control::Widgets::notes;
57  float init = 1. / 4.;
58  };
59  float value = 1. / 4.;
60 };
61 
62 template <halp::static_string lit>
64 
65 template <halp::static_string lit>
67 template <halp::static_string lit>
70 }
Definition: Types.hpp:55
Definition: Types.hpp:48
Definition: Types.hpp:39