mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
implement and bind launch command
This commit is contained in:
parent
6bb73e3896
commit
57b3e48830
4 changed files with 16 additions and 3 deletions
|
|
@ -5,6 +5,7 @@
|
|||
(@t select :track 0)
|
||||
(@tab edit :clip)
|
||||
(@c color)
|
||||
(@q launch)
|
||||
(@shift-I input add)
|
||||
(@shift-O output add)
|
||||
(@shift-S scene add)
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ handle!(TuiIn: |self: Tek, input|Ok({
|
|||
Enqueue(Option<Arc<RwLock<MidiClip>>>),
|
||||
History(isize),
|
||||
Input(InputCommand),
|
||||
Launch,
|
||||
Output(OutputCommand),
|
||||
Pool(PoolCommand),
|
||||
Sampler(SamplerCommand),
|
||||
|
|
@ -58,6 +59,7 @@ atom_command!(TekCommand: |app: Tek| {
|
|||
("color" [c: Color] Some(Self::Color(ItemPalette::random())))
|
||||
("color" [c: Color] Some(Self::Color(c.map(ItemPalette::from).expect("no color"))))
|
||||
("enqueue" [c: Arc<RwLock<MidiClip>>] Some(Self::Enqueue(c)))
|
||||
("launch" [] Some(Self::Launch))
|
||||
("clip" [,..a] ClipCommand::try_from_expr(app, a).map(Self::Clip))
|
||||
("clock" [,..a] ClockCommand::try_from_expr(app.clock(), a).map(Self::Clock))
|
||||
("editor" [,..a] MidiEditCommand::try_from_expr(app.editor.as_ref().expect("no editor"), a).map(Self::Editor))
|
||||
|
|
@ -138,6 +140,15 @@ command!(|self: TekCommand, app: Tek|match self {
|
|||
//.map(|sampler|cmd.delegate(sampler, Self::Sampler)).transpose()?.flatten(),
|
||||
//Self::Enqueue(clip) => app.player.as_mut()
|
||||
//.map(|player|{player.enqueue_next(clip.as_ref());None}).flatten(),
|
||||
Self::Launch => {
|
||||
use Selection::*;
|
||||
match app.selected {
|
||||
Track(t) => app.tracks[t].player.enqueue_next(None),
|
||||
Clip(t, s) => app.tracks[t].player.enqueue_next(app.scenes[s].clips[t].as_ref()),
|
||||
_ => {}
|
||||
};
|
||||
None
|
||||
},
|
||||
Self::Color(palette) => {
|
||||
use Selection::*;
|
||||
Some(Self::Color(match app.selected {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
(@q clip enqueue :track :scene)
|
||||
(@c clip color :track :scene)
|
||||
(@g clip get)
|
||||
(@p clip put)
|
||||
(@delete clip del)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,10 @@ impl Tek {
|
|||
pub fn view_outputs (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
let w = self.w_tracks_area();
|
||||
let fg = Tui::g(224);
|
||||
let nexts = self.per_track_top(|_, _|Tui::bg(Reset, " ------ "));
|
||||
let nexts = self.per_track_top(|t, track|Either(
|
||||
track.player.next_clip.is_some(),
|
||||
Thunk::new(||Tui::bg(Reset, " QUEUED ")),
|
||||
Thunk::new(||Tui::bg(Reset, " ------ "))));
|
||||
let nexts = self.row_top(w, 1, Align::e("Next:"), nexts, ());
|
||||
let froms = self.per_track_top(|_, _|Tui::bg(Reset, Align::c(Bsp::s(" ------ ", OctaveVertical::default(),))));
|
||||
let froms = self.row_top(w, 2, Align::e("From:"), froms, ());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue