mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
big flat pt.13: fixed warnings, let's see what it has in store
This commit is contained in:
parent
e21ef1af94
commit
5bc3517dde
13 changed files with 68 additions and 45 deletions
|
|
@ -30,15 +30,16 @@ impl ArrangerCli {
|
|||
/// Run the arranger TUI from CLI arguments.
|
||||
fn run (&self) -> Usually<()> {
|
||||
let name = self.name.as_deref().unwrap_or("tek_arranger");
|
||||
Tui::run(JackConnection::new(name)?.activate_with(|jack|{
|
||||
let engine = Tui::new()?;
|
||||
let state = JackConnection::new(name)?.activate_with(|jack|{
|
||||
let mut app = ArrangerTui::try_from(jack)?;
|
||||
let jack = jack.read().unwrap();
|
||||
app.color = ItemPalette::random();
|
||||
add_tracks(&jack, &mut app, self)?;
|
||||
add_scenes(&mut app, self.scenes)?;
|
||||
Ok(app)
|
||||
})?)?;
|
||||
Ok(())
|
||||
})?;
|
||||
engine.run(&state)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ pub struct GrooveboxCli {
|
|||
impl GrooveboxCli {
|
||||
fn run (&self) -> Usually<()> {
|
||||
let name = self.name.as_deref().unwrap_or("tek_groovebox");
|
||||
Tui::run(JackConnection::new(name)?.activate_with(|jack|{
|
||||
let engine = Tui::new()?;
|
||||
let state = JackConnection::new(name)?.activate_with(|jack|{
|
||||
let app = tek::Groovebox::new(
|
||||
jack,
|
||||
&self.midi_from.as_slice(),
|
||||
|
|
@ -58,8 +59,8 @@ impl GrooveboxCli {
|
|||
})?
|
||||
}
|
||||
Ok(app)
|
||||
})?)?;
|
||||
Ok(())
|
||||
})?;
|
||||
engine.run(&state)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,9 @@ pub fn main () -> Usually<()> { SamplerCli::parse().run() }
|
|||
}
|
||||
impl SamplerCli {
|
||||
fn run (&self) -> Usually<()> {
|
||||
let name = self.name.as_deref().unwrap_or("tek_sampler");
|
||||
Tui::run(JackConnection::new(name)?.activate_with(|jack|{
|
||||
let name = self.name.as_deref().unwrap_or("tek_sampler");
|
||||
let engine = Tui::new()?;
|
||||
let state = JackConnection::new(name)?.activate_with(|jack|{
|
||||
Ok(tek::SamplerTui {
|
||||
cursor: (0, 0),
|
||||
editing: None,
|
||||
|
|
@ -41,7 +42,7 @@ impl SamplerCli {
|
|||
&[&self.l_to.as_slice(), &self.r_to.as_slice()],
|
||||
)?,
|
||||
})
|
||||
})?)?;
|
||||
Ok(())
|
||||
})?;
|
||||
engine.run(&state)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,9 @@ pub struct SequencerCli {
|
|||
|
||||
impl SequencerCli {
|
||||
fn run (&self) -> Usually<()> {
|
||||
let name = self.name.as_deref().unwrap_or("tek_sequencer");
|
||||
Tui::run(JackConnection::new(name)?.activate_with(|jack|{
|
||||
let name = self.name.as_deref().unwrap_or("tek_sequencer");
|
||||
let engine = Tui::new()?;
|
||||
let state = JackConnection::new(name)?.activate_with(|jack|{
|
||||
let mut app = SequencerTui::try_from(jack)?;
|
||||
let jack = jack.read().unwrap();
|
||||
let midi_in = jack.register_port("i", MidiIn::default())?;
|
||||
|
|
@ -35,8 +36,8 @@ impl SequencerCli {
|
|||
app.player.midi_ins.push(midi_in);
|
||||
app.player.midi_outs.push(midi_out);
|
||||
Ok(app)
|
||||
})?)?;
|
||||
Ok(())
|
||||
})?;
|
||||
engine.run(&state)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ include!("./lib.rs");
|
|||
|
||||
/// Application entrypoint.
|
||||
pub fn main () -> Usually<()> {
|
||||
let name = "tek_transport";
|
||||
Tui::run(JackConnection::new(name)?.activate_with(|jack|{
|
||||
TransportTui::try_from(jack)
|
||||
})?)?;
|
||||
Ok(())
|
||||
let name = "tek_transport";
|
||||
let engine = Tui::new()?;
|
||||
let state = JackConnection::new(name)?
|
||||
.activate_with(|jack|TransportTui::try_from(jack))?;
|
||||
engine.run(&state)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
#[allow(unused_imports)] use std::sync::Arc;
|
||||
#[allow(unused_imports)] use clap::{self, Parser};
|
||||
#[allow(unused_imports)] use tek::{*, jack::*};
|
||||
#[allow(unused_imports)] use tek::{
|
||||
*,
|
||||
jack::*,
|
||||
tek_layout::Measure,
|
||||
tek_engine::{Usually, tui::{Tui, TuiRun, ratatui::prelude::Color}}
|
||||
};
|
||||
|
||||
#[allow(unused)]
|
||||
fn connect_from (jack: &JackConnection, input: &Port<MidiIn>, ports: &[String]) -> Usually<()> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue