mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
reenable recoloring tracks
This commit is contained in:
parent
95aba6bd59
commit
47c13e1901
2 changed files with 14 additions and 4 deletions
|
|
@ -308,8 +308,17 @@ command!(|self:ArrangerSceneCommand,state:ArrangerTui|match self {
|
|||
},
|
||||
_ => None
|
||||
});
|
||||
command!(|self:ArrangerTrackCommand,_state:ArrangerTui|None);
|
||||
command!(|self:ArrangerClipCommand, _state:ArrangerTui|None);
|
||||
command!(|self: ArrangerTrackCommand, state: ArrangerTui|match self {
|
||||
Self::SetColor(index, color) => {
|
||||
let old = state.tracks[index].color;
|
||||
state.tracks[index].color = color;
|
||||
Some(Self::SetColor(index, old))
|
||||
},
|
||||
_ => None
|
||||
});
|
||||
command!(|self:ArrangerClipCommand, _state:ArrangerTui|match self {
|
||||
_ => None
|
||||
});
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum ArrangerClipCommand {
|
||||
Play,
|
||||
|
|
|
|||
|
|
@ -102,11 +102,11 @@ impl ArrangerTrack {
|
|||
pub enum ArrangerTrackCommand {
|
||||
Add,
|
||||
Delete(usize),
|
||||
RandomColor,
|
||||
Stop,
|
||||
Swap(usize, usize),
|
||||
SetSize(usize),
|
||||
SetZoom(usize),
|
||||
SetColor(usize, ItemPalette),
|
||||
}
|
||||
|
||||
/// Hosts the JACK callback for a collection of tracks
|
||||
|
|
@ -140,6 +140,7 @@ pub fn to_arranger_track_command (input: &TuiInput, t: usize, len: usize) -> Opt
|
|||
key_pat!(Char('s')) => Select(Selected::Clip(t, 0)),
|
||||
key_pat!(Char('a')) => Select(if t > 0 { Selected::Track(t - 1) } else { Selected::Mix }),
|
||||
key_pat!(Char('d')) => Select(Selected::Track((t + 1) % len)),
|
||||
key_pat!(Char('c')) => Track(Tracks::SetColor(t, ItemPalette::random())),
|
||||
key_pat!(Char(',')) => Track(Tracks::Swap(t, t - 1)),
|
||||
key_pat!(Char('.')) => Track(Tracks::Swap(t, t + 1)),
|
||||
key_pat!(Char('<')) => Track(Tracks::Swap(t, t - 1)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue