mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
highlight phrase selectors
This commit is contained in:
parent
bbd784f58b
commit
c0c32c89b7
3 changed files with 27 additions and 11 deletions
|
|
@ -60,8 +60,8 @@ impl_focus!(TransportTui TransportFocus [
|
|||
&[
|
||||
PlayPause,
|
||||
Bpm,
|
||||
Quant,
|
||||
Sync,
|
||||
Quant,
|
||||
Clock,
|
||||
],
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -8,20 +8,28 @@ pub struct PhraseSelector<'a> {
|
|||
}
|
||||
|
||||
impl<'a> PhraseSelector<'a> {
|
||||
pub fn play_phrase <T: HasPhrase> (state: &'a T) -> Self {
|
||||
pub fn play_phrase <T: HasPhrase> (
|
||||
state: &'a T,
|
||||
focused: bool,
|
||||
entered: bool,
|
||||
) -> Self {
|
||||
Self {
|
||||
focused,
|
||||
entered: focused && entered,
|
||||
phrase: state.next_phrase(),
|
||||
title: "Now:",
|
||||
phrase: state.play_phrase(),
|
||||
focused: false,
|
||||
entered: false,
|
||||
}
|
||||
}
|
||||
pub fn next_phrase <T: HasPhrase> (state: &'a T) -> Self {
|
||||
pub fn next_phrase <T: HasPhrase> (
|
||||
state: &'a T,
|
||||
focused: bool,
|
||||
entered: bool,
|
||||
) -> Self {
|
||||
Self {
|
||||
title: "Next:",
|
||||
focused,
|
||||
entered: focused && entered,
|
||||
phrase: state.next_phrase(),
|
||||
focused: false,
|
||||
entered: false,
|
||||
title: "Next:",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,8 +7,16 @@ impl Content for SequencerTui {
|
|||
TransportView::from(self),
|
||||
Split::right(20,
|
||||
col_up!(
|
||||
PhraseSelector::play_phrase(&self.player).fixed_y(4),
|
||||
PhraseSelector::next_phrase(&self.player).fixed_y(4),
|
||||
PhraseSelector::play_phrase(
|
||||
&self.player,
|
||||
self.focused() == SequencerFocus::PhrasePlay,
|
||||
self.entered()
|
||||
).fixed_y(4),
|
||||
PhraseSelector::next_phrase(
|
||||
&self.player,
|
||||
self.focused() == SequencerFocus::PhraseNext,
|
||||
self.entered()
|
||||
).fixed_y(4),
|
||||
PhraseListView::from(self),
|
||||
),
|
||||
PhraseView::from(self),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue