diff options
author | David Robillard <d@drobilla.net> | 2017-02-09 20:42:11 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-02-09 20:42:11 +0100 |
commit | 2f2253a8a642edbccdb9ff477fd0f4f0060da283 (patch) | |
tree | 39500738b5f6bab58f1047cdb08339363712692c /src/server/ControlBindings.hpp | |
parent | 2ce49e31eaa10b1f230c18df330c584fc6a7477c (diff) | |
download | ingen-2f2253a8a642edbccdb9ff477fd0f4f0060da283.tar.gz ingen-2f2253a8a642edbccdb9ff477fd0f4f0060da283.tar.bz2 ingen-2f2253a8a642edbccdb9ff477fd0f4f0060da283.zip |
Fix multiple control bindings
Fixes #1151
Diffstat (limited to 'src/server/ControlBindings.hpp')
-rw-r--r-- | src/server/ControlBindings.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/ControlBindings.hpp b/src/server/ControlBindings.hpp index 538ab3ef..832e36d1 100644 --- a/src/server/ControlBindings.hpp +++ b/src/server/ControlBindings.hpp @@ -53,9 +53,13 @@ public: struct Key { Key(Type t=Type::NULL_CONTROL, int16_t n=0) : type(t), num(n) {} inline bool operator<(const Key& other) const { - return (type == other.type) ? (num < other.num) : (type < other.type); + return ((type < other.type) || + (type == other.type && num < other.num)); } - inline operator bool() const { return type != Type::NULL_CONTROL; } + inline bool operator==(const Key& other) const { + return type == other.type && num == other.num; + } + inline bool operator!() const { return type == Type::NULL_CONTROL; } Type type; int16_t num; }; |