pass around TransportTime

This commit is contained in:
🪞👃🪞 2024-10-26 17:31:44 +03:00
parent 85e243f782
commit 67a5ea3a2b
6 changed files with 41 additions and 25 deletions

View file

@ -6,6 +6,8 @@ pub struct Arranger<E: Engine> {
pub focus_cursor: (usize, usize),
/// Controls the JACK transport.
pub transport: Option<Arc<RwLock<TransportToolbar<E>>>>,
/// Global timebase
pub clock: Arc<TransportTime>,
/// Contains all the sequencers.
pub arrangement: Arrangement<E>,
/// Pool of all phrases in the arrangement
@ -117,14 +119,19 @@ impl<E: Engine> Arranger<E> {
phrases: Arc<RwLock<PhrasePool<E>>>,
) -> Self {
let mut app = Self {
focus_cursor: (0, 1),
editor: PhraseEditor::new(),
status: ArrangerStatusBar::ArrangementClip,
focus_cursor: (0, 1),
phrases_split: 20,
arrangement_split: 20,
editor: PhraseEditor::new(),
status: ArrangerStatusBar::ArrangementClip,
clock: if let Some(ref transport) = transport {
transport.read().unwrap().clock.clone()
} else {
Arc::new(TransportTime::default())
},
transport,
arrangement,
phrases,
phrases_split: 20,
arrangement_split: 20,
};
app.update_focus();
app