mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-30 08:53:08 +01:00
enforce a 1 octave minimum note range in MidiViews
May revisit this to allow less in the future
This commit is contained in:
parent
747be87974
commit
975b01060a
1 changed files with 8 additions and 0 deletions
|
|
@ -255,6 +255,14 @@ MidiViewBackground::apply_note_range (uint8_t lowest, uint8_t highest, bool to_c
|
|||
{
|
||||
bool changed = false;
|
||||
|
||||
/* Enforce a 1 octave minimum */
|
||||
|
||||
if (highest - lowest < 12) {
|
||||
int8_t mid = lowest + ((highest - lowest) / 2);
|
||||
lowest = std::max (mid - 6, 0);
|
||||
highest = lowest + 12;
|
||||
}
|
||||
|
||||
if (_highest_note != highest) {
|
||||
_highest_note = highest;
|
||||
changed = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue