wip: refactor pt.20: 44 errors

This commit is contained in:
🪞👃🪞 2024-11-12 02:17:38 +01:00
parent 914c2d6c09
commit 2188bccd63
25 changed files with 664 additions and 486 deletions

View file

@ -58,6 +58,7 @@ impl Command<Arrangement> for ArrangementCommand {
impl Command<Arrangement> for ArrangementSceneCommand {
fn execute (self, state: &mut Arrangement) -> Perhaps<Self> {
match self {
Self::Delete(index) => { state.scene_del(index); },
_ => todo!()
}
Ok(None)
@ -67,6 +68,7 @@ impl Command<Arrangement> for ArrangementSceneCommand {
impl Command<Arrangement> for ArrangementTrackCommand {
fn execute (self, state: &mut Arrangement) -> Perhaps<Self> {
match self {
Self::Delete(index) => { state.track_del(index); },
_ => todo!()
}
Ok(None)

View file

@ -34,3 +34,15 @@ impl Clock {
if pulse % sync == 0 { pulse } else { (pulse / sync + 1) * sync }
}
}
impl From<Instant> for Clock {
fn from (current: Instant) -> Self {
Self {
playing: Some(TransportState::Stopped).into(),
started: None.into(),
quant: 24.into(),
sync: (current.timebase.ppq.get() * 4.).into(),
current,
}
}
}

View file

@ -1,8 +1,5 @@
use crate::*;
/// MIDI message structural
pub type PhraseData = Vec<Vec<MidiMessage>>;
#[derive(Debug)]
pub struct MIDIPlayer {
/// Global timebase