diff options
Diffstat (limited to 'src/server/ControlBindings.hpp')
-rw-r--r-- | src/server/ControlBindings.hpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/server/ControlBindings.hpp b/src/server/ControlBindings.hpp index 1c231e22..9a7f66a2 100644 --- a/src/server/ControlBindings.hpp +++ b/src/server/ControlBindings.hpp @@ -30,15 +30,13 @@ #include <memory> #include <vector> -namespace raul { class Path; } - -namespace boost { -namespace intrusive { +namespace raul { +class Path; +} // namespace raul +namespace boost::intrusive { template <class Compare> struct compare; - -} // namespace intrusive -} // namespace boost +} // namespace boost::intrusive namespace ingen { @@ -51,7 +49,8 @@ class Engine; class RunContext; class PortImpl; -class ControlBindings { +class ControlBindings +{ public: enum class Type : uint16_t { NULL_CONTROL, @@ -64,15 +63,21 @@ public: }; struct Key { - Key(Type t=Type::NULL_CONTROL, int16_t n=0) : type(t), num(n) {} - inline bool operator<(const Key& other) const { + Key(Type t = Type::NULL_CONTROL, int16_t n = 0) noexcept + : type(t), num(n) + {} + + bool operator<(const Key& other) const { return ((type < other.type) || (type == other.type && num < other.num)); } - inline bool operator==(const Key& other) const { + + bool operator==(const Key& other) const { return type == other.type && num == other.num; } - inline bool operator!() const { return type == Type::NULL_CONTROL; } + + bool operator!() const { return type == Type::NULL_CONTROL; } + Type type; int16_t num; }; @@ -82,7 +87,7 @@ public: public raul::Maid::Disposable { Binding(Key k=Key(), PortImpl* p=nullptr) : key(k), port(p) {} - inline bool operator<(const Binding& rhs) const { return key < rhs.key; } + bool operator<(const Binding& rhs) const { return key < rhs.key; } Key key; PortImpl* port; @@ -129,7 +134,7 @@ private: boost::intrusive::compare<BindingLess>>; static Key - midi_event_key(uint16_t size, const uint8_t* buf, uint16_t& value); + midi_event_key(const uint8_t* buf, uint16_t& value); void set_port_value(RunContext& ctx, PortImpl* port, |