mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
new key binding macro
This commit is contained in:
parent
5bc19a45d2
commit
6c266fcfca
16 changed files with 254 additions and 251 deletions
|
|
@ -10,7 +10,7 @@ pub struct TransportTui {
|
|||
}
|
||||
has_clock!(|self: TransportTui|&self.clock);
|
||||
audio!(|self: TransportTui, client, scope|ClockAudio(self).process(client, scope));
|
||||
handle!(<Tui>|self: TransportTui, from|TransportCommand::execute_with_state(self, from));
|
||||
handle!(<Tui>|self: TransportTui, input|TransportCommand::execute_with_state(self, input.event()));
|
||||
render!(Tui: (self: TransportTui) => TransportView {
|
||||
compact: false,
|
||||
clock: &self.clock
|
||||
|
|
@ -115,10 +115,10 @@ command!(|self:TransportCommand,state:TransportTui|match self {
|
|||
Self::Clock(cmd) => cmd.execute(state)?.map(Self::Clock),
|
||||
_ => unreachable!(),
|
||||
});
|
||||
impl InputToCommand<Tui, TransportTui> for TransportCommand {
|
||||
fn input_to_command (state: &TransportTui, input: &TuiIn) -> Option<Self> {
|
||||
impl InputToCommand<Event, TransportTui> for TransportCommand {
|
||||
fn input_to_command (state: &TransportTui, input: &Event) -> Option<Self> {
|
||||
use TransportCommand::*;
|
||||
Some(match input.event() {
|
||||
Some(match input {
|
||||
key_pat!(Char(' ')) => Clock(if state.clock().is_stopped() {
|
||||
Play(None)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue