mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-04-03 12:50:44 +02:00
wip: fix: 16e->425e...?
This commit is contained in:
parent
2fd5fbaaf9
commit
54ab1d8ba1
6 changed files with 26 additions and 22 deletions
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -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<Tui> + '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<str>, 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<Tui> {
|
||||
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<Tui> {
|
||||
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<Tui> + '_ {
|
||||
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<Tui> + '_ {
|
||||
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<Tui> {
|
||||
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,
|
||||
|
|
|
|||
|
|
@ -636,9 +636,9 @@ impl Clock {
|
|||
todo!()
|
||||
}
|
||||
}
|
||||
impl<T: HasClock> Command<T> for ClockCommand {
|
||||
fn execute (&self, state: &mut T) -> Perhaps<Self> {
|
||||
self.execute(state.clock_mut()) // awesome
|
||||
impl<T: HasClock> Act<T> for ClockCommand {
|
||||
fn act (&self, state: &mut T) -> Perhaps<Self> {
|
||||
self.act(state.clock_mut()) // awesome
|
||||
}
|
||||
}
|
||||
impl ClockView {
|
||||
|
|
|
|||
|
|
@ -1266,8 +1266,10 @@ impl MidiViewer for PianoHorizontal {
|
|||
fn clip (&self) -> &Option<Arc<RwLock<MidiClip>>> { &self.clip }
|
||||
fn clip_mut (&mut self) -> &mut Option<Arc<RwLock<MidiClip>>> { &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);
|
||||
|
|
|
|||
|
|
@ -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::{
|
||||
|
|
|
|||
2
tengri
2
tengri
|
|
@ -1 +1 @@
|
|||
Subproject commit cf57f44933c45507e8de072e32c284f20f12ac7a
|
||||
Subproject commit 30d378a6ee8a998b3c4437a4c2e83f56b370ac1d
|
||||
Loading…
Add table
Add a link
Reference in a new issue