mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
wip: refactor pt.20: 44 errors
This commit is contained in:
parent
914c2d6c09
commit
2188bccd63
25 changed files with 664 additions and 486 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
use crate::*;
|
||||
|
||||
/// MIDI message structural
|
||||
pub type PhraseData = Vec<Vec<MidiMessage>>;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct MIDIPlayer {
|
||||
/// Global timebase
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue