mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 13:16:44 +01:00
remove single-use horizontal arranger widgets
This commit is contained in:
parent
4be2df1347
commit
6f91eb085d
2 changed files with 226 additions and 276 deletions
|
|
@ -346,27 +346,6 @@ pub struct VerticalArrangerCursor<'a>(
|
||||||
pub struct HorizontalArranger<'a, E: Engine>(
|
pub struct HorizontalArranger<'a, E: Engine>(
|
||||||
pub &'a Arranger<E>
|
pub &'a Arranger<E>
|
||||||
);
|
);
|
||||||
pub struct TrackNameColumn<'a, E: Engine>(
|
|
||||||
pub &'a [Sequencer<E>], pub ArrangerFocus
|
|
||||||
);
|
|
||||||
pub struct TrackMonitorColumn<'a, E: Engine>(
|
|
||||||
pub &'a [Sequencer<E>]
|
|
||||||
);
|
|
||||||
pub struct TrackRecordColumn<'a, E: Engine>(
|
|
||||||
pub &'a [Sequencer<E>]
|
|
||||||
);
|
|
||||||
pub struct TrackOverdubColumn<'a, E: Engine>(
|
|
||||||
pub &'a [Sequencer<E>]
|
|
||||||
);
|
|
||||||
pub struct TrackEraseColumn<'a, E: Engine>(
|
|
||||||
pub &'a [Sequencer<E>]
|
|
||||||
);
|
|
||||||
pub struct TrackGainColumn<'a, E: Engine>(
|
|
||||||
pub &'a [Sequencer<E>]
|
|
||||||
);
|
|
||||||
pub struct TrackScenesColumn<'a, E: Engine>(
|
|
||||||
pub &'a [Sequencer<E>], pub &'a [Scene], pub ArrangerFocus
|
|
||||||
);
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -354,50 +354,214 @@ impl<'a> Content for HorizontalArranger<'a, Tui> {
|
||||||
type Engine = Tui;
|
type Engine = Tui;
|
||||||
fn content (&self) -> impl Widget<Engine = Tui> {
|
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||||
let Arranger { tracks, focused, selected, scenes, .. } = self.0;
|
let Arranger { tracks, focused, selected, scenes, .. } = self.0;
|
||||||
let tracks = tracks.as_slice();
|
let _tracks = tracks.as_slice();
|
||||||
Layers::new(|add|{
|
lay!(
|
||||||
add(&focused.then_some(Background(Color::Rgb(40, 50, 30))))?;
|
focused.then_some(Background(Color::Rgb(40, 50, 30))),
|
||||||
add(&Stack::right(|add|{
|
row!(
|
||||||
add(&TrackNameColumn(tracks, *selected))?;
|
// name
|
||||||
add(&TrackMonitorColumn(tracks))?;
|
CustomWidget::new(|_|{
|
||||||
add(&TrackRecordColumn(tracks))?;
|
todo!()
|
||||||
add(&TrackOverdubColumn(tracks))?;
|
}, |_: &mut TuiOutput|{
|
||||||
add(&TrackEraseColumn(tracks))?;
|
todo!()
|
||||||
add(&TrackGainColumn(tracks))?;
|
//let Self(tracks, selected) = self;
|
||||||
add(&TrackScenesColumn(tracks, scenes.as_slice(), *selected))?;
|
//let yellow = Some(Style::default().yellow().bold().not_dim());
|
||||||
Ok(())
|
//let white = Some(Style::default().white().bold().not_dim());
|
||||||
}))
|
//let area = to.area();
|
||||||
})
|
//let area = [area.x(), area.y(), 3 + 5.max(track_name_max_len(tracks)) as u16, area.h()];
|
||||||
}
|
//let offset = 0; // track scroll offset
|
||||||
}
|
//for y in 0..area.h() {
|
||||||
|
//if y == 0 {
|
||||||
impl<'a> Widget for TrackNameColumn<'a, Tui> {
|
//to.blit(&"Mixer", area.x() + 1, area.y() + y, Some(DIM))?;
|
||||||
type Engine = Tui;
|
//} else if y % 2 == 0 {
|
||||||
fn layout (&self, _to: [u16;2]) -> Perhaps<[u16;2]> {
|
//let index = (y as usize - 2) / 2 + offset;
|
||||||
todo!()
|
//if let Some(track) = tracks.get(index) {
|
||||||
}
|
//let selected = selected.track() == Some(index);
|
||||||
fn render (&self, _to: &mut TuiOutput) -> Usually<()> {
|
//let style = if selected { yellow } else { white };
|
||||||
todo!();
|
//to.blit(&format!(" {index:>02} "), area.x(), area.y() + y, style)?;
|
||||||
//let Self(tracks, selected) = self;
|
//to.blit(&*track.name.read().unwrap(), area.x() + 4, area.y() + y, style)?;
|
||||||
//let yellow = Some(Style::default().yellow().bold().not_dim());
|
//}
|
||||||
//let white = Some(Style::default().white().bold().not_dim());
|
//}
|
||||||
//let area = to.area();
|
//}
|
||||||
//let area = [area.x(), area.y(), 3 + 5.max(track_name_max_len(tracks)) as u16, area.h()];
|
//Ok(Some(area))
|
||||||
//let offset = 0; // track scroll offset
|
}),
|
||||||
//for y in 0..area.h() {
|
// monitor
|
||||||
//if y == 0 {
|
CustomWidget::new(|_|{
|
||||||
//to.blit(&"Mixer", area.x() + 1, area.y() + y, Some(DIM))?;
|
todo!()
|
||||||
//} else if y % 2 == 0 {
|
}, |_: &mut TuiOutput|{
|
||||||
//let index = (y as usize - 2) / 2 + offset;
|
todo!()
|
||||||
//if let Some(track) = tracks.get(index) {
|
//let Self(tracks) = self;
|
||||||
//let selected = selected.track() == Some(index);
|
//let mut area = to.area();
|
||||||
//let style = if selected { yellow } else { white };
|
//let on = Some(Style::default().not_dim().green().bold());
|
||||||
//to.blit(&format!(" {index:>02} "), area.x(), area.y() + y, style)?;
|
//let off = Some(DIM);
|
||||||
//to.blit(&*track.name.read().unwrap(), area.x() + 4, area.y() + y, style)?;
|
//area.x += 1;
|
||||||
//}
|
//for y in 0..area.h() {
|
||||||
//}
|
//if y == 0 {
|
||||||
//}
|
////" MON ".blit(to.buffer, area.x, area.y + y, style2)?;
|
||||||
//Ok(Some(area))
|
//} else if y % 2 == 0 {
|
||||||
|
//let index = (y as usize - 2) / 2;
|
||||||
|
//if let Some(track) = tracks.get(index) {
|
||||||
|
//let style = if track.monitoring { on } else { off };
|
||||||
|
//to.blit(&" MON ", area.x(), area.y() + y, style)?;
|
||||||
|
//} else {
|
||||||
|
//area.height = y;
|
||||||
|
//break
|
||||||
|
//}
|
||||||
|
//}
|
||||||
|
//}
|
||||||
|
//area.width = 4;
|
||||||
|
//Ok(Some(area))
|
||||||
|
}),
|
||||||
|
// record
|
||||||
|
CustomWidget::new(|_|{
|
||||||
|
todo!()
|
||||||
|
}, |_: &mut TuiOutput|{
|
||||||
|
todo!()
|
||||||
|
//let Self(tracks) = self;
|
||||||
|
//let mut area = to.area();
|
||||||
|
//let on = Some(Style::default().not_dim().red().bold());
|
||||||
|
//let off = Some(Style::default().dim());
|
||||||
|
//area.x += 1;
|
||||||
|
//for y in 0..area.h() {
|
||||||
|
//if y == 0 {
|
||||||
|
////" REC ".blit(to.buffer, area.x, area.y + y, style2)?;
|
||||||
|
//} else if y % 2 == 0 {
|
||||||
|
//let index = (y as usize - 2) / 2;
|
||||||
|
//if let Some(track) = tracks.get(index) {
|
||||||
|
//let style = if track.recording { on } else { off };
|
||||||
|
//to.blit(&" REC ", area.x(), area.y() + y, style)?;
|
||||||
|
//} else {
|
||||||
|
//area.height = y;
|
||||||
|
//break
|
||||||
|
//}
|
||||||
|
//}
|
||||||
|
//}
|
||||||
|
//area.width = 4;
|
||||||
|
//Ok(Some(area))
|
||||||
|
}),
|
||||||
|
// overdub
|
||||||
|
CustomWidget::new(|_|{
|
||||||
|
todo!()
|
||||||
|
}, |_: &mut TuiOutput|{
|
||||||
|
todo!()
|
||||||
|
//let Self(tracks) = self;
|
||||||
|
//let mut area = to.area();
|
||||||
|
//let on = Some(Style::default().not_dim().yellow().bold());
|
||||||
|
//let off = Some(Style::default().dim());
|
||||||
|
//area.x = area.x + 1;
|
||||||
|
//for y in 0..area.h() {
|
||||||
|
//if y == 0 {
|
||||||
|
////" OVR ".blit(to.buffer, area.x, area.y + y, style2)?;
|
||||||
|
//} else if y % 2 == 0 {
|
||||||
|
//let index = (y as usize - 2) / 2;
|
||||||
|
//if let Some(track) = tracks.get(index) {
|
||||||
|
//to.blit(&" OVR ", area.x(), area.y() + y, if track.overdub {
|
||||||
|
//on
|
||||||
|
//} else {
|
||||||
|
//off
|
||||||
|
//})?;
|
||||||
|
//} else {
|
||||||
|
//area.height = y;
|
||||||
|
//break
|
||||||
|
//}
|
||||||
|
//}
|
||||||
|
//}
|
||||||
|
//area.width = 4;
|
||||||
|
//Ok(Some(area))
|
||||||
|
}),
|
||||||
|
// erase
|
||||||
|
CustomWidget::new(|_|{
|
||||||
|
todo!()
|
||||||
|
}, |_: &mut TuiOutput|{
|
||||||
|
todo!()
|
||||||
|
}),
|
||||||
|
// gain
|
||||||
|
CustomWidget::new(|_|{
|
||||||
|
todo!()
|
||||||
|
//let Self(tracks) = self;
|
||||||
|
//let mut area = to.area();
|
||||||
|
//let off = Some(Style::default().dim());
|
||||||
|
//area.x = area.x + 1;
|
||||||
|
//for y in 0..area.h() {
|
||||||
|
//if y == 0 {
|
||||||
|
////" DEL ".blit(to.buffer, area.x, area.y + y, style2)?;
|
||||||
|
//} else if y % 2 == 0 {
|
||||||
|
//let index = (y as usize - 2) / 2;
|
||||||
|
//if let Some(_) = tracks.get(index) {
|
||||||
|
//to.blit(&" DEL ", area.x(), area.y() + y, off)?;
|
||||||
|
//} else {
|
||||||
|
//area.height = y;
|
||||||
|
//break
|
||||||
|
//}
|
||||||
|
//}
|
||||||
|
//}
|
||||||
|
//area.width = 4;
|
||||||
|
//Ok(Some(area))
|
||||||
|
}, |_: &mut TuiOutput|{
|
||||||
|
todo!()
|
||||||
|
//let Self(tracks) = self;
|
||||||
|
//let mut area = to.area();
|
||||||
|
//let off = Some(Style::default().dim());
|
||||||
|
//area.x = area.x() + 1;
|
||||||
|
//for y in 0..area.h() {
|
||||||
|
//if y == 0 {
|
||||||
|
////" GAIN ".blit(to.buffer, area.x, area.y + y, style2)?;
|
||||||
|
//} else if y % 2 == 0 {
|
||||||
|
//let index = (y as usize - 2) / 2;
|
||||||
|
//if let Some(_) = tracks.get(index) {
|
||||||
|
//to.blit(&" +0.0 ", area.x(), area.y() + y, off)?;
|
||||||
|
//} else {
|
||||||
|
//area.height = y;
|
||||||
|
//break
|
||||||
|
//}
|
||||||
|
//}
|
||||||
|
//}
|
||||||
|
//area.width = 7;
|
||||||
|
//Ok(Some(area))
|
||||||
|
}),
|
||||||
|
// scenes
|
||||||
|
CustomWidget::new(|_|{
|
||||||
|
todo!()
|
||||||
|
}, |to: &mut TuiOutput|{
|
||||||
|
let Arranger { tracks, scenes, selected, .. } = self.0;
|
||||||
|
let area = to.area();
|
||||||
|
let mut x2 = 0;
|
||||||
|
let [x, y, _, height] = area;
|
||||||
|
for (scene_index, scene) in scenes.iter().enumerate() {
|
||||||
|
let active_scene = selected.scene() == Some(scene_index);
|
||||||
|
let sep = Some(if active_scene {
|
||||||
|
Style::default().yellow().not_dim()
|
||||||
|
} else {
|
||||||
|
Style::default().dim()
|
||||||
|
});
|
||||||
|
for y in y+1..y+height {
|
||||||
|
to.blit(&"│", x + x2, y, sep);
|
||||||
|
}
|
||||||
|
let name = scene.name.read().unwrap();
|
||||||
|
let mut x3 = name.len() as u16;
|
||||||
|
to.blit(&*name, x + x2, y, sep);
|
||||||
|
for (i, clip) in scene.clips.iter().enumerate() {
|
||||||
|
let active_track = selected.track() == Some(i);
|
||||||
|
if let Some(clip) = clip {
|
||||||
|
let y2 = y + 2 + i as u16 * 2;
|
||||||
|
let label = match tracks[i].phrases.get(*clip) {
|
||||||
|
Some(phrase) => &format!("{}", phrase.read().unwrap().name.read().unwrap()),
|
||||||
|
None => "...."
|
||||||
|
};
|
||||||
|
to.blit(&label, x + x2, y2, Some(if active_track && active_scene {
|
||||||
|
Style::default().not_dim().yellow().bold()
|
||||||
|
} else {
|
||||||
|
Style::default().not_dim()
|
||||||
|
}));
|
||||||
|
x3 = x3.max(label.len() as u16)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
x2 = x2 + x3 + 1;
|
||||||
|
}
|
||||||
|
//Ok(Some([x, y, x2, height]))
|
||||||
|
Ok(())
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -407,206 +571,6 @@ pub fn track_name_max_len <E: Engine> (tracks: &[Sequencer<E>]) -> usize {
|
||||||
.fold(0, usize::max)
|
.fold(0, usize::max)
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Widget for TrackMonitorColumn<'a, Tui> {
|
|
||||||
type Engine = Tui;
|
|
||||||
fn layout (&self, _to: [u16;2]) -> Perhaps<[u16;2]> {
|
|
||||||
todo!()
|
|
||||||
}
|
|
||||||
fn render (&self, _to: &mut TuiOutput) -> Usually<()> {
|
|
||||||
todo!();
|
|
||||||
//let Self(tracks) = self;
|
|
||||||
//let mut area = to.area();
|
|
||||||
//let on = Some(Style::default().not_dim().green().bold());
|
|
||||||
//let off = Some(DIM);
|
|
||||||
//area.x += 1;
|
|
||||||
//for y in 0..area.h() {
|
|
||||||
//if y == 0 {
|
|
||||||
////" MON ".blit(to.buffer, area.x, area.y + y, style2)?;
|
|
||||||
//} else if y % 2 == 0 {
|
|
||||||
//let index = (y as usize - 2) / 2;
|
|
||||||
//if let Some(track) = tracks.get(index) {
|
|
||||||
//let style = if track.monitoring { on } else { off };
|
|
||||||
//to.blit(&" MON ", area.x(), area.y() + y, style)?;
|
|
||||||
//} else {
|
|
||||||
//area.height = y;
|
|
||||||
//break
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
//area.width = 4;
|
|
||||||
//Ok(Some(area))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> Widget for TrackRecordColumn<'a, Tui> {
|
|
||||||
type Engine = Tui;
|
|
||||||
fn layout (&self, _to: [u16;2]) -> Perhaps<[u16;2]> {
|
|
||||||
todo!()
|
|
||||||
}
|
|
||||||
fn render (&self, _to: &mut TuiOutput) -> Usually<()> {
|
|
||||||
todo!();
|
|
||||||
//let Self(tracks) = self;
|
|
||||||
//let mut area = to.area();
|
|
||||||
//let on = Some(Style::default().not_dim().red().bold());
|
|
||||||
//let off = Some(Style::default().dim());
|
|
||||||
//area.x += 1;
|
|
||||||
//for y in 0..area.h() {
|
|
||||||
//if y == 0 {
|
|
||||||
////" REC ".blit(to.buffer, area.x, area.y + y, style2)?;
|
|
||||||
//} else if y % 2 == 0 {
|
|
||||||
//let index = (y as usize - 2) / 2;
|
|
||||||
//if let Some(track) = tracks.get(index) {
|
|
||||||
//let style = if track.recording { on } else { off };
|
|
||||||
//to.blit(&" REC ", area.x(), area.y() + y, style)?;
|
|
||||||
//} else {
|
|
||||||
//area.height = y;
|
|
||||||
//break
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
//area.width = 4;
|
|
||||||
//Ok(Some(area))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> Widget for TrackOverdubColumn<'a, Tui> {
|
|
||||||
type Engine = Tui;
|
|
||||||
fn layout (&self, _to: [u16;2]) -> Perhaps<[u16;2]> {
|
|
||||||
todo!()
|
|
||||||
}
|
|
||||||
fn render (&self, _to: &mut TuiOutput) -> Usually<()> {
|
|
||||||
todo!();
|
|
||||||
//let Self(tracks) = self;
|
|
||||||
//let mut area = to.area();
|
|
||||||
//let on = Some(Style::default().not_dim().yellow().bold());
|
|
||||||
//let off = Some(Style::default().dim());
|
|
||||||
//area.x = area.x + 1;
|
|
||||||
//for y in 0..area.h() {
|
|
||||||
//if y == 0 {
|
|
||||||
////" OVR ".blit(to.buffer, area.x, area.y + y, style2)?;
|
|
||||||
//} else if y % 2 == 0 {
|
|
||||||
//let index = (y as usize - 2) / 2;
|
|
||||||
//if let Some(track) = tracks.get(index) {
|
|
||||||
//to.blit(&" OVR ", area.x(), area.y() + y, if track.overdub {
|
|
||||||
//on
|
|
||||||
//} else {
|
|
||||||
//off
|
|
||||||
//})?;
|
|
||||||
//} else {
|
|
||||||
//area.height = y;
|
|
||||||
//break
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
//area.width = 4;
|
|
||||||
//Ok(Some(area))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> Widget for TrackEraseColumn<'a, Tui> {
|
|
||||||
type Engine = Tui;
|
|
||||||
fn layout (&self, _to: [u16;2]) -> Perhaps<[u16;2]> {
|
|
||||||
todo!()
|
|
||||||
}
|
|
||||||
fn render (&self, _to: &mut TuiOutput) -> Usually<()> {
|
|
||||||
todo!();
|
|
||||||
//let Self(tracks) = self;
|
|
||||||
//let mut area = to.area();
|
|
||||||
//let off = Some(Style::default().dim());
|
|
||||||
//area.x = area.x + 1;
|
|
||||||
//for y in 0..area.h() {
|
|
||||||
//if y == 0 {
|
|
||||||
////" DEL ".blit(to.buffer, area.x, area.y + y, style2)?;
|
|
||||||
//} else if y % 2 == 0 {
|
|
||||||
//let index = (y as usize - 2) / 2;
|
|
||||||
//if let Some(_) = tracks.get(index) {
|
|
||||||
//to.blit(&" DEL ", area.x(), area.y() + y, off)?;
|
|
||||||
//} else {
|
|
||||||
//area.height = y;
|
|
||||||
//break
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
//area.width = 4;
|
|
||||||
//Ok(Some(area))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> Widget for TrackGainColumn<'a, Tui> {
|
|
||||||
type Engine = Tui;
|
|
||||||
fn layout (&self, _to: [u16;2]) -> Perhaps<[u16;2]> {
|
|
||||||
todo!()
|
|
||||||
}
|
|
||||||
fn render (&self, _to: &mut TuiOutput) -> Usually<()> {
|
|
||||||
todo!();
|
|
||||||
//let Self(tracks) = self;
|
|
||||||
//let mut area = to.area();
|
|
||||||
//let off = Some(Style::default().dim());
|
|
||||||
//area.x = area.x() + 1;
|
|
||||||
//for y in 0..area.h() {
|
|
||||||
//if y == 0 {
|
|
||||||
////" GAIN ".blit(to.buffer, area.x, area.y + y, style2)?;
|
|
||||||
//} else if y % 2 == 0 {
|
|
||||||
//let index = (y as usize - 2) / 2;
|
|
||||||
//if let Some(_) = tracks.get(index) {
|
|
||||||
//to.blit(&" +0.0 ", area.x(), area.y() + y, off)?;
|
|
||||||
//} else {
|
|
||||||
//area.height = y;
|
|
||||||
//break
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
//area.width = 7;
|
|
||||||
//Ok(Some(area))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> Widget for TrackScenesColumn<'a, Tui> {
|
|
||||||
type Engine = Tui;
|
|
||||||
fn layout (&self, _to: [u16;2]) -> Perhaps<[u16;2]> {
|
|
||||||
todo!()
|
|
||||||
}
|
|
||||||
fn render (&self, to: &mut TuiOutput) -> Usually<()> {
|
|
||||||
let Self(tracks, scenes, selected) = self;
|
|
||||||
let area = to.area();
|
|
||||||
let mut x2 = 0;
|
|
||||||
let [x, y, _, height] = area;
|
|
||||||
for (scene_index, scene) in scenes.iter().enumerate() {
|
|
||||||
let active_scene = selected.scene() == Some(scene_index);
|
|
||||||
let sep = Some(if active_scene {
|
|
||||||
Style::default().yellow().not_dim()
|
|
||||||
} else {
|
|
||||||
Style::default().dim()
|
|
||||||
});
|
|
||||||
for y in y+1..y+height {
|
|
||||||
to.blit(&"│", x + x2, y, sep);
|
|
||||||
}
|
|
||||||
let name = scene.name.read().unwrap();
|
|
||||||
let mut x3 = name.len() as u16;
|
|
||||||
to.blit(&*name, x + x2, y, sep);
|
|
||||||
for (i, clip) in scene.clips.iter().enumerate() {
|
|
||||||
let active_track = selected.track() == Some(i);
|
|
||||||
if let Some(clip) = clip {
|
|
||||||
let y2 = y + 2 + i as u16 * 2;
|
|
||||||
let label = match tracks[i].phrases.get(*clip) {
|
|
||||||
Some(phrase) => &format!("{}", phrase.read().unwrap().name.read().unwrap()),
|
|
||||||
None => "...."
|
|
||||||
};
|
|
||||||
to.blit(&label, x + x2, y2, Some(if active_track && active_scene {
|
|
||||||
Style::default().not_dim().yellow().bold()
|
|
||||||
} else {
|
|
||||||
Style::default().not_dim()
|
|
||||||
}));
|
|
||||||
x3 = x3.max(label.len() as u16)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
x2 = x2 + x3 + 1;
|
|
||||||
}
|
|
||||||
//Ok(Some([x, y, x2, height]))
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
impl Content for ArrangerRenameModal<Tui> {
|
impl Content for ArrangerRenameModal<Tui> {
|
||||||
|
|
@ -633,7 +597,7 @@ impl Content for ArrangerRenameModal<Tui> {
|
||||||
//to.blit(&"▂", area.x() + 3 + label.len() as u16 + 1 + self.cursor as u16, y, style);
|
//to.blit(&"▂", area.x() + 3 + label.len() as u16 + 1 + self.cursor as u16, y, style);
|
||||||
//Ok(Some(area))
|
//Ok(Some(area))
|
||||||
//Ok(())
|
//Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Handle<Tui> for ArrangerRenameModal<Tui> {
|
impl Handle<Tui> for ArrangerRenameModal<Tui> {
|
||||||
|
|
@ -800,16 +764,23 @@ impl Sequencer<Tui> {
|
||||||
impl Content for Sequencer<Tui> {
|
impl Content for Sequencer<Tui> {
|
||||||
type Engine = Tui;
|
type Engine = Tui;
|
||||||
fn content (&self) -> impl Widget<Engine = Tui> {
|
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||||
let toolbar = col!(
|
let toolbar = Stack::down(move|add|{
|
||||||
col! { "Name", self.name.read().unwrap().as_str(), },
|
add(&col! {"Name", self.name.read().unwrap().as_str(),})?;
|
||||||
"",
|
if let Some(phrase) = self.phrase.as_ref() {
|
||||||
col! { "Start: ", " 1.1.1", "End: ", " 2.1.1", },
|
panic!();
|
||||||
"",
|
let phrase = phrase.read().unwrap();
|
||||||
col! { "Loop [ ]", "From: ", " 1.1.1", "Length: ", " 1.0.0", },
|
let length = phrase.length;
|
||||||
"",
|
let looped = phrase.looped;
|
||||||
col! { "Notes: ", "C#0-C#9 ", "[ /2 ]", "[ x2 ]"
|
add(&"")?;
|
||||||
, "[ Rev ]", "[ Inv ]", "[ Dup ]" },
|
add(&col! {"Length: ", format!("{length}").as_str(),})?;
|
||||||
).min_x(10);
|
add(&"")?;
|
||||||
|
add(&col! { "Loop [ ]", "From: ", " 1.1.1", "Length: ", " 1.0.0", })?;
|
||||||
|
add(&"")?;
|
||||||
|
add(&col! { "Notes: ", "C#0-C#9 ", "[ /2 ]", "[ x2 ]"
|
||||||
|
, "[ Rev ]", "[ Inv ]", "[ Dup ]" })?;
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}).min_x(10);
|
||||||
let content = lay!(
|
let content = lay!(
|
||||||
// keys
|
// keys
|
||||||
CustomWidget::new(|_|Ok(Some([32,4])), |to: &mut TuiOutput|{
|
CustomWidget::new(|_|Ok(Some([32,4])), |to: &mut TuiOutput|{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue