mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
delete track/scene
This commit is contained in:
parent
2fd7d7b39f
commit
9bc4e3fb5f
6 changed files with 52 additions and 41 deletions
|
|
@ -34,6 +34,9 @@ expose!([self: Tek]
|
|||
|
||||
handle!(TuiIn: |self: Tek, input|Ok(if let Some(command) = self.keys.command(self, input) {
|
||||
let undo = command.execute(self)?;
|
||||
if let Some(undo) = undo {
|
||||
self.history.push(undo);
|
||||
}
|
||||
Some(true)
|
||||
} else {
|
||||
None
|
||||
|
|
@ -68,13 +71,15 @@ impose!([app: Tek]
|
|||
(t, 0) => Self::Select(Selection::Track(t)),
|
||||
(0, s) => Self::Select(Selection::Scene(s)),
|
||||
(t, s) => Self::Select(Selection::Clip(t, s)) })))
|
||||
|
||||
(ClipCommand:
|
||||
("edit" [a: MaybeClip] Some(Self::Edit(a.unwrap())))
|
||||
("color" [a: usize, b: usize] Some(Self::SetColor(a.unwrap(), b.unwrap(), ItemTheme::random())))
|
||||
("enqueue" [a: usize, b: usize] Some(Self::Enqueue(a.unwrap(), b.unwrap())))
|
||||
("get" [a: usize, b: usize] Some(Self::Get(a.unwrap(), b.unwrap())))
|
||||
("loop" [a: usize, b: usize, c: bool] Some(Self::SetLoop(a.unwrap(), b.unwrap(), c.unwrap())))
|
||||
("put" [a: usize, b: usize, c: MaybeClip] Some(Self::Put(a.unwrap(), b.unwrap(), c.unwrap()))))
|
||||
("put" [a: usize, b: usize, c: MaybeClip] Some(Self::Put(a.unwrap(), b.unwrap(), c.unwrap())))
|
||||
("delete" [a: usize, b: usize] Some(Self::Put(a.unwrap(), b.unwrap(), None))))
|
||||
|
||||
(InputCommand:
|
||||
("add" [] Some(Self::Add)))
|
||||
|
|
@ -84,24 +89,24 @@ impose!([app: Tek]
|
|||
|
||||
(SceneCommand:
|
||||
("add" [] Some(Self::Add))
|
||||
("del" [a: usize] Some(Self::Del(0)))
|
||||
("delete" [a: Option<usize>] Some(Self::Del(a.flatten().unwrap())))
|
||||
("zoom" [a: usize] Some(Self::SetZoom(a.unwrap())))
|
||||
("color" [a: usize] Some(Self::SetColor(a.unwrap(), ItemTheme::G[128])))
|
||||
("enqueue" [a: usize] Some(Self::Enqueue(a.unwrap())))
|
||||
("swap" [a: usize, b: usize] Some(Self::Swap(a.unwrap(), b.unwrap()))))
|
||||
|
||||
(TrackCommand:
|
||||
("add" [] Some(Self::Add))
|
||||
("size" [a: usize] Some(Self::SetSize(a.unwrap())))
|
||||
("zoom" [a: usize] Some(Self::SetZoom(a.unwrap())))
|
||||
("color" [a: usize] Some(Self::SetColor(a.unwrap(), ItemTheme::random())))
|
||||
("del" [a: usize] Some(Self::Del(a.unwrap())))
|
||||
("stop" [a: usize] Some(Self::Stop(a.unwrap())))
|
||||
("swap" [a: usize, b: usize] Some(Self::Swap(a.unwrap(), b.unwrap())))
|
||||
("play" [] Some(Self::TogglePlay))
|
||||
("solo" [] Some(Self::ToggleSolo))
|
||||
("rec" [] Some(Self::ToggleRec))
|
||||
("mon" [] Some(Self::ToggleMon))));
|
||||
("add" [] Some(Self::Add))
|
||||
("size" [a: usize] Some(Self::SetSize(a.unwrap())))
|
||||
("zoom" [a: usize] Some(Self::SetZoom(a.unwrap())))
|
||||
("color" [a: usize] Some(Self::SetColor(a.unwrap(), ItemTheme::random())))
|
||||
("delete" [a: Option<usize>] Some(Self::Del(a.flatten().unwrap())))
|
||||
("stop" [a: usize] Some(Self::Stop(a.unwrap())))
|
||||
("swap" [a: usize, b: usize] Some(Self::Swap(a.unwrap(), b.unwrap())))
|
||||
("play" [] Some(Self::TogglePlay))
|
||||
("solo" [] Some(Self::ToggleSolo))
|
||||
("rec" [] Some(Self::ToggleRec))
|
||||
("mon" [] Some(Self::ToggleMon))));
|
||||
|
||||
defcom!([self, app: Tek]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue