mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
phrases: autoshow, autoedit
This commit is contained in:
parent
02fa22e2ea
commit
2f904ed78b
4 changed files with 14 additions and 26 deletions
|
|
@ -160,6 +160,7 @@ impl<E: Engine> Arranger<E> {
|
|||
}
|
||||
self.show_phrase();
|
||||
self.focus(ArrangerFocus::PhraseEditor);
|
||||
self.editor.entered = true;
|
||||
}
|
||||
/// Rename the selected track, scene, or clip
|
||||
pub fn rename_selected (&mut self) {
|
||||
|
|
|
|||
|
|
@ -27,9 +27,10 @@ impl Arranger<Tui> {
|
|||
fn handle_focused (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match self.focused() {
|
||||
ArrangerFocus::Transport => self.transport.handle(from),
|
||||
ArrangerFocus::Arrangement => self.handle_arrangement(from),
|
||||
ArrangerFocus::PhrasePool => self.handle_pool(from),
|
||||
ArrangerFocus::PhraseEditor => self.editor.handle(from),
|
||||
ArrangerFocus::Arrangement => self.handle_arrangement(from)
|
||||
.and_then(|result|{self.show_phrase();Ok(result)}),
|
||||
}
|
||||
}
|
||||
/// Helper for phrase event passthru when phrase pool is focused
|
||||
|
|
|
|||
|
|
@ -134,8 +134,8 @@ impl<'a> Content for VerticalArranger<'a, Tui> {
|
|||
let scenes = state.scenes.as_ref();
|
||||
let bg = state.color;
|
||||
let clip_bg = Color::Rgb(40, 50, 30);
|
||||
let border_hi = Color::Rgb(100, 110, 40);
|
||||
let border_lo = Color::Rgb(70, 80, 50);
|
||||
//let border_hi = Color::Rgb(100, 110, 40);
|
||||
//let border_lo = Color::Rgb(70, 80, 50);
|
||||
//let border_bg = Color::Rgb(40, 50, 30);
|
||||
//let border_fg = if self.0.focused { border_hi } else { border_lo };
|
||||
//let border = Lozenge(Style::default().bg(border_bg).fg(border_fg));
|
||||
|
|
@ -334,9 +334,7 @@ impl<'a> Content for HorizontalArranger<'a, Tui> {
|
|||
focused.then_some(Background(Color::Rgb(40, 50, 30))),
|
||||
row!(
|
||||
// name
|
||||
CustomWidget::new(|_|{
|
||||
todo!()
|
||||
}, |_: &mut TuiOutput|{
|
||||
CustomWidget::new(|_|{todo!()}, |_: &mut TuiOutput|{
|
||||
todo!()
|
||||
//let Self(tracks, selected) = self;
|
||||
//let yellow = Some(Style::default().yellow().bold().not_dim());
|
||||
|
|
@ -360,9 +358,7 @@ impl<'a> Content for HorizontalArranger<'a, Tui> {
|
|||
//Ok(Some(area))
|
||||
}),
|
||||
// monitor
|
||||
CustomWidget::new(|_|{
|
||||
todo!()
|
||||
}, |_: &mut TuiOutput|{
|
||||
CustomWidget::new(|_|{todo!()}, |_: &mut TuiOutput|{
|
||||
todo!()
|
||||
//let Self(tracks) = self;
|
||||
//let mut area = to.area();
|
||||
|
|
@ -387,9 +383,7 @@ impl<'a> Content for HorizontalArranger<'a, Tui> {
|
|||
//Ok(Some(area))
|
||||
}),
|
||||
// record
|
||||
CustomWidget::new(|_|{
|
||||
todo!()
|
||||
}, |_: &mut TuiOutput|{
|
||||
CustomWidget::new(|_|{todo!()}, |_: &mut TuiOutput|{
|
||||
todo!()
|
||||
//let Self(tracks) = self;
|
||||
//let mut area = to.area();
|
||||
|
|
@ -414,9 +408,7 @@ impl<'a> Content for HorizontalArranger<'a, Tui> {
|
|||
//Ok(Some(area))
|
||||
}),
|
||||
// overdub
|
||||
CustomWidget::new(|_|{
|
||||
todo!()
|
||||
}, |_: &mut TuiOutput|{
|
||||
CustomWidget::new(|_|{todo!()}, |_: &mut TuiOutput|{
|
||||
todo!()
|
||||
//let Self(tracks) = self;
|
||||
//let mut area = to.area();
|
||||
|
|
@ -444,9 +436,7 @@ impl<'a> Content for HorizontalArranger<'a, Tui> {
|
|||
//Ok(Some(area))
|
||||
}),
|
||||
// erase
|
||||
CustomWidget::new(|_|{
|
||||
todo!()
|
||||
}, |_: &mut TuiOutput|{
|
||||
CustomWidget::new(|_|{todo!()}, |_: &mut TuiOutput|{
|
||||
todo!()
|
||||
//let Self(tracks) = self;
|
||||
//let mut area = to.area();
|
||||
|
|
@ -469,9 +459,7 @@ impl<'a> Content for HorizontalArranger<'a, Tui> {
|
|||
//Ok(Some(area))
|
||||
}),
|
||||
// gain
|
||||
CustomWidget::new(|_|{
|
||||
todo!()
|
||||
}, |_: &mut TuiOutput|{
|
||||
CustomWidget::new(|_|{todo!()}, |_: &mut TuiOutput|{
|
||||
todo!()
|
||||
//let Self(tracks) = self;
|
||||
//let mut area = to.area();
|
||||
|
|
@ -494,9 +482,7 @@ impl<'a> Content for HorizontalArranger<'a, Tui> {
|
|||
//Ok(Some(area))
|
||||
}),
|
||||
// scenes
|
||||
CustomWidget::new(|_|{
|
||||
todo!()
|
||||
}, |to: &mut TuiOutput|{
|
||||
CustomWidget::new(|_|{todo!()}, |to: &mut TuiOutput|{
|
||||
let Arrangement { scenes, selected, .. } = self.0;
|
||||
let area = to.area();
|
||||
let mut x2 = 0;
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ impl Content for PhraseEditor<Tui> {
|
|||
})
|
||||
}).fill_x();
|
||||
let cursor = CustomWidget::new(|to|Ok(Some(to)), move|to: &mut TuiOutput|{
|
||||
Ok(if *entered {
|
||||
Ok(if *focused && *entered {
|
||||
let area = to.area();
|
||||
if let (Some(time), Some(note)) = (time_point, note_point) {
|
||||
let x1 = area.x() + (time / time_scale) as u16;
|
||||
|
|
@ -104,7 +104,7 @@ impl Content for PhraseEditor<Tui> {
|
|||
let y = area.y() + note.saturating_sub(note_start) as u16 / 2;
|
||||
let c = if note % 2 == 0 { "▀" } else { "▄" };
|
||||
for x in x1..x2 {
|
||||
to.blit(&c, x, y, Some(Style::default().fg(color)));
|
||||
to.blit(&c, x, y, Some(Style::default().fg(Color::Rgb(0,255,0))));
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue