mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
app: wrap keys and view in Configuration
This commit is contained in:
parent
0e5207a79d
commit
6ed0627056
4 changed files with 102 additions and 94 deletions
|
|
@ -48,14 +48,12 @@ pub struct Tek {
|
|||
pub history: Vec<TekCommand>,
|
||||
/// Port handles
|
||||
pub ports: std::collections::BTreeMap<u32, Port<Unowned>>,
|
||||
/// View definition
|
||||
pub view: SourceIter<'static>,
|
||||
// Cache of formatted strings
|
||||
pub view_cache: Arc<RwLock<ViewCache>>,
|
||||
// Modal overlay
|
||||
pub modal: Option<Modal>,
|
||||
// Input keymap
|
||||
pub keys: InputMap<'static, Self, TekCommand, TuiIn, TokenIter<'static>>
|
||||
// View and input definition
|
||||
pub config: Configuration
|
||||
}
|
||||
|
||||
impl Tek {
|
||||
|
|
@ -421,6 +419,15 @@ pub trait HasSelection {
|
|||
fn selected_mut (&mut self) -> &mut Selection;
|
||||
}
|
||||
|
||||
/// Configuration
|
||||
#[derive(Default, Debug)]
|
||||
pub struct Configuration {
|
||||
/// View definition
|
||||
pub view: SourceIter<'static>,
|
||||
// Input keymap
|
||||
pub keys: InputMap<'static, Tek, TekCommand, TuiIn, TokenIter<'static>>
|
||||
}
|
||||
|
||||
/// Various possible modal overlays
|
||||
#[derive(PartialEq, Clone, Copy, Debug)]
|
||||
pub enum Modal {
|
||||
|
|
@ -442,11 +449,11 @@ pub enum Selection {
|
|||
/// A track is selected.
|
||||
Track(usize),
|
||||
/// A clip (track × scene) is selected.
|
||||
TrackClip { track: usize, scene: usize },
|
||||
TrackClip { track: usize, scene: usize },
|
||||
/// A track's MIDI input connection is selected.
|
||||
TrackInput { track: usize, port: usize },
|
||||
TrackInput { track: usize, port: usize },
|
||||
/// A track's MIDI output connection is selected.
|
||||
TrackOutput { track: usize, port: usize },
|
||||
TrackOutput { track: usize, port: usize },
|
||||
/// A track device slot is selected.
|
||||
TrackDevice { track: usize, device: usize },
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue