mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 12:46:42 +01:00
wip(p64,e4)
This commit is contained in:
parent
f49823b7a7
commit
fffd830e15
11 changed files with 194 additions and 217 deletions
|
|
@ -5,7 +5,7 @@ impl<T: TransportControl> InputToCommand<Tui, T> for TransportCommand {
|
|||
use KeyCode::Char;
|
||||
use ClockCommand::{SetBpm, SetQuant, SetSync};
|
||||
use TransportFocus as Focused;
|
||||
use TransportCommand::{Focus, Clock, Playhead};
|
||||
use TransportCommand::{Focus, Clock};
|
||||
let focused = state.transport_focused();
|
||||
Some(match input.event() {
|
||||
key!(Left) => Focus(FocusCommand::Prev),
|
||||
|
|
@ -14,32 +14,32 @@ impl<T: TransportControl> InputToCommand<Tui, T> for TransportCommand {
|
|||
Focused::Bpm => Clock(SetBpm(state.bpm().get() + 1.0)),
|
||||
Focused::Quant => Clock(SetQuant(state.next_quant())),
|
||||
Focused::Sync => Clock(SetSync(state.next_sync())),
|
||||
Focused::PlayPause => Playhead(todo!()),
|
||||
Focused::Clock => Playhead(todo!()),
|
||||
Focused::PlayPause => Clock(todo!()),
|
||||
Focused::Clock => Clock(todo!()),
|
||||
_ => {todo!()}
|
||||
},
|
||||
key!(Char(',')) => match focused {
|
||||
Focused::Bpm => Clock(SetBpm(state.bpm().get() - 1.0)),
|
||||
Focused::Quant => Clock(SetQuant(state.prev_quant())),
|
||||
Focused::Sync => Clock(SetSync(state.prev_sync())),
|
||||
Focused::PlayPause => Playhead(todo!()),
|
||||
Focused::Clock => Playhead(todo!()),
|
||||
Focused::PlayPause => Clock(todo!()),
|
||||
Focused::Clock => Clock(todo!()),
|
||||
_ => {todo!()}
|
||||
},
|
||||
key!(Char('>')) => match focused {
|
||||
Focused::Bpm => Clock(SetBpm(state.bpm().get() + 0.001)),
|
||||
Focused::Quant => Clock(SetQuant(state.next_quant())),
|
||||
Focused::Sync => Clock(SetSync(state.next_sync())),
|
||||
Focused::PlayPause => Playhead(todo!()),
|
||||
Focused::Clock => Playhead(todo!()),
|
||||
Focused::PlayPause => Clock(todo!()),
|
||||
Focused::Clock => Clock(todo!()),
|
||||
_ => {todo!()}
|
||||
},
|
||||
key!(Char('<')) => match focused {
|
||||
Focused::Bpm => Clock(SetBpm(state.bpm().get() - 0.001)),
|
||||
Focused::Quant => Clock(SetQuant(state.prev_quant())),
|
||||
Focused::Sync => Clock(SetSync(state.prev_sync())),
|
||||
Focused::PlayPause => Playhead(todo!()),
|
||||
Focused::Clock => Playhead(todo!()),
|
||||
Focused::PlayPause => Clock(todo!()),
|
||||
Focused::Clock => Clock(todo!()),
|
||||
_ => {todo!()}
|
||||
},
|
||||
_ => return None
|
||||
|
|
@ -49,7 +49,7 @@ impl<T: TransportControl> InputToCommand<Tui, T> for TransportCommand {
|
|||
|
||||
impl<T> InputToCommand<Tui, T> for SequencerCommand
|
||||
where
|
||||
T: SequencerControl + TransportControl + PhrasesControl + PhraseEditorControl + PlayheadApi
|
||||
T: SequencerControl + TransportControl + PhrasesControl + PhraseEditorControl
|
||||
+ HasFocus<Item = SequencerFocus>
|
||||
+ FocusGrid<Item = SequencerFocus>
|
||||
{
|
||||
|
|
@ -67,10 +67,9 @@ where
|
|||
key!(KeyCode::Right) => Some(Self::Focus(Right)),
|
||||
_ => Some(match state.focused() {
|
||||
SequencerFocus::Transport => {
|
||||
use TransportCommand::{Clock, Playhead, Focus};
|
||||
use TransportCommand::{Clock, Focus};
|
||||
match TransportCommand::input_to_command(state, input)? {
|
||||
Clock(command) => { todo!() },
|
||||
Playhead(command) => { todo!() },
|
||||
Focus(command) => { todo!() },
|
||||
}
|
||||
},
|
||||
|
|
@ -99,14 +98,13 @@ impl InputToCommand<Tui, ArrangerTui> for ArrangerCommand {
|
|||
key!(KeyCode::Right) => Self::Focus(Right),
|
||||
key!(KeyCode::Enter) => Self::Focus(Enter),
|
||||
key!(KeyCode::Esc) => Self::Focus(Exit),
|
||||
key!(KeyCode::Char(' ')) => Self::Playhead(PlayheadCommand::Play(None)),
|
||||
key!(KeyCode::Char(' ')) => Self::Clock(ClockCommand::Play(None)),
|
||||
_ => match state.focused() {
|
||||
ArrangerFocus::Menu => { todo!() },
|
||||
ArrangerFocus::Transport => {
|
||||
use TransportCommand::{Clock, Playhead, Focus};
|
||||
use TransportCommand::{Clock, Focus};
|
||||
match TransportCommand::input_to_command(state, input)? {
|
||||
Clock(command) => { todo!() },
|
||||
Playhead(command) => { todo!() },
|
||||
Focus(command) => { todo!() }
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue