Previously AudioPlaylist::read always returned the timecnt that
it was supposed to read into the buffer, regardless if the given
number of samples was read. The check in DiskReader::refill_audio
`if (nread != to_read)` never triggered.
This can happen when changing an audio-region's time-domain to
music-time (glue to bars/beats). Region-length (beats converted
to samples) can exceed the actual audio-source length (in samples).
AutomationList::start_touch must not start a write-pass.
That function is also called when the transport is no rolling.
A write-pass is started via AutomationWatch::add_automation_watch.
* undo is not (currently) a Global action, it's an Editor action
* ... but we want the ability to undo a recording
One option would be to chagne Undo to a Global action, which would have a
sizable impact on code and existing shortcuts.
Instead I'm choosing to implement a Rec-page-specific Undo action & shortcut
It's conceivable that someday we would want the Recorder page to ONLY undo
record operations, and the Mixer page to ONLY undo mixer operations, or
something like that. This lays the foundation for that.
This fixes a crash when deleting routes, while there are still
automation events queued for the route.
Specifically, SoloControl has a reference Soloable& _soloable; which
points to the parent route. A rt-event can still hold a valid shared
pointer to the SoloControl, even if the route is destroyed.
Calling SoloControl::actually_set_value is fine (the control still
exists due to the shared ptr), but then checking the parent route:
```
if (_soloable.is_safe() || !can_solo())
```
accesses the already deleted route, which causes a crash.
The solution implemented here is to not bind a shared_ptr to the
realtime event. However, since deletion of the route happens in the main
UI thread, there may or may not still be a race.