From 68c69fb89da1b17be3ef0e222790c8f00fa7037f Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 17 Nov 2025 11:00:50 -0700 Subject: [PATCH] MidiViewBackground: make ::maybe_apply_note_range() return bool Just like ::apply_note_range, to indicate if the range was actually changed. --- gtk2_ardour/midi_view_background.cc | 6 +++--- gtk2_ardour/midi_view_background.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/midi_view_background.cc b/gtk2_ardour/midi_view_background.cc index 32d03c77a2..8fe35ba530 100644 --- a/gtk2_ardour/midi_view_background.cc +++ b/gtk2_ardour/midi_view_background.cc @@ -231,15 +231,15 @@ MidiViewBackground::maybe_extend_note_range (uint8_t note_num) } } -void +bool MidiViewBackground::maybe_apply_note_range (uint8_t lowest, uint8_t highest, bool to_children, RangeCanMove can_move) { if (note_range_set && _lowest_note <= lowest && _highest_note >= highest) { /* already large enough */ - return; + return false; } - apply_note_range (lowest, highest, to_children, can_move); + return apply_note_range (lowest, highest, to_children, can_move); } bool diff --git a/gtk2_ardour/midi_view_background.h b/gtk2_ardour/midi_view_background.h index 6edd2f1cde..b7caf82e06 100644 --- a/gtk2_ardour/midi_view_background.h +++ b/gtk2_ardour/midi_view_background.h @@ -118,7 +118,7 @@ class MidiViewBackground : public virtual ViewBackground }; bool apply_note_range (uint8_t lowest, uint8_t highest, bool to_children, RangeCanMove = RangeCanMove (CanMoveTop|CanMoveBottom)); - void maybe_apply_note_range (uint8_t lowest, uint8_t highest, bool to_children, RangeCanMove = RangeCanMove (CanMoveTop|CanMoveBottom)); + bool maybe_apply_note_range (uint8_t lowest, uint8_t highest, bool to_children, RangeCanMove = RangeCanMove (CanMoveTop|CanMoveBottom)); /** @return y position, or -1 if hidden */ virtual int y_position () const { return 0; }