This involves better handling of note range changes, and also a renaming of
member variables to better reflect their function.
It adds _finished_live_notes to hold notes that were recorded live but have
ended, since these also need to be updated as zooming or note range changes
When building a MidiView from a Model, we call ::add_note() for every note, and
there is no reason to be adjusting the note range each and every time, since it
potentially a slightly expensive operation.
In particular, keep the MidiViewBackground's sense of the data range intact,
use MidiModel::{highest,lowest}_note(), center ranges that don't fit
on the data range
the code was first clearing the entire Editor selection before adding
the region, causing every note selection to trigger the RegionsChanged
pathway. This is crazy expensive for some reason (more than 8.12) and that
should be investigated, but the logic is also wrong. Selecting a region that is
alrready the sole selected region should not cause any action at all.
This includes note heights, note positions, contents height
for streamviews, positions of tracks. It makes zero sense to think of these as
having potentially fractional positions.
In addition, fractional note heights and positions lead to numerous
errors drawing MIDI stuff at the pixel level.
If an idle data captured callback executed AFTER the code trigger by capture
end, it would call ::begin_write() which would end up calling clear_events()
which would delete all notes in the correctly setup MidiView.
Now, the idle data capture callback no longer does anything of significance if
the TriggerBox is not actively recording. In addition, we do not call
begin_write() in the MidiView if it is not already set up for capture
display (this is triggered by changes in the TriggerBox's record enable state
and the first data captured callback from an RT thread. Further,
::begin_write(), if called, only deletes notes that were in
_active_notes (though this should probably never happen).
the active notes that are extended by transport rolling are
owned by MidiView::_events, not MidiView::_active_notes, so do not
delete them when cleaning up _active_notes.