Skip to content

Commit

Permalink
Fixed processing of debounce time for Bx Controller events GrandOrgue…
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Samarin committed Jan 24, 2022
1 parent 184862f commit d078ee2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Fixed processing of debounce time for Bx Controller events https://github.com/GrandOrgue/grandorgue/issues/967
- Fixed size of the Load organ dialog https://github.com/GrandOrgue/grandorgue/issues/963
# 3.6.0 (2022-01-19)
- Fixed crash under OSx when closing a MIDI event dialog opened from a Settings window https://github.com/GrandOrgue/grandorgue/issues/966
Expand Down
16 changes: 8 additions & 8 deletions src/core/midi/GOMidiReceiverBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,14 +690,14 @@ MIDI_MATCH_TYPE GOMidiReceiverBase::Match(
&& m_events[i].key == e.GetKey()) {
if (m_events[i].low_value <= m_events[i].high_value) {
if (e.GetValue() <= m_events[i].low_value)
return MIDI_MATCH_OFF;
return debounce(e, MIDI_MATCH_OFF, i);
if (e.GetValue() >= m_events[i].high_value)
return MIDI_MATCH_ON;
return debounce(e, MIDI_MATCH_ON, i);
} else {
if (e.GetValue() >= m_events[i].low_value)
return MIDI_MATCH_OFF;
return debounce(e, MIDI_MATCH_OFF, i);
if (e.GetValue() <= m_events[i].high_value)
return MIDI_MATCH_ON;
return debounce(e, MIDI_MATCH_ON, i);
}
continue;
}
Expand Down Expand Up @@ -728,9 +728,9 @@ MIDI_MATCH_TYPE GOMidiReceiverBase::Match(
&& m_events[i].type == MIDI_M_CTRL_CHANGE_FIXED
&& m_events[i].key == e.GetKey()) {
if (e.GetValue() == m_events[i].low_value)
return MIDI_MATCH_OFF;
return debounce(e, MIDI_MATCH_OFF, i);
if (e.GetValue() == m_events[i].high_value)
return MIDI_MATCH_ON;
return debounce(e, MIDI_MATCH_ON, i);
continue;
}
if (
Expand Down Expand Up @@ -760,9 +760,9 @@ MIDI_MATCH_TYPE GOMidiReceiverBase::Match(
&& m_events[i].key == e.GetKey()) {
unsigned mask = 1 << m_events[i].low_value;
if (e.GetValue() & mask)
return MIDI_MATCH_ON;
return debounce(e, MIDI_MATCH_ON, i);
else
return MIDI_MATCH_OFF;
return debounce(e, MIDI_MATCH_OFF, i);
}

if (
Expand Down

0 comments on commit d078ee2

Please sign in to comment.