mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-08-28 21:06:56 +02:00
parent
e50c4a5eef
commit
e6984915e4
22 changed files with 1002 additions and 294 deletions
|
|
@ -163,17 +163,17 @@ pub(self) fn toggle_bool <U> (
|
|||
}
|
||||
}
|
||||
|
||||
//pub fn per_track <'a, T: Draw<Tui> + 'a, U: TracksSizes<'a>> (
|
||||
//pub fn per_track <'a, T: Draw<'_, Tui> + 'a, U: TracksSizes<'a>> (
|
||||
//tracks: impl Fn() -> U + Send + Sync + 'a,
|
||||
//callback: impl Fn(usize, &'a Track)->T + Send + Sync + 'a
|
||||
//) -> impl Draw<Tui> + 'a {
|
||||
//) -> impl Draw<'_, Tui> + 'a {
|
||||
//per_track_top(tracks, move|index, track|callback(index, track).full_h().align_y())
|
||||
//}
|
||||
|
||||
//pub fn per_track_top <'a, T: Draw<Tui> + 'a, U: TracksSizes<'a>> (
|
||||
//pub fn per_track_top <'a, T: Draw<'_, Tui> + 'a, U: TracksSizes<'a>> (
|
||||
//tracks: impl Fn() -> U + Send + Sync + 'a,
|
||||
//callback: impl Fn(usize, &'a Track)->T + Send + Sync + 'a
|
||||
//) -> impl Draw<Tui> + 'a {
|
||||
//) -> impl Draw<'_, Tui> + 'a {
|
||||
//bg(Reset, iter_east(||tracks()
|
||||
//.map(move|(index, track, x1, x2): (usize, &'a Track, usize, usize)|{
|
||||
//fg_bg(
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ impl<T: TracksView + ScenesView + Send + Sync> ClipsView for T {}
|
|||
|
||||
pub trait ClipsView: TracksView + ScenesView {
|
||||
/// Draw clips per scene
|
||||
fn view_scenes_clips (&self) -> impl Draw<Tui> {
|
||||
fn view_scenes_clips (&self) -> impl Draw<'_, Tui> {
|
||||
let select = self.selection();
|
||||
let editor = self.editor();
|
||||
let size = self.clips_size();
|
||||
|
|
|
|||
|
|
@ -5,24 +5,24 @@ impl_has!(Vec<MidiOutput>: |self: Arrangement| self.midi_outs);
|
|||
impl_has!(Vec<MidiInput>: |self: App|self.project.midi_ins);
|
||||
impl_has!(Vec<MidiOutput>: |self: App|self.project.midi_outs);
|
||||
|
||||
pub fn view_midi_ins_status (theme: ItemTheme, track: Option<&Track>) -> impl Draw<Tui> {
|
||||
pub fn view_midi_ins_status (theme: ItemTheme, track: Option<&Track>) -> impl Draw<'_, Tui> {
|
||||
track.map(move|track|view_ports_status(theme, "MIDI ins: ", &track.sequencer.midi_ins))
|
||||
}
|
||||
|
||||
pub fn view_midi_outs_status (theme: ItemTheme, track: Option<&Track>) -> impl Draw<Tui> {
|
||||
pub fn view_midi_outs_status (theme: ItemTheme, track: Option<&Track>) -> impl Draw<'_, Tui> {
|
||||
track.map(move|track|view_ports_status(theme, "MIDI outs: ", &track.sequencer.midi_outs))
|
||||
}
|
||||
|
||||
pub fn view_audio_ins_status (theme: ItemTheme, track: Option<&Track>) -> impl Draw<Tui> {
|
||||
pub fn view_audio_ins_status (theme: ItemTheme, track: Option<&Track>) -> impl Draw<'_, Tui> {
|
||||
track.map(move|track|view_ports_status(theme, "Audio ins: ", &track.audio_ins()))
|
||||
}
|
||||
|
||||
pub fn view_audio_outs_status (theme: ItemTheme, track: Option<&Track>) -> impl Draw<Tui> {
|
||||
pub fn view_audio_outs_status (theme: ItemTheme, track: Option<&Track>) -> impl Draw<'_, Tui> {
|
||||
track.map(move|track|view_ports_status(theme, "Audio outs:", &track.audio_outs()))
|
||||
}
|
||||
|
||||
pub fn view_ports_status <'a, T: JackPort> (theme: ItemTheme, title: &'a str, ports: &'a [T])
|
||||
-> impl Draw<Tui> + use<'a, T>
|
||||
-> impl Draw<'a, Tui> + use<'a, T>
|
||||
{
|
||||
let ins = ports.len() as u16;
|
||||
let frame = Outer(true, Style::default().fg(g(96)));
|
||||
|
|
@ -35,7 +35,7 @@ pub fn view_ports_status <'a, T: JackPort> (theme: ItemTheme, title: &'a str, po
|
|||
|
||||
pub fn view_io_ports <'a, T: PortsSizes<'a>> (
|
||||
fg: Color, bg: Color, items: impl Fn()->T + Send + Sync + 'a
|
||||
) -> impl Draw<Tui> + 'a {
|
||||
) -> impl Draw<'a, Tui> + 'a {
|
||||
type Item<'a> = (usize, &'a Arc<str>, &'a [Connect], usize, usize);
|
||||
iter(items,
|
||||
move|(_index, name, connections, y, y2): Item<'a>, _| south(
|
||||
|
|
@ -49,7 +49,7 @@ pub fn view_io_ports <'a, T: PortsSizes<'a>> (
|
|||
pub struct Junction<T: JackPort>(T);
|
||||
|
||||
impl<T: JackPort> View<Tui> for Junction<T> {
|
||||
fn view (&self) -> impl Draw<Tui> {
|
||||
fn view (&self) -> impl Draw<'_, Tui> {
|
||||
T::KIND
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ pub trait ScenesView: HasEditor + HasSelection + HasSceneScroll + HasClipsSize +
|
|||
fn w_side (&self) -> u16;
|
||||
fn w_mid (&self) -> u16;
|
||||
|
||||
fn view_scenes_names (&self) -> impl Draw<Tui> {
|
||||
fn view_scenes_names (&self) -> impl Draw<'_, Tui> {
|
||||
let select = self.selection();
|
||||
let editor = self.editor();
|
||||
let editing = self.is_editing();
|
||||
|
|
@ -275,13 +275,13 @@ impl HasSceneScroll for App {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn view_scene_name (
|
||||
pub fn view_scene_name <'a> (
|
||||
select: &Selection,
|
||||
editor: Option<&MidiEditor>,
|
||||
editor: Option<&'a MidiEditor>,
|
||||
index: usize,
|
||||
scene: &Scene,
|
||||
editing: bool
|
||||
) -> impl Draw<Tui> {
|
||||
) -> impl Draw<'a, Tui> {
|
||||
let h = if select.scene() == Some(index) && let Some(_editor) = editor {
|
||||
7
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -46,10 +46,10 @@ impl Track {
|
|||
pub fn audio_outs (&self) -> &[AudioOutput] {
|
||||
self.devices.last().map(|x|x.audio_outs()).unwrap_or_default()
|
||||
}
|
||||
pub fn per <'a, T: Draw<Tui> + 'a, U: TracksSizes<'a>> (
|
||||
pub fn per <'a, T: Draw<'a, Tui> + 'a, U: TracksSizes<'a>> (
|
||||
tracks: impl Fn() -> U + Send + Sync + 'a,
|
||||
callback: &'a (impl Fn(usize, &'a Track)->T + Send + Sync + 'a)
|
||||
) -> impl Draw<Tui> + 'a {
|
||||
) -> impl Draw<'a, Tui> {
|
||||
iter_east(move||tracks().map(|(index, track, x1, x2): (usize, &Track, usize, usize)|{
|
||||
fg_bg(
|
||||
track.color.lightest.term,
|
||||
|
|
@ -343,7 +343,7 @@ pub trait TracksView: HasTracks + ScenesView + HasMidiIns + HasMidiOuts + HasTra
|
|||
}
|
||||
|
||||
/// Draw name of each track
|
||||
fn view_track_names (&self, theme: ItemTheme) -> impl Draw<Tui> {
|
||||
fn view_track_names (&self, theme: ItemTheme) -> impl Draw<'_, Tui> {
|
||||
let selected = self.selection();
|
||||
east(
|
||||
south(
|
||||
|
|
@ -396,7 +396,7 @@ pub trait TracksView: HasTracks + ScenesView + HasMidiIns + HasMidiOuts + HasTra
|
|||
}
|
||||
|
||||
/// Draw outputs per track
|
||||
fn view_track_outputs <'a> (&'a self, theme: ItemTheme, _h: u16) -> impl Draw<Tui> {
|
||||
fn view_track_outputs <'a> (&'a self, theme: ItemTheme, _h: u16) -> impl Draw<'_, Tui> {
|
||||
view_track_row_section(theme,
|
||||
south(button_2("o", "utput", false).align_w().full_w(),
|
||||
draw(|to: &mut Tui|{
|
||||
|
|
@ -431,7 +431,7 @@ pub trait TracksView: HasTracks + ScenesView + HasMidiIns + HasMidiOuts + HasTra
|
|||
}
|
||||
|
||||
/// Draw inputs per track
|
||||
fn view_track_inputs <'a> (&'a self, theme: ItemTheme) -> impl Draw<Tui> {
|
||||
fn view_track_inputs <'a> (&'a self, theme: ItemTheme) -> impl Draw<'_, Tui> {
|
||||
let mut height = 0u16;
|
||||
for track in self.tracks().iter() {
|
||||
height = height.max(track.sequencer.midi_ins.len() as u16);
|
||||
|
|
@ -459,7 +459,7 @@ pub trait TracksView: HasTracks + ScenesView + HasMidiIns + HasMidiOuts + HasTra
|
|||
}).align_w()))
|
||||
}
|
||||
|
||||
fn view_track_devices (&self, theme: ItemTheme) -> impl Draw<Tui> {
|
||||
fn view_track_devices (&self, theme: ItemTheme) -> impl Draw<'_, Tui> {
|
||||
let height = self.tracks_devices_height();
|
||||
let btn1 = button_3("d", "evice", self.track().map(|t|t.devices.len()).unwrap_or(0), false);
|
||||
let btn2 = button_2("D", "+", false);
|
||||
|
|
@ -488,7 +488,7 @@ pub trait TracksView: HasTracks + ScenesView + HasMidiIns + HasMidiOuts + HasTra
|
|||
h as u16
|
||||
}
|
||||
|
||||
fn view_inputs (&self, _theme: ItemTheme) -> impl Draw<Tui> + '_ {
|
||||
fn view_inputs (&self, _theme: ItemTheme) -> impl Draw<'_, Tui> + '_ {
|
||||
let title_1 = button_3("i", "nput ", self.midi_ins().len(), false).align_w().exact_wh(20, 1);
|
||||
let title_2 = button_2("I", "+", false).exact_wh(4, 1);
|
||||
east(title_1, west(title_2, draw(move|to: &mut Tui|{
|
||||
|
|
@ -532,7 +532,7 @@ pub trait TracksView: HasTracks + ScenesView + HasMidiIns + HasMidiOuts + HasTra
|
|||
h as u16
|
||||
}
|
||||
|
||||
fn view_outputs (&self, theme: ItemTheme) -> impl Draw<Tui> {
|
||||
fn view_outputs (&self, theme: ItemTheme) -> impl Draw<'_, Tui> {
|
||||
let height = self.outputs_height();
|
||||
let list = south(
|
||||
button_3(
|
||||
|
|
@ -630,12 +630,12 @@ impl HasTrackScroll for App {
|
|||
}
|
||||
}
|
||||
|
||||
fn view_track_row_section (
|
||||
fn view_track_row_section <'a> (
|
||||
_theme: ItemTheme,
|
||||
button: impl Draw<Tui>,
|
||||
button_add: impl Draw<Tui>,
|
||||
content: impl Draw<Tui>,
|
||||
) -> impl Draw<Tui> {
|
||||
button: impl Draw<'a, Tui>,
|
||||
button_add: impl Draw<'a, Tui>,
|
||||
content: impl Draw<'a, Tui>,
|
||||
) -> impl Draw<'a, Tui> {
|
||||
west(
|
||||
button_add.align_nw().exact_w(4).full_h(),
|
||||
east(
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ impl Browse {
|
|||
unreachable!()
|
||||
})
|
||||
}
|
||||
//fn tui (&self) -> impl Draw<Tui> {
|
||||
//fn tui (&self) -> impl Draw<'_, Tui> {
|
||||
//iter_south_fixed(1, ||self.tui_entries(), |entry, _index|entry.origin_w().full_w())
|
||||
//}
|
||||
//fn tui_entries (&self) -> EntriesIterator<'_, Tui> {
|
||||
|
|
@ -133,7 +133,7 @@ impl Browse {
|
|||
}
|
||||
|
||||
//impl<'a> Iterator for EntriesIterator<'a, Tui> {
|
||||
//type Item = impl Draw<Tui>;
|
||||
//type Item = impl Draw<'_, Tui>;
|
||||
//fn next (&mut self) -> Option<Self::Item> {
|
||||
//let dirs = self.browser.dirs.len();
|
||||
//let files = self.browser.files.len();
|
||||
|
|
@ -179,7 +179,7 @@ pub fn scan (dir: &PathBuf) -> Usually<(Vec<OsString>, Vec<OsString>)> {
|
|||
Ok((subdirs, files))
|
||||
}
|
||||
|
||||
pub fn view_browse_title (state: &App) -> impl Draw<Tui> {
|
||||
pub fn view_browse_title (state: &App) -> impl Draw<'_, Tui> {
|
||||
field_v(ItemTheme::default(), match state.dialog.browser_target().unwrap() {
|
||||
BrowseTarget::SaveProject => "Save project:",
|
||||
BrowseTarget::LoadProject => "Load project:",
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ impl_time_unit!(LaunchSync);
|
|||
/// let _ = tek::view_transport(true, x.as_ref(), x.as_ref(), x.as_ref());
|
||||
/// let _ = tek::view_transport(false, x.as_ref(), x.as_ref(), x.as_ref());
|
||||
/// ```
|
||||
pub fn view_transport (play: bool, bpm: &str, beat: &str, time: &str) -> impl Draw<Tui> {
|
||||
pub fn view_transport <'a> (play: bool, bpm: &str, beat: &str, time: &str) -> impl Draw<'a, Tui> {
|
||||
let theme = ItemTheme::G[96];
|
||||
bg(Black, east!(above(
|
||||
button_play_pause(play, false).align_w(),
|
||||
|
|
@ -479,7 +479,7 @@ pub fn view_transport (play: bool, bpm: &str, beat: &str, time: &str) -> impl Dr
|
|||
/// let _ = tek::view_status(None, x.as_ref(), x.as_ref(), x.as_ref());
|
||||
/// let _ = tek::view_status(Some("".into()), x.as_ref(), x.as_ref(), x.as_ref());
|
||||
/// ```
|
||||
pub fn view_status (sel: Option<&str>, sr: &str, buf: &str, lat: &str) -> impl Draw<Tui> {
|
||||
pub fn view_status <'a> (sel: Option<&str>, sr: &str, buf: &str, lat: &str) -> impl Draw<'a, Tui> {
|
||||
let theme = ItemTheme::G[96];
|
||||
let sr = field_h(theme, "SR", sr);
|
||||
let buf = field_h(theme, "Buf", buf);
|
||||
|
|
@ -496,7 +496,7 @@ pub fn view_status (sel: Option<&str>, sr: &str, buf: &str, lat: &str) -> impl D
|
|||
/// let _ = tek::button_play_pause(false, true);
|
||||
/// let _ = tek::button_play_pause(false, false);
|
||||
/// ```
|
||||
pub fn button_play_pause (playing: bool, compact: bool) -> impl Draw<Tui> {
|
||||
pub fn button_play_pause <'a> (playing: bool, compact: bool) -> impl Draw<'a, Tui> {
|
||||
bg(if playing { Rgb(0, 128, 0) } else { Rgb(128, 64, 0) },
|
||||
either(compact,
|
||||
draw(move|to: &mut Tui|either(playing,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use crate::{*, device::*};
|
||||
|
||||
pub fn draw_dialog (
|
||||
to: &mut Tui, mut frags: std::str::Split<&str>, state: &App, dsl: &impl Expression
|
||||
) -> Drawn<u16> {
|
||||
pub fn draw_dialog <'a, L: Language + ?Sized> (
|
||||
to: &mut Tui, mut frags: std::str::Split<&str>, state: &App, dsl: &'a L
|
||||
) -> Drawn<'a, u16> {
|
||||
match frags.next() {
|
||||
Some("menu") => if let Dialog::Menu(selected, items) = &state.dialog {
|
||||
//Some(iter_south(move||items.0.iter().enumerate().map(move|(index, MenuItem(item, _))|{
|
||||
|
|
@ -34,7 +34,7 @@ pub fn draw_dialog (
|
|||
|
||||
impl App {
|
||||
|
||||
pub fn get_dialog (&self, src: impl Language) -> Perhaps<Dialog> {
|
||||
pub fn get_dialog <'a> (&self, src: impl Language) -> Perhaps<Dialog> {
|
||||
src.word()?.map(|word|Ok(match word {
|
||||
":dialog/none" => Dialog::None,
|
||||
":dialog/options" => Dialog::Options,
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ impl MidiEditor {
|
|||
self.get_time_pos().overflowing_sub(1)
|
||||
.0.min(self.clip_length().saturating_sub(1))
|
||||
}
|
||||
pub fn clip_status (&self) -> impl Draw<Tui> + '_ {
|
||||
pub fn clip_status (&self) -> impl Draw<'_, Tui> + '_ {
|
||||
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) };
|
||||
|
|
@ -281,7 +281,7 @@ impl MidiEditor {
|
|||
.origin_w().full_w(),
|
||||
).exact_w(20)
|
||||
}
|
||||
pub fn edit_status (&self) -> impl Draw<Tui> + '_ {
|
||||
pub fn edit_status (&self) -> impl Draw<'_, Tui> + '_ {
|
||||
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) };
|
||||
|
|
@ -426,7 +426,7 @@ impl MidiViewer for MidiEditor {
|
|||
}
|
||||
|
||||
impl View<Tui> for MidiEditor {
|
||||
fn view (&self) -> impl Draw<Tui> {
|
||||
fn view (&self) -> impl Draw<'_, Tui> {
|
||||
self.autoscroll();
|
||||
/*self.autozoom();*/
|
||||
self.size.of(self.mode.view())
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ impl OctaveVertical {
|
|||
}
|
||||
|
||||
impl OctaveVertical {
|
||||
pub fn tui (&self) -> impl Draw<Tui> {
|
||||
pub fn tui (&self) -> impl Draw<'_, Tui> {
|
||||
east!(
|
||||
fg_bg(self.color(0), self.color(1), "▙"),
|
||||
fg_bg(self.color(2), self.color(3), "▙"),
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ pub struct PianoHorizontal {
|
|||
impl_has!(Sizer: |self: PianoHorizontal| self.size);
|
||||
|
||||
impl View<Tui> for PianoHorizontal {
|
||||
fn view (&self) -> impl Draw<Tui> {
|
||||
fn view (&self) -> impl Draw<'_, Tui> {
|
||||
south(
|
||||
east(
|
||||
format!("{}x{}", self.size.w(), self.size.h()).exact_w(5),
|
||||
|
|
@ -132,7 +132,7 @@ impl PianoHorizontal {
|
|||
}
|
||||
}
|
||||
|
||||
fn notes (&self) -> impl Draw<Tui> {
|
||||
fn notes (&self) -> impl Draw<'_, Tui> {
|
||||
let time_start = self.get_time_start();
|
||||
let note_lo = self.get_note_lo();
|
||||
let note_hi = self.get_note_hi();
|
||||
|
|
@ -168,7 +168,7 @@ impl PianoHorizontal {
|
|||
})
|
||||
}
|
||||
|
||||
fn cursor (&self) -> impl Draw<Tui> {
|
||||
fn cursor (&self) -> impl Draw<'_, Tui> {
|
||||
let note_hi = self.get_note_hi();
|
||||
let note_lo = self.get_note_lo();
|
||||
let note_pos = self.get_note_pos();
|
||||
|
|
@ -202,7 +202,7 @@ impl PianoHorizontal {
|
|||
})
|
||||
}
|
||||
|
||||
fn keys (&self) -> impl Draw<Tui> {
|
||||
fn keys (&self) -> impl Draw<'_, Tui> {
|
||||
let state = self;
|
||||
let color = state.color;
|
||||
let note_lo = state.get_note_lo();
|
||||
|
|
@ -229,7 +229,7 @@ impl PianoHorizontal {
|
|||
}).exact_w(self.keys_width).full_h()
|
||||
}
|
||||
|
||||
fn timeline (&self) -> impl Draw<Tui> + '_ {
|
||||
fn timeline (&self) -> impl Draw<'_, Tui> + '_ {
|
||||
draw(move|to: &mut Tui|{
|
||||
let xywh = to.area().into();
|
||||
let XYWH(x, y, w, _h) = xywh;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ impl_draw!(|self: Log10Meter, to: Tui| {
|
|||
Ok(Some(to.area().into()))
|
||||
});
|
||||
|
||||
fn draw_meters (meters: &[f32]) -> impl Draw<Tui> + use<'_> {
|
||||
fn draw_meters (meters: &[f32]) -> impl Draw<'_, Tui> + use<'_> {
|
||||
bg(Black, iter_east_fixed(1, ||meters.iter(), |value, _index|{
|
||||
RmsMeter(*value).full_h()
|
||||
}).exact_w(2))
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ impl ApplicationHandler for LV2PluginUI {
|
|||
}
|
||||
}
|
||||
|
||||
impl Draw<Tui> for Lv2 {
|
||||
impl Draw<'_, Tui> for Lv2 {
|
||||
fn draw (&self, to: &mut Tui) {
|
||||
let area = to.area();
|
||||
let XYWH(x, y, _, height) = area;
|
||||
|
|
|
|||
|
|
@ -439,7 +439,7 @@ impl Pool {
|
|||
}
|
||||
|
||||
impl<'a> PoolView<'a> {
|
||||
//fn tui (&self) -> impl Draw<Tui> {
|
||||
//fn tui (&self) -> impl Draw<'_, Tui> {
|
||||
//let Self(pool) = self;
|
||||
////let color = self.1.clip().map(|c|c.read().unwrap().color).unwrap_or_else(||g(32).into());
|
||||
////let on_bg = |x|x;//below(Repeat(" "), bg(color.darkest.term, x));
|
||||
|
|
@ -467,7 +467,7 @@ impl<'a> PoolView<'a> {
|
|||
}
|
||||
|
||||
impl ClipLength {
|
||||
//fn tui (&self) -> impl Draw<Tui> {
|
||||
//fn tui (&self) -> impl Draw<'_, Tui> {
|
||||
//use ClipLengthFocus::*;
|
||||
//let bars = format!("{}", self.bars());
|
||||
//let beats = format!("{}", self.beats());
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ fn draw_list_item (sample: &Option<Arc<RwLock<Sample>>>) -> String {
|
|||
}
|
||||
}
|
||||
|
||||
fn draw_viewer (sample: Option<&Arc<RwLock<Sample>>>) -> impl Draw<Tui> + use<'_> {
|
||||
fn draw_viewer (sample: Option<&Arc<RwLock<Sample>>>) -> impl Draw<'_, Tui> + use<'_> {
|
||||
let min_db = -64.0;
|
||||
draw(move|to: &mut Tui|{
|
||||
let xywh = to.area().into();
|
||||
|
|
@ -750,7 +750,7 @@ fn read_sample_data (_: &str) -> Usually<(usize, Vec<Vec<f32>>)> {
|
|||
todo!();
|
||||
}
|
||||
|
||||
pub fn view_sample_info (sample: Option<&Arc<RwLock<Sample>>>) -> impl Draw<Tui> + use<'_> {
|
||||
pub fn view_sample_info (sample: Option<&Arc<RwLock<Sample>>>) -> impl Draw<'_, Tui> + use<'_> {
|
||||
when(sample.is_some(), draw(move|to: &mut Tui|{
|
||||
let sample = sample.unwrap().read().unwrap();
|
||||
let theme = sample.color;
|
||||
|
|
@ -765,7 +765,7 @@ pub fn view_sample_info (sample: Option<&Arc<RwLock<Sample>>>) -> impl Draw<Tui>
|
|||
}))
|
||||
}
|
||||
|
||||
pub fn view_sample_info_v (sample: Option<&Arc<RwLock<Sample>>>) -> impl Draw<Tui> + use<'_> {
|
||||
pub fn view_sample_info_v (sample: Option<&Arc<RwLock<Sample>>>) -> impl Draw<'_, Tui> + use<'_> {
|
||||
let a = draw(move|to: &mut Tui|{
|
||||
let sample = sample.unwrap().read().unwrap();
|
||||
let theme = sample.color;
|
||||
|
|
@ -788,7 +788,7 @@ pub fn view_sample_info_v (sample: Option<&Arc<RwLock<Sample>>>) -> impl Draw<Tu
|
|||
either(sample.is_some(), a, b)
|
||||
}
|
||||
|
||||
pub fn view_sample_status (sample: Option<&Arc<RwLock<Sample>>>) -> impl Draw<Tui> {
|
||||
pub fn view_sample_status (sample: Option<&Arc<RwLock<Sample>>>) -> impl Draw<'_, Tui> {
|
||||
bold(true, fg(g(224), sample
|
||||
.map(|sample|{
|
||||
let sample = sample.read().unwrap();
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ pub trait HasPlayClip: HasClock {
|
|||
*self.reset_mut() = true;
|
||||
}
|
||||
|
||||
fn play_status (&self) -> impl Draw<Tui> {
|
||||
fn play_status (&self) -> impl Draw<'_, Tui> {
|
||||
let (name, color): (Arc<str>, ItemTheme) = if let Some((_, Some(clip))) = self.play_clip() {
|
||||
let MidiClip { ref name, color, .. } = *clip.read().unwrap();
|
||||
(name.clone(), color)
|
||||
|
|
@ -130,7 +130,7 @@ pub trait HasPlayClip: HasClock {
|
|||
.into()
|
||||
}
|
||||
|
||||
fn next_status (&self) -> impl Draw<Tui> {
|
||||
fn next_status (&self) -> impl Draw<'_, Tui> {
|
||||
let mut time: Arc<str> = String::from("--.-.--").into();
|
||||
let mut name: Arc<str> = String::from("").into();
|
||||
let mut color = ItemTheme::G[64];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue