mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
bye chain
This commit is contained in:
parent
316fe45b2a
commit
2601592d17
8 changed files with 115 additions and 164 deletions
|
|
@ -1,4 +1,3 @@
|
|||
pub mod chain;
|
||||
pub mod focus;
|
||||
pub mod mixer;
|
||||
pub mod plugin;
|
||||
|
|
@ -334,3 +333,75 @@ fn rename (_: &mut App) -> Usually<bool> { Ok(true) }
|
|||
//s.sequencer_mut().map(|s|s.monitoring = !s.monitoring);
|
||||
//Ok(true)
|
||||
//}
|
||||
//use crate::{core::*, model::*};
|
||||
//use super::focus::*;
|
||||
|
||||
//pub fn handle (state: &mut Chain, event: &AppEvent) -> Usually<bool> {
|
||||
//Ok(handle_focus(state, event, keymap!(Chain {
|
||||
//[Up, NONE, "focus_up", "focus row above",
|
||||
//|s: &mut Chain|s.handle_focus(&FocusEvent::Backward)],
|
||||
//[Down, NONE, "focus_down", "focus row below",
|
||||
//|s: &mut Chain|s.handle_focus(&FocusEvent::Forward)],
|
||||
//[Enter, NONE, "focus_down", "focus row below",
|
||||
//|s: &mut Chain|s.handle_focus(&FocusEvent::Inward)],
|
||||
//[Esc, NONE, "focus_down", "focus row below",
|
||||
//|s: &mut Chain|s.handle_focus(&FocusEvent::Outward)],
|
||||
//}))? || handle_keymap(state, event, keymap!(Chain {
|
||||
//[Char('a'), NONE, "add_device", "add a device", add_device]
|
||||
//}))?)
|
||||
//}
|
||||
|
||||
//fn add_device (state: &mut Chain) -> Usually<bool> {
|
||||
//state.adding = true;
|
||||
//Ok(true)
|
||||
//}
|
||||
|
||||
//impl Focus for Chain {
|
||||
//fn unfocus (&mut self) {
|
||||
//self.focused = false
|
||||
//}
|
||||
//fn focused (&self) -> Option<&Box<dyn Device>> {
|
||||
//match self.focused {
|
||||
//true => self.items.get(self.focus),
|
||||
//false => None
|
||||
//}
|
||||
//}
|
||||
//fn focused_mut (&mut self) -> Option<&mut Box<dyn Device>> {
|
||||
//match self.focused {
|
||||
//true => self.items.get_mut(self.focus),
|
||||
//false => None
|
||||
//}
|
||||
//}
|
||||
//fn handle_focus (&mut self, event: &FocusEvent) -> Usually<bool> {
|
||||
//Ok(match event {
|
||||
//FocusEvent::Backward => {
|
||||
//if self.focus == 0 {
|
||||
//self.focus = self.items.len();
|
||||
//}
|
||||
//self.focus = self.focus - 1;
|
||||
//true
|
||||
//},
|
||||
//FocusEvent::Forward => {
|
||||
//self.focus = self.focus + 1;
|
||||
//if self.focus >= self.items.len() {
|
||||
//self.focus = 0;
|
||||
//}
|
||||
//true
|
||||
//},
|
||||
//FocusEvent::Inward => {
|
||||
//self.focused = true;
|
||||
//self.items[self.focus].handle(&AppEvent::Focus)?;
|
||||
//true
|
||||
//},
|
||||
//FocusEvent::Outward => {
|
||||
//if self.focused {
|
||||
//self.focused = false;
|
||||
//self.items[self.focus].handle(&AppEvent::Blur)?;
|
||||
//true
|
||||
//} else {
|
||||
//false
|
||||
//}
|
||||
//},
|
||||
//})
|
||||
//}
|
||||
//}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue