mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 13:16:44 +01:00
reenable inc/dec phrase
This commit is contained in:
parent
c3040cef1c
commit
2c8f4857dd
11 changed files with 217 additions and 585 deletions
28
src/view.rs
28
src/view.rs
|
|
@ -1,6 +1,5 @@
|
|||
pub mod chain;
|
||||
pub mod arranger;
|
||||
pub mod layout;
|
||||
pub mod sampler;
|
||||
pub mod sequencer;
|
||||
pub mod transport;
|
||||
|
|
@ -8,7 +7,6 @@ pub mod plugin;
|
|||
pub mod border;
|
||||
|
||||
pub use self::border::*;
|
||||
pub use self::layout::*;
|
||||
pub use self::transport::TransportView;
|
||||
pub use self::arranger::*;
|
||||
pub use self::chain::ChainView;
|
||||
|
|
@ -22,7 +20,7 @@ render!(App |self, buf, area| {
|
|||
&ArrangerView::new(&self, !self.arranger_mode),
|
||||
&If(self.track_cursor > 0, &Split::right([
|
||||
&ChainView::vertical(&self),
|
||||
&self.seq_buf,
|
||||
&SequencerView::new(&self),
|
||||
]))
|
||||
]).render(buf, area)?;
|
||||
if let Some(ref modal) = self.modal {
|
||||
|
|
@ -43,12 +41,28 @@ impl<'a> Render for If<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
pub enum Direction {
|
||||
Down,
|
||||
Right,
|
||||
pub trait Modal<T>: Device {
|
||||
fn handle_with_state (&self, state: &mut T, event: &AppEvent) -> Usually<bool>;
|
||||
}
|
||||
|
||||
pub struct Split<'a, const N: usize>(pub Direction, pub [&'a (dyn Render + Sync);N]);
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum Direction { Down, Right }
|
||||
|
||||
impl Direction {
|
||||
pub fn split <'a, const N: usize> (&self, items: [&'a (dyn Render + Sync);N]) -> Split<'a, N> {
|
||||
Split(*self, items)
|
||||
}
|
||||
pub fn is_down (&self) -> bool {
|
||||
match self { Self::Down => true, _ => false }
|
||||
}
|
||||
pub fn is_right (&self) -> bool {
|
||||
match self { Self::Right => true, _ => false }
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Split<'a, const N: usize>(
|
||||
pub Direction, pub [&'a (dyn Render + Sync);N]
|
||||
);
|
||||
|
||||
impl<'a, const N: usize> Split<'a, N> {
|
||||
pub fn down (items: [&'a (dyn Render + Sync);N]) -> Self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue