mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
editor: 19x11 wat? but shows
This commit is contained in:
parent
4f3a50f2d6
commit
5ed69edd02
3 changed files with 9 additions and 21 deletions
|
|
@ -28,7 +28,9 @@ handle!(TuiIn: |self: App, input|Ok(if let Some(command) = self.config.keys.comm
|
||||||
let clip = &mut app.scenes_mut()[scene].clips[track];
|
let clip = &mut app.scenes_mut()[scene].clips[track];
|
||||||
if clip.is_none() {
|
if clip.is_none() {
|
||||||
//app.clip_auto_create();
|
//app.clip_auto_create();
|
||||||
*clip = Some(Default::default());
|
*clip = Some(Arc::new(RwLock::new(MidiClip::new(
|
||||||
|
"", false, 384, None, Some(ItemTheme::random())
|
||||||
|
))));
|
||||||
}
|
}
|
||||||
clip.as_ref().map(|c|c.into())
|
clip.as_ref().map(|c|c.into())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,9 +76,6 @@ impl App {
|
||||||
pub fn view_audio_outs_status (&self) -> impl Content<TuiOut> + use<'_> {
|
pub fn view_audio_outs_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
self.project.view_audio_outs_status(self.color)
|
self.project.view_audio_outs_status(self.color)
|
||||||
}
|
}
|
||||||
pub fn view_arranger (&self) -> impl Content<TuiOut> + use<'_> {
|
|
||||||
&self.project
|
|
||||||
}
|
|
||||||
pub fn view_arranger_scenes_names (&self) -> impl Content<TuiOut> + use<'_> {
|
pub fn view_arranger_scenes_names (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
self.project.view_scenes_names()
|
self.project.view_scenes_names()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,5 @@
|
||||||
use crate::*;
|
use crate::*;
|
||||||
|
|
||||||
impl Content<TuiOut> for Arrangement {
|
|
||||||
fn content (&self) -> impl Render<TuiOut> {
|
|
||||||
panic!();
|
|
||||||
let ins = |x|Bsp::n(self.view_inputs_0(), x);
|
|
||||||
let tracks = |x|Bsp::s(self.view_tracks_0(), x);
|
|
||||||
let devices = |x|Bsp::s(self.view_devices_0(), x);
|
|
||||||
let outs = |x|Bsp::s(self.view_outputs_0(), x);
|
|
||||||
let bg = |x|Tui::bg(Reset, x);
|
|
||||||
//let track_scroll = |x|Bsp::s(&self.track_scroll, x);
|
|
||||||
//let scene_scroll = |x|Bsp::e(&self.scene_scroll, x);
|
|
||||||
self.size.of(outs(tracks(devices(ins(bg(self.view_scenes_clips()))))))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<T> TracksView for T
|
impl<T> TracksView for T
|
||||||
where T: ScenesView + HasMidiIns + HasMidiOuts + HasSize<TuiOut> + HasTrackScroll + HasSelection + HasMidiIns + HasEditor {}
|
where T: ScenesView + HasMidiIns + HasMidiOuts + HasSize<TuiOut> + HasTrackScroll + HasSelection + HasMidiIns + HasEditor {}
|
||||||
|
|
||||||
|
|
@ -439,7 +425,7 @@ pub trait ClipsView: TracksView + ScenesView + Send + Sync {
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn view_track_clips <'a> (&'a self, track_index: usize, track: &Track) -> impl Content<TuiOut> {
|
fn view_track_clips <'a> (&'a self, track_index: usize, track: &'a Track) -> impl Content<TuiOut> + 'a {
|
||||||
Stack::south(move|cell: &mut dyn FnMut(&dyn Render<TuiOut>)|{
|
Stack::south(move|cell: &mut dyn FnMut(&dyn Render<TuiOut>)|{
|
||||||
for (scene_index, scene) in self.scenes().iter().enumerate().skip(self.scene_scroll()) {
|
for (scene_index, scene) in self.scenes().iter().enumerate().skip(self.scene_scroll()) {
|
||||||
let (name, theme) = if let Some(Some(clip)) = &scene.clips.get(track_index) {
|
let (name, theme) = if let Some(Some(clip)) = &scene.clips.get(track_index) {
|
||||||
|
|
@ -480,8 +466,11 @@ pub trait ClipsView: TracksView + ScenesView + Send + Sync {
|
||||||
} as u16,
|
} as u16,
|
||||||
Bsp::b(
|
Bsp::b(
|
||||||
Fill::xy(Outer(true, Style::default().fg(outline))),
|
Fill::xy(Outer(true, Style::default().fg(outline))),
|
||||||
Fill::xy(Align::nw(Tui::fg_bg(fg, bg, Align::nw(name.unwrap_or(" ---- ".into())))))
|
Fill::xy(Bsp::b(
|
||||||
)));
|
Fill::xy(Align::nw(Tui::fg_bg(fg, bg, Align::nw(name.unwrap_or(" ---- ".into()))))),
|
||||||
|
Fill::xy(When(self.selection().track() == Some(track_index)
|
||||||
|
&& self.selection().scene() == Some(scene_index)
|
||||||
|
&& self.is_editing(), self.editor())))))));
|
||||||
//let (name, theme) = if let Some(clip) = &scene.clips.get(track_index).flatten() {
|
//let (name, theme) = if let Some(clip) = &scene.clips.get(track_index).flatten() {
|
||||||
//let clip = clip.read().unwrap();
|
//let clip = clip.read().unwrap();
|
||||||
//(Some(clip.name.clone()), clip.color)
|
//(Some(clip.name.clone()), clip.color)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue