add clock to sequencer tracks

This commit is contained in:
🪞👃🪞 2024-10-26 18:46:21 +03:00
parent 67a5ea3a2b
commit 4f53058742
5 changed files with 42 additions and 22 deletions

View file

@ -113,6 +113,8 @@ pub struct PhraseEditor<E: Engine> {
/// Phrase player.
pub struct PhrasePlayer<E: Engine> {
_engine: PhantomData<E>,
/// Global timebase
pub clock: Arc<TransportTime>,
/// Phrase being played
pub phrase: Option<Arc<RwLock<Phrase>>>,
/// Next phrase
@ -328,9 +330,10 @@ impl std::cmp::PartialEq for Phrase {
}
impl Eq for Phrase {}
impl<E: Engine> PhrasePlayer<E> {
pub fn new () -> Self {
pub fn new (clock: &Arc<TransportTime>) -> Self {
Self {
_engine: Default::default(),
clock: clock.clone(),
phrase: None,
next_phrase: None,
now: Arc::new(0.into()),