seek to start

This commit is contained in:
🪞👃🪞 2024-12-29 00:04:26 +01:00
parent c36802bad9
commit 7c4e1e2166

View file

@ -186,22 +186,18 @@ input_to_command!(GrooveboxCommand: <Tui>|state: GrooveboxTui, input|match input
todo!("keyboard") todo!("keyboard")
}, },
// Transport: Play/pause
key_pat!(Char(' ')) => Clock(
if state.clock().is_stopped() { Play(None) } else { Pause(None) }
),
// Transport: Play from start or rewind to start // Transport: Play from start or rewind to start
key_pat!(Shift-Char(' ')) => Clock( key_pat!(Char(' ')) => Clock(
if state.clock().is_stopped() { Play(Some(0)) } else { Pause(Some(0)) } if state.clock().is_stopped() { Play(Some(0)) } else { Pause(Some(0)) }
), ),
// Tab: Toggle visibility of phrase pool column // Tab: Toggle visibility of phrase pool column
key_pat!(Tab) => Pool(PoolCommand::Show(!state.pool.visible)), key_pat!(Tab) => Pool(PoolCommand::Show(!state.pool.visible)),
// q: Enqueue currently edited phrase // q: Enqueue currently edited phrase
key_pat!(Char('q')) => Enqueue(Some(state.pool.phrase().clone())), key_pat!(Char('q')) => Enqueue(Some(state.pool.phrase().clone())),
// 0: Enqueue phrase 0 (stop all) // 0: Enqueue phrase 0 (stop all)
key_pat!(Char('0')) => Enqueue(Some(state.pool.phrases()[0].clone())), key_pat!(Char('0')) => Enqueue(Some(state.pool.phrases()[0].clone())),
key_pat!(Shift-Char('R')) => Sampler(if state.sampler.recording.is_some() { key_pat!(Shift-Char('R')) => Sampler(if state.sampler.recording.is_some() {
SamplerCommand::RecordFinish SamplerCommand::RecordFinish