mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 03:36:41 +01:00
with meagre coverage
This commit is contained in:
parent
86941305a4
commit
db2cadd43f
17 changed files with 50 additions and 71 deletions
12
Cargo.lock
generated
12
Cargo.lock
generated
|
|
@ -2396,7 +2396,6 @@ dependencies = [
|
|||
"rand 0.8.5",
|
||||
"symphonia",
|
||||
"tengri",
|
||||
"tengri_proc",
|
||||
"toml",
|
||||
"uuid",
|
||||
"wavers",
|
||||
|
|
@ -2458,17 +2457,6 @@ dependencies = [
|
|||
"tengri_dsl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tengri_proc"
|
||||
version = "0.14.0"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"tengri_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tengri_tui"
|
||||
version = "0.14.0"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# https://dystroy.org/bacon/config/
|
||||
default_job = "check"
|
||||
default_job = "test"
|
||||
env.CARGO_TERM_COLOR = "always"
|
||||
[keybindings]
|
||||
c = "job:check"
|
||||
|
|
@ -24,7 +24,7 @@ command = ["cargo", "clippy", "--all-targets"]
|
|||
need_stdout = false
|
||||
watch = ["tek", "deps"]
|
||||
[jobs.test]
|
||||
command = ["cargo", "test"]
|
||||
command = ["cargo", "test", "--workspace", "--exclude", "jack"]
|
||||
need_stdout = true
|
||||
watch = ["tek", "deps"]
|
||||
[jobs.nextest]
|
||||
|
|
|
|||
2
deps/tengri
vendored
2
deps/tengri
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit a4dbf88220f75ccaf9d14cc2e4fb7c00479e3940
|
||||
Subproject commit c5cdbf4f0741bc5b722847769e1f3f628fb95f6b
|
||||
|
|
@ -14,9 +14,6 @@ path = "tek_cli.rs"
|
|||
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
|
||||
|
||||
[dependencies]
|
||||
tengri = { workspace = true }
|
||||
tengri_proc = { workspace = true }
|
||||
|
||||
atomic_float = { workspace = true }
|
||||
backtrace = { workspace = true }
|
||||
clap = { workspace = true, optional = true }
|
||||
|
|
@ -27,6 +24,7 @@ midly = { workspace = true }
|
|||
palette = { workspace = true }
|
||||
rand = { workspace = true }
|
||||
symphonia = { workspace = true, optional = true }
|
||||
tengri = { workspace = true }
|
||||
toml = { workspace = true }
|
||||
uuid = { workspace = true, optional = true }
|
||||
wavers = { workspace = true, optional = true }
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ maybe_has!(Scene: |self: Arrangement|
|
|||
//.map(|t|Take::take(t, iter)).transpose().map(|x|x.flatten()));
|
||||
//take!(ClipCommand |state: Arrangement, iter|state.selected_clip().as_ref()
|
||||
//.map(|t|Take::take(t, iter)).transpose().map(|x|x.flatten()));
|
||||
#[tengri_proc::expose] impl Arrangement {
|
||||
impl Arrangement {
|
||||
fn selected_midi_in (&self) -> Option<MidiInput> { todo!() }
|
||||
fn selected_midi_out (&self) -> Option<MidiOutput> { todo!() }
|
||||
fn selected_device (&self) -> Option<Device> { todo!() }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
use crate::*;
|
||||
|
||||
#[tengri_proc::expose]
|
||||
impl MidiClip {
|
||||
fn _todo_opt_bool_stub_ (&self) -> Option<bool> { todo!() }
|
||||
fn _todo_bool_stub_ (&self) -> bool { todo!() }
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ pub trait AddScene: HasScenes + HasTracks {
|
|||
}
|
||||
}
|
||||
|
||||
#[tengri_proc::expose]
|
||||
impl Scene {
|
||||
fn _todo_opt_bool_stub_ (&self) -> Option<bool> { todo!() }
|
||||
fn _todo_usize_stub_ (&self) -> usize { todo!() }
|
||||
|
|
|
|||
|
|
@ -121,7 +121,6 @@ impl<T: MaybeHas<Track>> HasTrack for T {
|
|||
}
|
||||
}
|
||||
|
||||
#[tengri_proc::expose]
|
||||
impl Track {
|
||||
fn _todo_opt_bool_stub_ (&self) -> Option<bool> { todo!() }
|
||||
fn _todo_usize_stub_ (&self) -> usize { todo!() }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
use crate::*;
|
||||
|
||||
#[tengri_proc::expose]
|
||||
impl Browse {
|
||||
fn _todo_stub_path_buf (&self) -> PathBuf {
|
||||
todo!()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
use crate::*;
|
||||
|
||||
#[tengri_proc::expose]
|
||||
impl Clock {
|
||||
fn _todo_provide_u32 (&self) -> u32 {
|
||||
todo!()
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ def_command!(MidiEditCommand: |editor: MidiEditor| {
|
|||
// TODO: 1-9 seek markers that by default start every 8th of the clip
|
||||
});
|
||||
|
||||
#[tengri_proc::expose] impl MidiEditor {
|
||||
impl MidiEditor {
|
||||
fn _todo_opt_clip_stub (&self) -> Option<Arc<RwLock<MidiClip>>> {
|
||||
todo!()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
use crate::*;
|
||||
|
||||
#[tengri_proc::expose]
|
||||
impl Pool {
|
||||
fn _todo_usize_ (&self) -> usize { todo!() }
|
||||
fn _todo_bool_ (&self) -> bool { todo!() }
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ def_command!(FileBrowserCommand: |sampler: Sampler|{
|
|||
//("filter" [f: Arc<str>] Some(Self::Filter(f.expect("no filter")))))
|
||||
});
|
||||
|
||||
#[tengri_proc::expose]
|
||||
impl Sampler {
|
||||
fn sample_selected (&self) -> usize {
|
||||
(self.get_note_pos() as u8).into()
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ use crate::*;
|
|||
impl Sampler {
|
||||
|
||||
pub fn view_grid (&self) -> impl Draw<TuiOut> + Layout<TuiOut> + use<'_> {
|
||||
let cells_x = 8u16;
|
||||
let cells_y = 8u16;
|
||||
let cell_width = 10u16;
|
||||
let cell_height = 2u16;
|
||||
//let cells_x = 8u16;
|
||||
//let cells_y = 8u16;
|
||||
//let cell_width = 10u16;
|
||||
//let cell_height = 2u16;
|
||||
//let width = cells_x * cell_width;
|
||||
//let height = cells_y * cell_height;
|
||||
//let cols = Map::east(
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
(view :menu (bg (g 0) (bsp/s
|
||||
:ports/out
|
||||
(bsp/n :ports/in (bg (g 30) (bsp/s (fixed/y 7 :logo) (fill/xy :dialog/menu)))))))
|
||||
(view :menu (bsp/s (fixed/xy 20 2 (bg (g 20) :debug)) (fixed/xy 20 2 (bg (g 0) :debug))))
|
||||
(view :ports/out (fill/x (fixed/y 3 (bsp/a
|
||||
(fill/x (align/w (text L-AUDIO-OUT)))
|
||||
(bsp/a (text MIDI-OUT) (fill/x (align/e (text AUDIO-OUT-R))))))))
|
||||
|
|
|
|||
10
tek/tek.rs
10
tek/tek.rs
|
|
@ -269,8 +269,7 @@ impl ScenesView for App {
|
|||
impl Draw<TuiOut> for App {
|
||||
fn draw (&self, to: &mut TuiOut) {
|
||||
for (index, dsl) in self.mode.view.iter().enumerate() {
|
||||
to.place(&Align::nw(Push::y(1 + index as u16 * 2, dsl.src().unwrap())));
|
||||
//let _ = self.view(to, dsl).expect("render failed");
|
||||
self.view(to, dsl).expect("render failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -292,8 +291,7 @@ impl App {
|
|||
let mut frags = head.src()?.unwrap_or_default().split("/");
|
||||
let arg0 = args.head(); let tail0 = args.tail();
|
||||
let arg1 = tail0.head(); let tail1 = tail0.tail();
|
||||
let arg2 = tail1.head(); let tail2 = tail1.tail();
|
||||
let arg3 = tail2.head(); let tail3 = tail2.tail();
|
||||
let arg2 = tail1.head();
|
||||
match frags.next() {
|
||||
|
||||
Some("text") => to.place(&frags.next()),
|
||||
|
|
@ -509,13 +507,15 @@ impl App {
|
|||
let selected = self.dialog.device_kind().unwrap();
|
||||
to.place(&Bsp::s(Tui::bold(true, "Add device"), Map::south(1,
|
||||
move||device_kinds().iter(),
|
||||
move|label: &&'static str, i|{
|
||||
move|_label: &&'static str, i|{
|
||||
let bg = if i == selected { Rgb(64,128,32) } else { Rgb(0,0,0) };
|
||||
let lb = if i == selected { "[ " } else { " " };
|
||||
let rb = if i == selected { " ]" } else { " " };
|
||||
Fill::x(Tui::bg(bg, Bsp::e(lb, Bsp::w(rb, "FIXME device name")))) })))
|
||||
},
|
||||
|
||||
Some(":debug") => to.place(&Fixed::y(1, format!("[{:?}]", to.area()))),
|
||||
|
||||
Some(_) => {
|
||||
let views = self.config.views.read().unwrap();
|
||||
if let Some(dsl) = views.get(dsl.src()?.unwrap()) {
|
||||
|
|
|
|||
69
tek/test.rs
69
tek/test.rs
|
|
@ -1,23 +1,21 @@
|
|||
use crate::*;
|
||||
|
||||
#[cfg(test)] #[test] fn test_model () -> Usually<()> {
|
||||
#[cfg(test)] #[test] fn test_app () -> Usually<()> {
|
||||
let mut app = App::default();
|
||||
let _ = app.clip();
|
||||
let _ = app.toggle_loop();
|
||||
//let _ = app.tracks_add(8, None, &[], &[])?;
|
||||
//let _ = app.track_add_focus()?;
|
||||
let _ = app.scene_longest();
|
||||
let _ = app.scene();
|
||||
let _ = app.scene_mut();
|
||||
let _ = app.scene_add(None, None)?;
|
||||
let _ = app.scene_add_focus()?;
|
||||
let scene = app.scene_del(0);
|
||||
let _ = app.update_clock();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)] #[test] fn test_track () -> Usually<()> {
|
||||
let track = Track::default();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)] #[test] fn test_scene () -> Usually<()> {
|
||||
let scene = Scene::default();
|
||||
let _ = scene.pulses();
|
||||
let _ = scene.is_playing(&[]);
|
||||
let _ = app.view_transport();
|
||||
let _ = app.view_status();
|
||||
let _ = app.update_clock();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
@ -27,8 +25,8 @@ use crate::*;
|
|||
let _ = button_2("", "", false);
|
||||
let _ = button_3("", "", "", true);
|
||||
let _ = button_3("", "", "", false);
|
||||
let _ = heading("", "", 0, "", true);
|
||||
let _ = heading("", "", 0, "", false);
|
||||
//let _ = heading("", "", 0, "", true);
|
||||
//let _ = heading("", "", 0, "", false);
|
||||
let _ = wrap(Reset, Reset, "");
|
||||
}
|
||||
|
||||
|
|
@ -56,29 +54,29 @@ use crate::*;
|
|||
|
||||
#[cfg(test)] #[test] fn test_view_iter () {
|
||||
let mut app = App::default();
|
||||
app.editor = Some(Default::default());
|
||||
let _: Vec<_> = app.inputs_with_sizes().collect();
|
||||
let _: Vec<_> = app.outputs_with_sizes().collect();
|
||||
let _: Vec<_> = app.tracks_with_sizes().collect();
|
||||
let _: Vec<_> = app.scenes_with_sizes(true, 10, 10).collect();
|
||||
app.project.editor = Some(Default::default());
|
||||
//let _: Vec<_> = app.project.inputs_with_sizes().collect();
|
||||
//let _: Vec<_> = app.project.outputs_with_sizes().collect();
|
||||
let _: Vec<_> = app.project.tracks_with_sizes().collect();
|
||||
//let _: Vec<_> = app.project.scenes_with_sizes(true, 10, 10).collect();
|
||||
//let _: Vec<_> = app.scenes_with_colors(true, 10).collect();
|
||||
//let _: Vec<_> = app.scenes_with_track_colors(true, 10, 10).collect();
|
||||
}
|
||||
|
||||
#[cfg(test)] #[test] fn test_view_sizes () {
|
||||
let app = App::default();
|
||||
let _ = app.w();
|
||||
let _ = app.w_sidebar();
|
||||
let _ = app.w_tracks_area();
|
||||
let _ = app.h();
|
||||
let _ = app.h_tracks_area();
|
||||
let _ = app.h_inputs();
|
||||
let _ = app.h_outputs();
|
||||
let _ = app.h_scenes();
|
||||
let _ = app.project.w();
|
||||
//let _ = app.project.w_sidebar();
|
||||
//let _ = app.project.w_tracks_area();
|
||||
let _ = app.project.h();
|
||||
//let _ = app.project.h_tracks_area();
|
||||
//let _ = app.project.h_inputs();
|
||||
//let _ = app.project.h_outputs();
|
||||
let _ = app.project.h_scenes();
|
||||
}
|
||||
|
||||
#[cfg(test)] #[test] fn test_midi_edit () {
|
||||
let editor = MidiEditor::default();
|
||||
let _editor = MidiEditor::default();
|
||||
let mut editor = MidiEditor {
|
||||
mode: PianoHorizontal::new(Some(&Arc::new(RwLock::new(MidiClip::stop_all())))),
|
||||
size: Default::default(),
|
||||
|
|
@ -89,12 +87,13 @@ use crate::*;
|
|||
let _ = editor.clip_status();
|
||||
let _ = editor.edit_status();
|
||||
struct TestEditorHost(Option<MidiEditor>);
|
||||
has_editor!(|self: TestEditorHost|{
|
||||
editor = self.0;
|
||||
editor_w = 0;
|
||||
editor_h = 0;
|
||||
is_editing = false;
|
||||
});
|
||||
has!(Option<MidiEditor>: |self: TestEditorHost|self.0);
|
||||
//has_editor!(|self: TestEditorHost|{
|
||||
//editor = self.0;
|
||||
//editor_w = 0;
|
||||
//editor_h = 0;
|
||||
//is_editing = false;
|
||||
//});
|
||||
let mut host = TestEditorHost(Some(editor));
|
||||
let _ = host.editor();
|
||||
let _ = host.editor_mut();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue