mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 12:46:42 +01:00
simplify groovebox module
This commit is contained in:
parent
c685621788
commit
bd7e1d16d6
1 changed files with 3 additions and 16 deletions
|
|
@ -7,7 +7,7 @@ impl TryFrom<&Arc<RwLock<JackClient>>> for GrooveboxTui {
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
sequencer: SequencerTui::try_from(jack)?,
|
sequencer: SequencerTui::try_from(jack)?,
|
||||||
sampler: SamplerTui::try_from(jack)?,
|
sampler: SamplerTui::try_from(jack)?,
|
||||||
focus: GrooveboxFocus::Sampler,
|
split: 20
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -15,22 +15,9 @@ impl TryFrom<&Arc<RwLock<JackClient>>> for GrooveboxTui {
|
||||||
pub struct GrooveboxTui {
|
pub struct GrooveboxTui {
|
||||||
pub sequencer: SequencerTui,
|
pub sequencer: SequencerTui,
|
||||||
pub sampler: SamplerTui,
|
pub sampler: SamplerTui,
|
||||||
pub focus: GrooveboxFocus,
|
pub split: u16,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sections that may be focused
|
render!(|self:GrooveboxTui|Bsp::n(Tui::fixed_y(self.split, &self.sampler), &self.sequencer));
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
|
||||||
pub enum GrooveboxFocus {
|
|
||||||
/// The transport (toolbar) is focused
|
|
||||||
Transport(TransportFocus),
|
|
||||||
/// The phrase list (pool) is focused
|
|
||||||
PhraseList,
|
|
||||||
/// The phrase editor (sequencer) is focused
|
|
||||||
PhraseEditor,
|
|
||||||
/// The sample player is focused
|
|
||||||
Sampler
|
|
||||||
}
|
|
||||||
|
|
||||||
render!(|self:GrooveboxTui|"are we groovy yet?");
|
|
||||||
audio!(|self:GrooveboxTui,_client,_process|Control::Continue);
|
audio!(|self:GrooveboxTui,_client,_process|Control::Continue);
|
||||||
handle!(<Tui>|self:GrooveboxTui,input|Ok(None));
|
handle!(<Tui>|self:GrooveboxTui,input|Ok(None));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue