mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-10 13:46:42 +01:00
use TuiInput in handlers
This commit is contained in:
parent
d9535b707f
commit
5d00e9f284
11 changed files with 37 additions and 61 deletions
|
|
@ -187,7 +187,7 @@ impl<E: Engine> Audio for TransportToolbar<E> {
|
|||
}
|
||||
}
|
||||
impl Handle<Tui> for TransportToolbar<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
key!(KeyCode::Left) => {
|
||||
self.focus_prev();
|
||||
|
|
@ -249,7 +249,7 @@ impl Focusable<Tui> for TransportPlayPauseButton<Tui> {
|
|||
}
|
||||
}
|
||||
impl Handle<Tui> for TransportPlayPauseButton<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
key!(KeyCode::Enter) => self.toggle().map(|_|Some(true)),
|
||||
_ => Ok(None)
|
||||
|
|
@ -293,7 +293,7 @@ impl Focusable<Tui> for TransportBPM<Tui> {
|
|||
}
|
||||
}
|
||||
impl Handle<Tui> for TransportBPM<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
key!(KeyCode::Char(',')) => {
|
||||
self.value += 1.0;
|
||||
|
|
@ -355,7 +355,7 @@ impl Focusable<Tui> for TransportQuantize<Tui> {
|
|||
}
|
||||
}
|
||||
impl Handle<Tui> for TransportQuantize<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
key!(KeyCode::Char(',')) => {
|
||||
self.value = prev_note_length(self.value);
|
||||
|
|
@ -408,7 +408,7 @@ impl Focusable<Tui> for TransportSync<Tui> {
|
|||
}
|
||||
}
|
||||
impl Handle<Tui> for TransportSync<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
key!(KeyCode::Char(',')) => {
|
||||
self.value = prev_note_length(self.value);
|
||||
|
|
@ -464,7 +464,7 @@ impl Focusable<Tui> for TransportClock<Tui> {
|
|||
}
|
||||
}
|
||||
impl Handle<Tui> for TransportClock<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue