mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 03:36:41 +01:00
chore: fix 30-40 warnings
This commit is contained in:
parent
4604ad66a2
commit
cac3fe044e
13 changed files with 36 additions and 44 deletions
|
|
@ -336,7 +336,7 @@ pub(crate) fn io_ports <'a, T: PortsSizes<'a>> (
|
|||
fg: Color, bg: Color, iter: impl Fn()->T + Send + Sync + 'a
|
||||
) -> impl Content<TuiOut> + 'a {
|
||||
Map::new(iter, move|(
|
||||
index, name, connections, y, y2
|
||||
_index, name, connections, y, y2
|
||||
): (usize, &'a Arc<str>, &'a [Connect], usize, usize), _|
|
||||
map_south(y as u16, (y2-y) as u16, Bsp::s(
|
||||
Fill::x(Tui::bold(true, Tui::fg_bg(fg, bg, Align::w(Bsp::e(" ", name))))),
|
||||
|
|
@ -349,11 +349,11 @@ pub(crate) fn io_conns <'a, T: PortsSizes<'a>> (
|
|||
fg: Color, bg: Color, iter: impl Fn()->T + Send + Sync + 'a
|
||||
) -> impl Content<TuiOut> + 'a {
|
||||
Map::new(iter, move|(
|
||||
index, name, connections, y, y2
|
||||
_index, _name, connections, y, y2
|
||||
): (usize, &'a Arc<str>, &'a [Connect], usize, usize), _|
|
||||
map_south(y as u16, (y2-y) as u16, Bsp::s(
|
||||
Fill::x(Tui::bold(true, wrap(bg, fg, Fill::x(Align::w("▞▞▞▞ ▞▞▞▞"))))),
|
||||
Map::new(||connections.iter(), move|connect, index|map_south(index as u16, 1,
|
||||
Map::new(||connections.iter(), move|_conn, index|map_south(index as u16, 1,
|
||||
Fill::x(Align::w(Tui::bold(false, wrap(bg, fg, Fill::x(""))))))))))
|
||||
}
|
||||
//track_scroll: Fill::x(Fixed::y(1, ScrollbarH {
|
||||
|
|
|
|||
|
|
@ -1,18 +1,13 @@
|
|||
use crate::*;
|
||||
|
||||
impl Arrangement {
|
||||
pub fn view_inputs <'a> (&'a self, theme: ItemTheme) -> impl Content<TuiOut> + 'a {
|
||||
let mut h = 1u16;
|
||||
for track in self.tracks().iter() {
|
||||
h = h.max(self.midi_ins.len() as u16);
|
||||
}
|
||||
let h = h + 1;
|
||||
pub fn view_inputs <'a> (&'a self, _theme: ItemTheme) -> impl Content<TuiOut> + 'a {
|
||||
Stack::south(move|add: &mut dyn FnMut(&dyn Render<TuiOut>)|{
|
||||
add(&Fixed::y(1,
|
||||
Bsp::e(Fixed::x(20, Align::w(button_3("i", "nput ", format!("{}", self.midi_ins.len()), false))),
|
||||
Bsp::w(Fixed::x(4, button_2("I", "+", false)),
|
||||
Stack::east(move|add: &mut dyn FnMut(&dyn Render<TuiOut>)|{
|
||||
for (index, track, x1, x2) in self.tracks_with_sizes() {
|
||||
for (_index, track, _x1, _x2) in self.tracks_with_sizes() {
|
||||
add(&Tui::bg(track.color.dark.rgb, Align::w(Fixed::x(track.width as u16, row!(
|
||||
Either(track.sequencer.monitoring, Tui::fg(Green, "mon "), "mon "),
|
||||
Either(track.sequencer.recording, Tui::fg(Red, "rec "), "rec "),
|
||||
|
|
@ -20,13 +15,13 @@ impl Arrangement {
|
|||
)))))
|
||||
}
|
||||
})))));
|
||||
for (index, port) in self.midi_ins().iter().enumerate() {
|
||||
for (_index, port) in self.midi_ins().iter().enumerate() {
|
||||
add(&Fixed::y(1, Bsp::e(
|
||||
Fixed::x(20, Align::w(Bsp::e(" ● ",
|
||||
Tui::bold(true, Tui::fg(Rgb(255,255,255), port.port_name()))))),
|
||||
Bsp::w(Fixed::x(4, ()),
|
||||
Stack::east(move|add: &mut dyn FnMut(&dyn Render<TuiOut>)|{
|
||||
for (index, track, x1, x2) in self.tracks_with_sizes() {
|
||||
for (_index, track, _x1, _x2) in self.tracks_with_sizes() {
|
||||
add(&Tui::bg(track.color.darker.rgb, Align::w(Fixed::x(track.width as u16, row!(
|
||||
Either(track.sequencer.monitoring, Tui::fg(Green, " ● "), " · "),
|
||||
Either(track.sequencer.recording, Tui::fg(Red, " ● "), " · "),
|
||||
|
|
@ -46,7 +41,7 @@ impl Arrangement {
|
|||
let list = Bsp::s(
|
||||
Fixed::y(1, Fill::x(Align::w(button_3("o", "utput", format!("{}", self.midi_outs.len()), false)))),
|
||||
Fixed::y(h - 1, Fill::xy(Align::nw(Stack::south(|add: &mut dyn FnMut(&dyn Render<TuiOut>)|{
|
||||
for (index, port) in self.midi_outs().iter().enumerate() {
|
||||
for (_index, port) in self.midi_outs().iter().enumerate() {
|
||||
add(&Fixed::y(1,Fill::x(Bsp::e(
|
||||
Align::w(Bsp::e(" ● ", Tui::fg(Rgb(255,255,255),Tui::bold(true, port.port_name())))),
|
||||
Fill::x(Align::e(format!("{}/{} ",
|
||||
|
|
@ -60,20 +55,19 @@ impl Arrangement {
|
|||
Fixed::y(h, self.view_track_row_section(theme, list, button_2("O", "+", false),
|
||||
Tui::bg(theme.darker.rgb, Align::w(Fill::x(
|
||||
Stack::east(move|add: &mut dyn FnMut(&dyn Render<TuiOut>)|{
|
||||
for (index, track, x1, x2) in self.tracks_with_sizes() {
|
||||
for (index, track, _x1, _x2) in self.tracks_with_sizes() {
|
||||
add(&Fixed::x(self.track_width(index, track),
|
||||
Stack::south(move|add: &mut dyn FnMut(&dyn Render<TuiOut>)|{
|
||||
let index = 0;
|
||||
add(&Fixed::y(1, Align::w(Bsp::e(
|
||||
Either(true, Tui::fg(Green, "play "), "play "),
|
||||
Either(false, Tui::fg(Yellow, "solo "), "solo "),
|
||||
))));
|
||||
for (index, port) in self.midi_outs().iter().enumerate() {
|
||||
for (_index, port) in self.midi_outs().iter().enumerate() {
|
||||
add(&Fixed::y(1, Align::w(Bsp::e(
|
||||
Either(true, Tui::fg(Green, " ● "), " · "),
|
||||
Either(false, Tui::fg(Yellow, " ● "), " · "),
|
||||
))));
|
||||
for (index, conn) in port.connections.iter().enumerate() {
|
||||
for (_index, _conn) in port.connections.iter().enumerate() {
|
||||
add(&Fixed::y(1, Fill::x("")));
|
||||
}
|
||||
}})))}}))))))
|
||||
|
|
@ -88,10 +82,10 @@ impl Arrangement {
|
|||
button_3("d", "evice", format!("{}", self.track().map(|t|t.devices.len()).unwrap_or(0)), false),
|
||||
button_2("D", "+", false),
|
||||
Stack::east(move|add: &mut dyn FnMut(&dyn Render<TuiOut>)|{
|
||||
for (index, track, x1, x2) in self.tracks_with_sizes() {
|
||||
for (index, track, _x1, _x2) in self.tracks_with_sizes() {
|
||||
add(&Fixed::xy(self.track_width(index, track), h + 1,
|
||||
Tui::bg(track.color.dark.rgb, Align::nw(Map::south(2, move||0..h,
|
||||
|_, index|Fixed::xy(track.width as u16, 2,
|
||||
|_, _index|Fixed::xy(track.width as u16, 2,
|
||||
Tui::fg_bg(
|
||||
ItemTheme::G[32].lightest.rgb,
|
||||
ItemTheme::G[32].dark.rgb,
|
||||
|
|
@ -127,8 +121,8 @@ pub trait TracksView:
|
|||
}
|
||||
/// Iterate over tracks with their corresponding sizes.
|
||||
fn tracks_with_sizes (&self) -> impl TracksSizes<'_> {
|
||||
let editor_width = self.editor().map(|e|e.width());
|
||||
let active_track = self.selection().track();
|
||||
let _editor_width = self.editor().map(|e|e.width());
|
||||
let _active_track = self.selection().track();
|
||||
let mut x = 0;
|
||||
self.tracks().iter().enumerate().map_while(move |(index, track)|{
|
||||
let width = track.width.max(8);
|
||||
|
|
@ -143,7 +137,7 @@ pub trait TracksView:
|
|||
}
|
||||
fn view_track_row_section <'a> (
|
||||
&'a self,
|
||||
theme: ItemTheme,
|
||||
_theme: ItemTheme,
|
||||
button: impl Content<TuiOut>,
|
||||
button_add: impl Content<TuiOut>,
|
||||
content: impl Content<TuiOut>
|
||||
|
|
@ -177,7 +171,7 @@ pub trait TracksView:
|
|||
),
|
||||
Tui::bg(theme.darker.rgb, Fixed::y(2, Fill::x(
|
||||
Stack::east(move|add: &mut dyn FnMut(&dyn Render<TuiOut>)|{
|
||||
for (index, track, x1, x2) in self.tracks_with_sizes() {
|
||||
for (index, track, _x1, _x2) in self.tracks_with_sizes() {
|
||||
add(&Fixed::x(self.track_width(index, track),
|
||||
Tui::bg(if self.selection().track() == Some(index) {
|
||||
track.color.light.rgb
|
||||
|
|
@ -190,7 +184,7 @@ pub trait TracksView:
|
|||
}
|
||||
})))))
|
||||
}
|
||||
fn view_track_outputs <'a> (&'a self, theme: ItemTheme, h: u16) -> impl Content<TuiOut> {
|
||||
fn view_track_outputs <'a> (&'a self, theme: ItemTheme, _h: u16) -> impl Content<TuiOut> {
|
||||
self.view_track_row_section(theme,
|
||||
Bsp::s(
|
||||
Fill::x(Align::w(button_2("o", "utput", false))),
|
||||
|
|
@ -202,7 +196,7 @@ pub trait TracksView:
|
|||
button_2("O", "+", false),
|
||||
Tui::bg(theme.darker.rgb, Align::w(Fill::x(
|
||||
Stack::east(move|add: &mut dyn FnMut(&dyn Render<TuiOut>)|{
|
||||
for (index, track, x1, x2) in self.tracks_with_sizes() {
|
||||
for (index, track, _x1, _x2) in self.tracks_with_sizes() {
|
||||
add(&Fixed::x(self.track_width(index, track),
|
||||
Align::nw(Fill::y(Map::south(1, ||track.sequencer.midi_outs.iter(),
|
||||
|port, index|Tui::fg(Rgb(255, 255, 255),
|
||||
|
|
@ -222,7 +216,7 @@ pub trait TracksView:
|
|||
button_2("I", "+", false),
|
||||
Tui::bg(theme.darker.rgb, Align::w(Fill::x(
|
||||
Stack::east(move|add: &mut dyn FnMut(&dyn Render<TuiOut>)|{
|
||||
for (index, track, x1, x2) in self.tracks_with_sizes() {
|
||||
for (index, track, _x1, _x2) in self.tracks_with_sizes() {
|
||||
add(&Fixed::xy(self.track_width(index, track), h + 1,
|
||||
Align::nw(Bsp::s(
|
||||
Tui::bg(track.color.base.rgb,
|
||||
|
|
@ -281,7 +275,7 @@ pub trait ScenesView:
|
|||
}))
|
||||
}
|
||||
fn view_scene_name (&self, index: usize, scene: &Scene) -> impl Content<TuiOut> {
|
||||
let h = if self.selection().scene() == Some(index) && let Some(editor) = self.editor() {
|
||||
let h = if self.selection().scene() == Some(index) && let Some(_editor) = self.editor() {
|
||||
7
|
||||
} else {
|
||||
Self::H_SCENE as u16
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
mod browser_api; pub use self::browser_api::*;
|
||||
mod browser_model; pub use self::browser_model::*;
|
||||
mod browser_view; pub use self::browser_view::*;
|
||||
mod browser_view; //pub use self::browser_view::*;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ content!(TuiOut: |self: Browser|Map::south(1, ||EntriesIterator {
|
|||
index: 0,
|
||||
length: self.dirs.len() + self.files.len(),
|
||||
browser: self,
|
||||
}, |entry, index|Fill::x(Align::w(entry))));
|
||||
}, |entry, _index|Fill::x(Align::w(entry))));
|
||||
|
||||
struct EntriesIterator<'a> {
|
||||
browser: &'a Browser,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ content!(TuiOut: |self: MidiEditor| {
|
|||
impl MidiEditor {
|
||||
|
||||
pub fn clip_status (&self) -> impl Content<TuiOut> + '_ {
|
||||
let (color, name, length, looped) = if let Some(clip) = self.clip().as_ref().map(|p|p.read().unwrap()) {
|
||||
let (_color, name, length, looped) = if let Some(clip) = self.clip().as_ref().map(|p|p.read().unwrap()) {
|
||||
(clip.color, clip.name.clone(), clip.length, clip.looped)
|
||||
} else { (ItemTheme::G[64], String::new().into(), 0, false) };
|
||||
Fixed::x(20, col!(
|
||||
|
|
@ -26,7 +26,7 @@ impl MidiEditor {
|
|||
}
|
||||
|
||||
pub fn edit_status (&self) -> impl Content<TuiOut> + '_ {
|
||||
let (color, length) = if let Some(clip) = self.clip().as_ref().map(|p|p.read().unwrap()) {
|
||||
let (_color, length) = if let Some(clip) = self.clip().as_ref().map(|p|p.read().unwrap()) {
|
||||
(clip.color, clip.length)
|
||||
} else { (ItemTheme::G[64], 0) };
|
||||
let time_pos = self.get_time_pos();
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ pub(crate) use std::error::Error;
|
|||
pub(crate) use std::ffi::OsString;
|
||||
|
||||
pub(crate) use ::tengri::{from, has, maybe_has, Usually, Perhaps, Has, MaybeHas};
|
||||
pub(crate) use ::tengri::{dsl::*, input::*, output::{*, Margin}, tui::{*, ratatui::prelude::*}};
|
||||
pub(crate) use ::tengri::{dsl::*, input::*, output::*, tui::{*, ratatui::prelude::*}};
|
||||
pub(crate) use ::tek_engine::*;
|
||||
pub(crate) use ::tek_engine::midi::{u7, LiveEvent, MidiMessage};
|
||||
pub(crate) use ::tek_engine::jack::{Control, ProcessScope, MidiWriter, RawMidi};
|
||||
pub(crate) use ::tek_engine::jack::{Control, ProcessScope, RawMidi};
|
||||
pub(crate) use ratatui::{prelude::Rect, widgets::{Widget, canvas::{Canvas, Line}}};
|
||||
pub(crate) use Color::*;
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ pub struct Pool {
|
|||
//.flatten()));
|
||||
impl Default for Pool {
|
||||
fn default () -> Self {
|
||||
use PoolMode::*;
|
||||
//use PoolMode::*;
|
||||
Self {
|
||||
visible: true,
|
||||
clips: Arc::from(RwLock::from(vec![])),
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ content!(TuiOut: |self: PoolView<'a>| {
|
|||
//let color = self.1.clip().map(|c|c.read().unwrap().color).unwrap_or_else(||Tui::g(32).into());
|
||||
//let on_bg = |x|x;//Bsp::b(Repeat(" "), Tui::bg(color.darkest.rgb, x));
|
||||
//let border = |x|x;//Outer(Style::default().fg(color.dark.rgb).bg(color.darkest.rgb)).enclose(x);
|
||||
let height = pool.clips.read().unwrap().len() as u16;
|
||||
//let height = pool.clips.read().unwrap().len() as u16;
|
||||
Fixed::x(20, Fill::y(Align::n(Map::new(
|
||||
||pool.clips().clone().into_iter(),
|
||||
move|clip: Arc<RwLock<MidiClip>>, i: usize|{
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ pub trait HasMidiIns {
|
|||
.collect::<Vec<_>>()
|
||||
}
|
||||
fn midi_ins_with_sizes <'a> (&'a self) ->
|
||||
impl Iterator<Item=(usize, &Arc<str>, &[Connect], usize, usize)> + Send + Sync + 'a
|
||||
impl Iterator<Item=(usize, &'a Arc<str>, &'a [Connect], usize, usize)> + Send + Sync + 'a
|
||||
{
|
||||
let mut y = 0;
|
||||
self.midi_ins().iter().enumerate().map(move|(i, input)|{
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ pub trait HasMidiOuts {
|
|||
fn midi_outs (&self) -> &Vec<MidiOutput>;
|
||||
fn midi_outs_mut (&mut self) -> &mut Vec<MidiOutput>;
|
||||
fn midi_outs_with_sizes <'a> (&'a self) ->
|
||||
impl Iterator<Item=(usize, &Arc<str>, &[Connect], usize, usize)> + Send + Sync + 'a
|
||||
impl Iterator<Item=(usize, &'a Arc<str>, &'a [Connect], usize, usize)> + Send + Sync + 'a
|
||||
{
|
||||
let mut y = 0;
|
||||
self.midi_outs().iter().enumerate().map(move|(i, output)|{
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ impl Sampler {
|
|||
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 width = cells_x * cell_width;
|
||||
//let height = cells_y * cell_height;
|
||||
let cols = Map::east(
|
||||
cell_width,
|
||||
move||0..cells_x,
|
||||
|
|
@ -205,8 +205,8 @@ fn draw_viewer (sample: Option<&Arc<RwLock<Sample>>>) -> impl Content<TuiOut> +
|
|||
Canvas::default()
|
||||
.x_bounds([0.0, width as f64])
|
||||
.y_bounds([0.0, height as f64])
|
||||
.paint(|ctx| {
|
||||
let text = "press record to begin sampling";
|
||||
.paint(|_ctx| {
|
||||
//let text = "press record to begin sampling";
|
||||
//ctx.print(
|
||||
//(width - text.len() as u16) as f64 / 2.0,
|
||||
//height as f64 / 2.0,
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ pub(crate) use std::sync::{Arc, RwLock, atomic::{AtomicUsize, AtomicBool, Orderi
|
|||
pub(crate) use std::fmt::Debug;
|
||||
pub(crate) use std::ops::{Add, Sub, Mul, Div, Rem};
|
||||
|
||||
pub(crate) use ::tengri::{from, Usually, tui::*, dsl::*};
|
||||
pub(crate) use ::tengri::{from, Usually};
|
||||
|
||||
pub use ::atomic_float; pub(crate) use atomic_float::*;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
use crate::*;
|
||||
|
||||
pub use ::midly::{
|
||||
Smf,
|
||||
TrackEventKind,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue