record sample (y no playback?)

This commit is contained in:
🪞👃🪞 2024-12-28 18:06:17 +01:00
parent ae3099847a
commit 97920d7063
3 changed files with 31 additions and 12 deletions

View file

@ -112,7 +112,7 @@ render!(<Tui>|self: GrooveboxSamples<'a>|{
}
}
Tui::bg(bg, if let Some(sample) = &self.0.sampler.mapped[note] {
todo!()
Tui::fg(fg, format!("{note:3} ????? "))
} else {
Tui::fg(fg, format!("{note:3} (none) "))
})
@ -153,9 +153,11 @@ input_to_command!(GrooveboxCommand: <Tui>|state: GrooveboxTui, input|match input
// 0: Enqueue phrase 0 (stop all)
key_pat!(Char('0')) => Enqueue(Some(state.pool.phrases()[0].clone())),
key_pat!(Shift-Char('R')) => Sampler(
key_pat!(Shift-Char('R')) => Sampler(if state.sampler.recording.is_some() {
SamplerCommand::RecordFinish
} else {
SamplerCommand::RecordBegin(u7::from(state.editor.note_point() as u8))
),
}),
// e: Toggle between editing currently playing or other phrase
key_pat!(Char('e')) => if let Some((_, Some(playing))) = state.player.play_phrase() {