wip: down to 13 errors

This commit is contained in:
🪞👃🪞 2025-05-14 14:35:19 +03:00
parent 6ce83fb27a
commit ebdb8881e9
19 changed files with 793 additions and 691 deletions

View file

@ -6,6 +6,7 @@ impl Arrangement {
fn _todo_arc_str_stub_ (&self) -> Arc<str> { todo!() }
fn _todo_item_theme_stub (&self) -> ItemTheme { todo!() }
fn _todo_opt_item_theme_stub (&self) -> Option<ItemTheme> { todo!() }
fn _todo_opt_selection_ (&self) -> Option<Selection> { todo!() }
}
#[tengri_proc::command(Arrangement)]
@ -200,117 +201,20 @@ impl ArrangementCommand {
}
}
impl<'state> Context<'state, TrackCommand> for Arrangement {
fn get <'source> (&'state self, iter: &mut TokenIter<'source>) -> Option<TrackCommand> {
impl<'state> Context<'state, MidiInputCommand> for Arrangement {
fn get <'source> (&'state self, iter: &mut TokenIter<'source>) -> Option<MidiInputCommand> {
Context::get(&self, iter)
}
}
#[tengri_proc::expose]
impl Track {
fn _todo_opt_bool_stub_ (&self) -> Option<bool> { todo!() }
fn _todo_usize_stub_ (&self) -> usize { todo!() }
fn _todo_arc_str_stub_ (&self) -> Arc<str> { todo!() }
fn _todo_item_theme_stub (&self) -> ItemTheme { todo!() }
}
#[tengri_proc::command(Track)]
impl TrackCommand {
fn set_name (track: &mut Track, mut name: Arc<str>) -> Perhaps<Self> {
std::mem::swap(&mut name, &mut track.name);
Ok(Some(Self::SetName { name }))
}
fn set_color (track: &mut Track, mut color: ItemTheme) -> Perhaps<Self> {
std::mem::swap(&mut color, &mut track.color);
Ok(Some(Self::SetColor { color }))
}
fn set_mute (track: &mut Track, value: Option<bool>) -> Perhaps<Self> {
todo!()
}
fn set_solo (track: &mut Track, value: Option<bool>) -> Perhaps<Self> {
todo!()
}
fn set_rec (track: &mut Track, value: Option<bool>) -> Perhaps<Self> {
let current = track.sequencer.recording;
let value = value.unwrap_or(!current);
Ok((value != current).then_some(Self::SetRec { value: Some(current) }))
}
fn set_mon (track: &mut Track, value: Option<bool>) -> Perhaps<Self> {
let current = track.sequencer.monitoring;
let value = value.unwrap_or(!current);
Ok((value != current).then_some(Self::SetRec { value: Some(current) }))
}
fn set_size (track: &mut Track, size: usize) -> Perhaps<Self> {
todo!()
}
fn set_zoom (track: &mut Track, zoom: usize) -> Perhaps<Self> {
todo!()
}
fn stop (track: &mut Track) -> Perhaps<Self> {
track.sequencer.enqueue_next(None);
Ok(None)
}
}
impl<'state> Context<'state, SceneCommand> for Arrangement {
fn get <'source> (&'state self, iter: &mut TokenIter<'source>) -> Option<SceneCommand> {
impl<'state> Context<'state, MidiOutputCommand> for Arrangement {
fn get <'source> (&'state self, iter: &mut TokenIter<'source>) -> Option<MidiOutputCommand> {
Context::get(&self, iter)
}
}
impl<'state> Context<'state, ClipCommand> for Arrangement {
fn get <'source> (&'state self, iter: &mut TokenIter<'source>) -> Option<ClipCommand> {
impl<'state> Context<'state, DeviceCommand> for Arrangement {
fn get <'source> (&'state self, iter: &mut TokenIter<'source>) -> Option<DeviceCommand> {
Context::get(&self, iter)
}
}
#[tengri_proc::expose]
impl Scene {
fn _todo_opt_bool_stub_ (&self) -> Option<bool> { todo!() }
fn _todo_usize_stub_ (&self) -> usize { todo!() }
fn _todo_arc_str_stub_ (&self) -> Arc<str> { todo!() }
fn _todo_item_theme_stub (&self) -> ItemTheme { todo!() }
}
#[tengri_proc::command(Scene)]
impl SceneCommand {
fn set_name (scene: &mut Scene, mut name: Arc<str>) -> Perhaps<Self> {
std::mem::swap(&mut scene.name, &mut name);
Ok(Some(Self::SetName { name }))
}
fn set_color (scene: &mut Scene, mut color: ItemTheme) -> Perhaps<Self> {
std::mem::swap(&mut scene.color, &mut color);
Ok(Some(Self::SetColor { color }))
}
fn set_size (scene: &mut Scene, size: usize) -> Perhaps<Self> {
todo!()
}
fn set_zoom (scene: &mut Scene, zoom: usize) -> Perhaps<Self> {
todo!()
}
}
#[tengri_proc::expose]
impl MidiClip {
fn _todo_opt_bool_stub_ (&self) -> Option<bool> { todo!() }
fn _todo_bool_stub_ (&self) -> bool { todo!() }
fn _todo_usize_stub_ (&self) -> usize { todo!() }
fn _todo_arc_str_stub_ (&self) -> Arc<str> { todo!() }
fn _todo_item_theme_stub (&self) -> ItemTheme { todo!() }
fn _todo_opt_item_theme_stub (&self) -> Option<ItemTheme> { todo!() }
}
#[tengri_proc::command(MidiClip)]
impl ClipCommand {
fn set_color (clip: &mut MidiClip, color: Option<ItemTheme>) -> Perhaps<Self> {
//(SetColor [t: usize, s: usize, c: ItemTheme]
//clip.clip_set_color(t, s, c).map(|o|Self::SetColor(t, s, o)))));
//("color" [a: usize, b: usize] Some(Self::SetColor(a.unwrap(), b.unwrap(), ItemTheme::random())))
todo!()
}
fn set_loop (clip: &mut MidiClip, looping: Option<bool>) -> Perhaps<Self> {
//(SetLoop [t: usize, s: usize, l: bool] cmd_todo!("\n\rtodo: {self:?}"))
//("loop" [a: usize, b: usize, c: bool] Some(Self::SetLoop(a.unwrap(), b.unwrap(), c.unwrap())))
todo!()
}
}