Initially thew new region has a length of zero (0:0). When
merging Notes from a truncated region (no explicit note-off)
those notes are lost:
"Stuck note resolution - end time @ 0:0 is before note on: @ 0:0"
Truncate (or split) a region so that a note is cut short:
```
Region [{<--Note-------->}]
```
becomes
```
Region [{<--Note--]
^ implicit note-off at region boundary
```
When combining this region with an empty Region after gap,
```
Region [{<--Note--] [ ]
```
the result should be
```
Region [{<--Note->} ]
```
For this reason, even without a gap between the regions,
the original note length must not be restored.
The result MUST NOT be the same as the original:
```
Region [{<--Note-------->}]
```
This allows UI scripts (saved in preferences) to access
os.* functions (non-sandboxed), while preventing other
scripts to do so.
Lua scripts that can run os commands can execute arbitrary
code on the system. While this is a nice feature, it can be
equally dangerous.
Without this, Editor::button_release_handler() will handle a button3 press
without checking for an active drag, resulting in two drags, and two reversible
commands, and an abort ...
Playlist::split can result in removal of a region
(adding two others instead). In this case the state
of the removed region (if modified) is not saved.
This involved a significant change in event handling for automation region views,
but it brings it into line with how it works for other things. On button press
we initiate a drag, then if no motion occurs, the Drag returns false during
finalization, and only then do we continue through Editor::button_release_handler()
to eventually end up in ::add_automation_event().
Although it is a substantial change, the fact that it now works the same
way for audio regions, automation regions and automation tracks seems
like a definite plus.
Drag::_raw_grab_time is set to the correct time-domain. However
during ::motion() and other operations the adjusted time was
always AudioTime.
Most notably this caused editor->selection->time to have
different time-domains for start and end.