diff options
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/.clang-tidy | 1 | ||||
-rw-r--r-- | src/server/ControlBindings.cpp | 13 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/server/.clang-tidy b/src/server/.clang-tidy index deab7090..b309c823 100644 --- a/src/server/.clang-tidy +++ b/src/server/.clang-tidy @@ -16,7 +16,6 @@ Checks: > -bugprone-easily-swappable-parameters, -bugprone-parent-virtual-call, -bugprone-reserved-identifier, - -bugprone-signed-char-misuse, -bugprone-suspicious-string-compare, -cert-dcl37-c, -cert-dcl51-cpp, diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp index 8ae4f7c2..60684440 100644 --- a/src/server/ControlBindings.cpp +++ b/src/server/ControlBindings.cpp @@ -124,17 +124,20 @@ ControlBindings::midi_event_key(uint16_t, const uint8_t* buf, uint16_t& value) { switch (lv2_midi_message_type(buf)) { case LV2_MIDI_MSG_CONTROLLER: - value = static_cast<int8_t>(buf[2]); + value = buf[2]; return {Type::MIDI_CC, static_cast<int8_t>(buf[1])}; case LV2_MIDI_MSG_BENDER: - value = (static_cast<int8_t>(buf[2]) << 7) + static_cast<int8_t>(buf[1]); + value = (buf[2] << 7U) + buf[1]; return {Type::MIDI_BENDER}; case LV2_MIDI_MSG_CHANNEL_PRESSURE: - value = static_cast<int8_t>(buf[1]); + value = buf[1]; return {Type::MIDI_CHANNEL_PRESSURE}; case LV2_MIDI_MSG_NOTE_ON: - value = 1.0f; - return {Type::MIDI_NOTE, static_cast<int8_t>(buf[1])}; + value = 1; + return {Type::MIDI_NOTE, buf[1]}; + case LV2_MIDI_MSG_NOTE_OFF: + value = 0; + return {Type::MIDI_NOTE, buf[1]}; default: return {}; } |