launch countdown/switchover, pt.2

This commit is contained in:
🪞👃🪞 2024-11-01 20:52:14 +02:00
parent 3df8e87840
commit 97a7bf5b1d
3 changed files with 31 additions and 12 deletions

View file

@ -236,12 +236,20 @@ impl<E: Engine> Arrangement<E> {
size: Measure::new(),
}
}
fn is_stopped (&self) -> bool {
*self.clock.playing.read().unwrap() == Some(TransportState::Stopped)
}
pub fn activate (&mut self) {
match self.selected {
ArrangementFocus::Scene(s) => {
for (t, track) in self.tracks.iter_mut().enumerate() {
track.player.enqueue_next(self.scenes[s].clips[t].as_ref());
}
// TODO make transport available here, so that
// activating a scene when stopped starts playback
//if self.is_stopped() {
//self.transport.toggle_play()
//}
},
ArrangementFocus::Clip(t, s) => {
self.tracks[t].player.enqueue_next(self.scenes[s].clips[t].as_ref());