mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
wip: directional focus!
This commit is contained in:
parent
ec3eb40bb4
commit
225eda0d24
5 changed files with 118 additions and 59 deletions
|
|
@ -2,6 +2,8 @@ use crate::*;
|
|||
|
||||
/// Root level object for standalone `tek_arranger`
|
||||
pub struct Arranger<E: Engine> {
|
||||
/// Index of currently focused component
|
||||
pub focus: ArrangerFocus,
|
||||
/// Controls the JACK transport.
|
||||
pub transport: Option<Arc<RwLock<TransportToolbar<E>>>>,
|
||||
/// Contains all the sequencers.
|
||||
|
|
@ -12,10 +14,25 @@ pub struct Arranger<E: Engine> {
|
|||
pub editor: PhraseEditor<E>,
|
||||
/// This allows the sequencer view to be moved or hidden.
|
||||
pub show_sequencer: Option<tek_core::Direction>,
|
||||
/// Index of currently focused component
|
||||
pub focus: usize,
|
||||
/// Slot for modal dialog displayed on top of app.
|
||||
pub modal: Option<Box<dyn ContentComponent<E>>>,
|
||||
/// Focus cursor
|
||||
pub focus_cursor: (usize, usize)
|
||||
}
|
||||
/// Sections in the arranger that may be focused
|
||||
#[derive(Copy, Clone, PartialEq, Eq)]
|
||||
pub enum ArrangerFocus { Transport, Arrangement, PhrasePool, PhraseEditor }
|
||||
/// Focus layout of arranger.
|
||||
impl<E: Engine> FocusGrid<ArrangerFocus> for Arranger<E> {
|
||||
fn cursor (&self) -> (usize, usize) { self.focus_cursor }
|
||||
fn cursor_mut (&mut self) -> &mut (usize, usize) { &mut self.focus_cursor }
|
||||
fn layout (&self) -> &[&[ArrangerFocus]] {
|
||||
&[
|
||||
&[ArrangerFocus::Transport],
|
||||
&[ArrangerFocus::Arrangement],
|
||||
&[ArrangerFocus::PhrasePool, ArrangerFocus::PhraseEditor],
|
||||
]
|
||||
}
|
||||
}
|
||||
/// Represents the tracks and scenes of the composition.
|
||||
pub struct Arrangement<E: Engine> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue