mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
wip(p61,e38)
This commit is contained in:
parent
9d4fcaa32b
commit
76da19d9c6
12 changed files with 172 additions and 141 deletions
|
|
@ -54,7 +54,7 @@ where
|
|||
|
||||
impl<T> InputToCommand<Tui, T> for SequencerCommand
|
||||
where
|
||||
T: SequencerControl + TransportControl + PhrasesControl + PhraseControl + PlayheadApi
|
||||
T: SequencerControl + TransportControl + PhrasesControl + PhraseEditorControl + PlayheadApi
|
||||
+ HasFocus<Item = SequencerFocus>
|
||||
+ FocusGrid<Item = SequencerFocus>
|
||||
+ FocusEnter<Item = SequencerFocus>
|
||||
|
|
@ -83,12 +83,10 @@ where
|
|||
},
|
||||
}
|
||||
},
|
||||
SequencerFocus::Phrases => {
|
||||
PhrasesCommand::input_to_command(state, input).map(Phrases)
|
||||
},
|
||||
SequencerFocus::PhraseEditor => {
|
||||
PhraseCommand::input_to_command(state, input).map(Editor)
|
||||
},
|
||||
SequencerFocus::Phrases =>
|
||||
Phrases(PhrasesCommand::input_to_command(state, input)?),
|
||||
SequencerFocus::PhraseEditor =>
|
||||
Editor(PhraseCommand::input_to_command(state, input)?),
|
||||
_ => return None,
|
||||
})
|
||||
}
|
||||
|
|
@ -96,7 +94,7 @@ where
|
|||
}
|
||||
|
||||
impl InputToCommand<Tui, ArrangerTui> for ArrangerCommand {
|
||||
fn input_to_command (state: &ArrangerCommand, input: &TuiInput) -> Option<Self> {
|
||||
fn input_to_command (state: &ArrangerTui, input: &TuiInput) -> Option<Self> {
|
||||
use FocusCommand::*;
|
||||
use ArrangerCommand::*;
|
||||
Some(match input.event() {
|
||||
|
|
@ -126,13 +124,9 @@ impl InputToCommand<Tui, ArrangerTui> for ArrangerCommand {
|
|||
ArrangerFocus::PhraseEditor => Editor(
|
||||
PhraseCommand::input_to_command(state, input)?
|
||||
),
|
||||
ArrangerFocus::PhrasePool => match input.event() {
|
||||
key!(KeyCode::Char('e')) => EditPhrase(
|
||||
Some(state.phrase().clone())
|
||||
),
|
||||
_ => Phrases(
|
||||
PhrasePoolCommand::input_to_command(state, input)?
|
||||
)
|
||||
ArrangerFocus::Phrases => match input.event() {
|
||||
key!(KeyCode::Char('e')) => EditPhrase(Some(state.phrase().clone())),
|
||||
_ => Phrases(PhrasePoolCommand::input_to_command(state, input)?)
|
||||
},
|
||||
ArrangerFocus::Arranger => {
|
||||
use ArrangerSelection as Select;
|
||||
|
|
@ -369,7 +363,7 @@ impl<T: PhrasesControl> InputToCommand<Tui, T> for PhraseRenameCommand {
|
|||
|
||||
impl<T> InputToCommand<Tui, T> for PhraseCommand
|
||||
where
|
||||
T: PhraseControl + FocusEnter
|
||||
T: PhraseEditorControl + FocusEnter
|
||||
{
|
||||
fn input_to_command (state: &T, from: &TuiInput) -> Option<Self> {
|
||||
use PhraseCommand::*;
|
||||
|
|
@ -385,27 +379,27 @@ where
|
|||
key!(KeyCode::Char('_')) => TimeZoomSet(next_note_length(state.time_axis().read().unwrap().scale)),
|
||||
key!(KeyCode::Char('=')) => TimeZoomSet(prev_note_length(state.time_axis().read().unwrap().scale)),
|
||||
key!(KeyCode::Char('+')) => TimeZoomSet(prev_note_length(state.time_axis().read().unwrap().scale)),
|
||||
key!(KeyCode::Up) => match state.phrase_entered() {
|
||||
key!(KeyCode::Up) => match state.phrase_editor_entered() {
|
||||
true => NoteCursorSet(state.note_axis().write().unwrap().point_plus(1)),
|
||||
false => NoteScrollSet(state.note_axis().write().unwrap().start_plus(1)),
|
||||
},
|
||||
key!(KeyCode::Down) => match state.phrase_entered() {
|
||||
key!(KeyCode::Down) => match state.phrase_editor_entered() {
|
||||
true => NoteCursorSet(state.note_axis().write().unwrap().point_minus(1)),
|
||||
false => NoteScrollSet(state.note_axis().write().unwrap().start_minus(1)),
|
||||
},
|
||||
key!(KeyCode::PageUp) => match state.phrase_entered() {
|
||||
key!(KeyCode::PageUp) => match state.phrase_editor_entered() {
|
||||
true => NoteCursorSet(state.note_axis().write().unwrap().point_plus(3)),
|
||||
false => NoteScrollSet(state.note_axis().write().unwrap().start_plus(3)),
|
||||
},
|
||||
key!(KeyCode::PageDown) => match state.phrase_entered() {
|
||||
key!(KeyCode::PageDown) => match state.phrase_editor_entered() {
|
||||
true => NoteCursorSet(state.note_axis().write().unwrap().point_minus(3)),
|
||||
false => NoteScrollSet(state.note_axis().write().unwrap().start_minus(3)),
|
||||
},
|
||||
key!(KeyCode::Left) => match state.phrase_entered() {
|
||||
key!(KeyCode::Left) => match state.phrase_editor_entered() {
|
||||
true => TimeCursorSet(state.note_axis().write().unwrap().point_minus(1)),
|
||||
false => TimeScrollSet(state.note_axis().write().unwrap().start_minus(1)),
|
||||
},
|
||||
key!(KeyCode::Right) => match state.phrase_entered() {
|
||||
key!(KeyCode::Right) => match state.phrase_editor_entered() {
|
||||
true => TimeCursorSet(state.note_axis().write().unwrap().point_plus(1)),
|
||||
false => TimeScrollSet(state.note_axis().write().unwrap().start_plus(1)),
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue