From 54ab1d8ba1bff49450cd4b76800410fb0608e102 Mon Sep 17 00:00:00 2001 From: okay stopped screaming Date: Wed, 25 Mar 2026 22:27:54 +0200 Subject: [PATCH] wip: fix: 16e->425e...? --- Cargo.toml | 3 ++- src/arrange.rs | 28 ++++++++++++++-------------- src/clock.rs | 6 +++--- src/sequence.rs | 6 ++++-- src/tek.rs | 3 ++- tengri | 2 +- 6 files changed, 26 insertions(+), 22 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 299ba0dd..8453c345 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,6 +50,7 @@ proptest-derive = { version = "^0.5.1" } [features] default = ["cli", "arranger", "sampler"] + arranger = ["port", "editor", "sequencer", "track", "scene", "clip", "select"] browse = [] clap = [] @@ -57,11 +58,11 @@ cli = ["dep:clap"] clip = [] clock = [] editor = [] -host = ["lv2"] lv2 = ["port", "livi"] lv2_gui = ["lv2", "winit"] meter = [] mixer = [] +plugin = ["lv2"] pool = [] port = [] sampler = ["port", "meter", "mixer", "browse", "symphonia", "wavers"] diff --git a/src/arrange.rs b/src/arrange.rs index 96cb8241..9c99ac4a 100644 --- a/src/arrange.rs +++ b/src/arrange.rs @@ -110,7 +110,7 @@ pub trait ClipsView: TracksView + ScenesView { { self.clips_size().of(wh_full(above( wh_full(origin_se(Tui::fg(Green, format!("{}x{}", self.clips_size().w(), self.clips_size().h())))), - Thunk::new(|to: &mut Tui|for ( + thunk(|to: &mut Tui|for ( track_index, track, _, _ ) in self.tracks_with_sizes() { to.place(&w_exact(track.width as u16, @@ -119,7 +119,7 @@ pub trait ClipsView: TracksView + ScenesView { } fn view_track_clips <'a> (&'a self, track_index: usize, track: &'a Track) -> impl Draw + 'a { - Thunk::new(move|to: &mut Tui|for ( + thunk(move|to: &mut Tui|for ( scene_index, scene, .. ) in self.scenes_with_sizes() { let (name, theme): (Arc, ItemTheme) = if let Some(Some(clip)) = &scene.clips.get(track_index) { @@ -209,7 +209,7 @@ pub trait TracksView: ScenesView + HasMidiIns + HasMidiOuts + HasTrackScroll { button_2("T", "+", false), button_2("S", "+", false)); view_track_row_section(theme, button, button_2, Tui::bg(theme.darker.rgb, - h_exact(2, Thunk::new(|to: &mut Tui|{ + h_exact(2, thunk(|to: &mut Tui|{ for (index, track, x1, _x2) in self.tracks_with_sizes() { to.place(&x_push(x1 as u16, w_exact(track_width(index, track), Tui::bg(if selected.track() == Some(index) { @@ -225,11 +225,11 @@ pub trait TracksView: ScenesView + HasMidiIns + HasMidiOuts + HasTrackScroll { fn view_track_outputs <'a> (&'a self, theme: ItemTheme, _h: u16) -> impl Draw { view_track_row_section(theme, south(w_full(origin_w(button_2("o", "utput", false))), - Thunk::new(|to: &mut Tui|for port in self.midi_outs().iter() { + thunk(|to: &mut Tui|for port in self.midi_outs().iter() { to.place(&w_full(origin_w(port.port_name()))); })), button_2("O", "+", false), - Tui::bg(theme.darker.rgb, origin_w(Thunk::new(|to: &mut Tui|{ + Tui::bg(theme.darker.rgb, origin_w(thunk(|to: &mut Tui|{ for (index, track, _x1, _x2) in self.tracks_with_sizes() { to.place(&w_exact(track_width(index, track), origin_nw(h_full(iter_south(1, ||track.sequencer.midi_outs.iter(), @@ -243,7 +243,7 @@ pub trait TracksView: ScenesView + HasMidiIns + HasMidiOuts + HasTrackScroll { for track in self.tracks().iter() { h = h.max(track.sequencer.midi_ins.len() as u16); } - let content = Thunk::new(move|to: &mut Tui|for (index, track, _x1, _x2) in self.tracks_with_sizes() { + let content = thunk(move|to: &mut Tui|for (index, track, _x1, _x2) in self.tracks_with_sizes() { to.place(&wh_exact(track_width(index, track), h + 1, origin_nw(south( Tui::bg(track.color.base.rgb, @@ -289,7 +289,7 @@ pub trait ScenesView: HasEditor + HasSelection + HasSceneScroll + HasClipsSize + } fn view_scenes_names (&self) -> impl Draw { - w_exact(20, Thunk::new(|to: &mut Tui|for (index, scene, ..) in self.scenes_with_sizes() { + w_exact(20, thunk(|to: &mut Tui|for (index, scene, ..) in self.scenes_with_sizes() { to.place(&self.view_scene_name(index, scene)); })) } @@ -653,7 +653,7 @@ impl Arrangement { #[cfg(feature = "track")] pub fn view_inputs (&self, _theme: ItemTheme) -> impl Draw + '_ { south( h_exact(1, self.view_inputs_header()), - Thunk::new(|to: &mut Tui|{ + thunk(|to: &mut Tui|{ for (index, port) in self.midi_ins().iter().enumerate() { to.place(&x_push(index as u16 * 10, h_exact(1, self.view_inputs_row(port)))) } @@ -662,7 +662,7 @@ impl Arrangement { } #[cfg(feature = "track")] fn view_inputs_header (&self) -> impl Draw + '_ { east(w_exact(20, origin_w(button_3("i", "nput ", format!("{}", self.midi_ins.len()), false))), - west(w_exact(4, button_2("I", "+", false)), Thunk::new(move|to: &mut Tui|for (_index, track, x1, _x2) in self.tracks_with_sizes() { + west(w_exact(4, button_2("I", "+", false)), thunk(move|to: &mut Tui|for (_index, track, x1, _x2) in self.tracks_with_sizes() { #[cfg(feature = "track")] to.place(&x_push(x1 as u16, Tui::bg(track.color.dark.rgb, origin_w(w_exact(track.width as u16, east!( either(track.sequencer.monitoring, Tui::fg(Green, "mon "), "mon "), @@ -673,7 +673,7 @@ impl Arrangement { } #[cfg(feature = "track")] fn view_inputs_row (&self, port: &MidiInput) -> impl Draw { east(w_exact(20, origin_w(east(" โ— ", Tui::bold(true, Tui::fg(Rgb(255,255,255), port.port_name()))))), - west(w_exact(4, ()), Thunk::new(move|to: &mut Tui|for (_index, track, _x1, _x2) in self.tracks_with_sizes() { + west(w_exact(4, ()), thunk(move|to: &mut Tui|for (_index, track, _x1, _x2) in self.tracks_with_sizes() { #[cfg(feature = "track")] to.place(&Tui::bg(track.color.darker.rgb, origin_w(w_exact(track.width as u16, east!( either(track.sequencer.monitoring, Tui::fg(Green, " โ— "), " ยท "), @@ -690,7 +690,7 @@ impl Arrangement { let h = h as u16; let list = south( h_exact(1, w_full(origin_w(button_3("o", "utput", format!("{}", self.midi_outs.len()), false)))), - h_exact(h - 1, wh_full(origin_nw(Thunk::new(|to: &mut Tui|{ + h_exact(h - 1, wh_full(origin_nw(thunk(|to: &mut Tui|{ for (_index, port) in self.midi_outs().iter().enumerate() { to.place(&h_exact(1,w_full(east( origin_w(east(" โ— ", Tui::fg(Rgb(255,255,255),Tui::bold(true, port.port_name())))), @@ -704,10 +704,10 @@ impl Arrangement { }))))); h_exact(h, view_track_row_section(theme, list, button_2("O", "+", false), Tui::bg(theme.darker.rgb, origin_w(w_full( - Thunk::new(|to: &mut Tui|{ + thunk(|to: &mut Tui|{ for (index, track, _x1, _x2) in self.tracks_with_sizes() { to.place(&w_exact(track_width(index, track), - Thunk::new(|to: &mut Tui|{ + thunk(|to: &mut Tui|{ to.place(&h_exact(1, origin_w(east( either(true, Tui::fg(Green, "play "), "play "), either(false, Tui::fg(Yellow, "solo "), "solo "), @@ -730,7 +730,7 @@ impl Arrangement { view_track_row_section(theme, button_3("d", "evice", format!("{}", self.track().map(|t|t.devices.len()).unwrap_or(0)), false), button_2("D", "+", false), - Thunk::new(move|to: &mut Tui|for (index, track, _x1, _x2) in self.tracks_with_sizes() { + thunk(move|to: &mut Tui|for (index, track, _x1, _x2) in self.tracks_with_sizes() { to.place(&wh_exact(track_width(index, track), h + 1, Tui::bg(track.color.dark.rgb, origin_nw(iter_south(2, move||0..h, |_, _index|wh_exact(track.width as u16, 2, diff --git a/src/clock.rs b/src/clock.rs index 2e76cbc6..a0516c13 100644 --- a/src/clock.rs +++ b/src/clock.rs @@ -636,9 +636,9 @@ impl Clock { todo!() } } -impl Command for ClockCommand { - fn execute (&self, state: &mut T) -> Perhaps { - self.execute(state.clock_mut()) // awesome +impl Act for ClockCommand { + fn act (&self, state: &mut T) -> Perhaps { + self.act(state.clock_mut()) // awesome } } impl ClockView { diff --git a/src/sequence.rs b/src/sequence.rs index 1b210dd3..819d8c7c 100644 --- a/src/sequence.rs +++ b/src/sequence.rs @@ -1266,8 +1266,10 @@ impl MidiViewer for PianoHorizontal { fn clip (&self) -> &Option>> { &self.clip } fn clip_mut (&mut self) -> &mut Option>> { &mut self.clip } /// Determine the required space to render the clip. - fn buffer_size (&self, clip: &MidiClip) -> (usize, usize) { (clip.length / self.range.time_zoom().get(), 128) } - fn redraw(self) { + fn buffer_size (&self, clip: &MidiClip) -> (usize, usize) { + (clip.length / self.range.time_zoom().get(), 128) + } + fn redraw (&self) { *self.buffer.write().unwrap() = if let Some(clip) = self.clip.as_ref() { let clip = clip.read().unwrap(); let buf_size = self.buffer_size(&clip); diff --git a/src/tek.rs b/src/tek.rs index 67655ac9..af7c9c1e 100644 --- a/src/tek.rs +++ b/src/tek.rs @@ -49,12 +49,13 @@ pub mod dialog; pub mod menu; pub mod mix; pub mod mode; -pub mod plugin; pub mod sample; pub mod sequence; pub mod select; pub mod view; +#[cfg(feature = "plugin")] pub mod plugin; + use clap::{self, Parser, Subcommand}; use builder_pattern::Builder; use self::{ diff --git a/tengri b/tengri index cf57f449..30d378a6 160000 --- a/tengri +++ b/tengri @@ -1 +1 @@ -Subproject commit cf57f44933c45507e8de072e32c284f20f12ac7a +Subproject commit 30d378a6ee8a998b3c4437a4c2e83f56b370ac1d