Gracefully cancelling tourstop blocks (read: playing media)
(from note in https://github.com/OneZoom/OZtree/issues/535#issuecomment-1308847461)
Currently if a user moves forwards/back manually, we change the state regardless and bin any blocks that had been set on that stop previously. This is a bit brutal.
There's some manual clean-up dotted around to cancel active-wait timers and flights, but they should be noticing the state change and doing it themselves.
Kinda related here, there's currently a bug for setting blocks in transition_out. We in goto_next() currently leave() a tourstop before play_from_start() the next. So if the leaving tourstop tries to raise a block, it raises it on the inactive stop and it gets thrown away.
The easy solution is to move the leave() to after changing state to TRANSITION_IN, but feels like there should be a less brittle way of doing this.
- [ ] Add unit test to make sure that this doesn't break in future.