2#include <ossia/network/base/parameter.hpp>
3#include <ossia/network/domain/domain.hpp>
4#include <ossia/protocols/midi/detail/channel.hpp>
10namespace ossia::net::midi
15 enum class Type : midi_size_t
50 static const std::string* num_table_init() noexcept
52 static std::string num_table[257];
53 for(
int i = 0; i < 257; i++)
55 num_table[i] = std::to_string(i);
59 static const std::string* num_table() noexcept
61 static auto ptr = num_table_init();
67 auto nums = num_table();
71 return "/" + nums[channel] +
"/note/on";
73 return "/" + nums[channel] +
"/note/off";
75 return "/" + nums[channel] +
"/CC";
77 return "/" + nums[channel] +
"/note/on/" + nums[note];
79 return "/" + nums[channel] +
"/note/off/" + nums[note];
81 return "/" + nums[channel] +
"/CC/" + nums[note];
83 return "/" + nums[channel] +
"/PC";
85 return "/" + nums[channel] +
"/PC/" + nums[note];
87 return "/" + nums[channel] +
"/PB";
101 return value{std::vector<ossia::value>{int32_t{val}, int32_t{val}}};
103 return value{std::vector<ossia::value>{}};
105 case Type::NoteOff_N:
111 return ossia::impulse{};
118 if(type != Type::PB && type != Type::Any)
119 return ossia::make_domain(defaultValue(0), defaultValue(127));
120 return ossia::make_domain(0, 16384);
128 address_info(Type t, midi_size_t n)
134 address_info(midi_size_t chan, Type t, midi_size_t n)
140 midi_size_t channel{};
154 const address_info& info()
const;
156 void pull_value() final override;
157 parameter_base& push_value(const
ossia::value& val) final override;
158 parameter_base& push_value(
ossia::value&& val) final override;
159 parameter_base& push_value() final override;
160 const
ossia::value& getValue() const;
162 ossia::value value() const final override;
163 ossia::value set_value(const
ossia::value& v) final override;
164 ossia::value set_value(
ossia::value&& v) final override;
166 ossia::
val_type get_value_type() const noexcept final override;
167 parameter_base& set_value_type(
ossia::
val_type) final override;
172 const
ossia::domain& get_domain() const noexcept final override;
173 parameter_base& set_domain(const
ossia::domain&) final override;
178 void on_first_callback_added() final override;
179 void on_removing_last_callback() final override;
181 void value_callback(const
ossia::value& val);
185 ossia::net::protocol_base& m_protocol;
186 ossia::domain m_domain;
189 ossia::value m_value;
The node_base class.
Definition node.hpp:48
The parameter_base class.
Definition ossia/network/base/parameter.hpp:48
The protocol_base class.
Definition protocol.hpp:40
The value class.
Definition value.hpp:173
val_type
Enum to represent the types that a value can take.
Definition parameter_properties.hpp:16
bounding_mode
Address behaviors at crossing domain boundaries.
Definition parameter_properties.hpp:56
access_mode
Address behaviors at crossing domain boundaries time.
Definition parameter_properties.hpp:46
domain A domain of values
Definition domain_base.hpp:23