mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
8200s territory
This commit is contained in:
parent
69bc8e69fd
commit
f921260f6f
4 changed files with 20 additions and 50 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
use crate::*;
|
use crate::*;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Mixer {
|
pub struct Mixer {
|
||||||
/// JACK client handle (needs to not be dropped for standalone mode to work).
|
/// JACK client handle (needs to not be dropped for standalone mode to work).
|
||||||
|
|
@ -9,15 +8,8 @@ pub struct Mixer {
|
||||||
pub selected_track: usize,
|
pub selected_track: usize,
|
||||||
pub selected_column: usize,
|
pub selected_column: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct MixerAudio {
|
pub struct MixerAudio {
|
||||||
model: Arc<RwLock<Mixer>>
|
model: Arc<RwLock<Mixer>>
|
||||||
}
|
}
|
||||||
|
from!(|mode: &Arc<RwLock<Mixer>>| MixerAudio = Self { model: model.clone() });
|
||||||
impl From<&Arc<RwLock<Mixer>>> for MixerAudio {
|
|
||||||
fn from (model: &Arc<RwLock<Mixer>>) -> Self {
|
|
||||||
Self { model: model.clone() }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
audio!(|self: MixerAudio, _, _|Control::Continue);
|
audio!(|self: MixerAudio, _, _|Control::Continue);
|
||||||
|
|
|
||||||
|
|
@ -147,12 +147,7 @@ pub enum TransportFocus {
|
||||||
Clock,
|
Clock,
|
||||||
Quant,
|
Quant,
|
||||||
}
|
}
|
||||||
|
from!(|state: &TransportTui|Option<TransportTui> = Some(state.focus.inner()));
|
||||||
impl From<&TransportTui> for Option<TransportFocus> {
|
|
||||||
fn from (state: &TransportTui) -> Self {
|
|
||||||
Some(state.focus.inner())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl FocusWrap<TransportFocus> for TransportFocus {
|
impl FocusWrap<TransportFocus> for TransportFocus {
|
||||||
fn wrap <'a, W: Render<Tui>> (self, focus: TransportFocus, content: &'a W)
|
fn wrap <'a, W: Render<Tui>> (self, focus: TransportFocus, content: &'a W)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
use crate::*;
|
use crate::*;
|
||||||
|
|
||||||
pub struct ArrangerVColSep {
|
pub struct ArrangerVColSep {
|
||||||
cols: Vec<(usize, usize)>,
|
cols: Vec<(usize, usize)>,
|
||||||
scenes_w: u16,
|
scenes_w: u16,
|
||||||
|
|
@ -19,21 +18,14 @@ render!(<Tui>|self: ArrangerVColSep|render(move|to: &mut TuiOutput|{
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
|
|
||||||
pub struct ArrangerVRowSep {
|
pub struct ArrangerVRowSep {
|
||||||
rows: Vec<(usize, usize)>,
|
rows: Vec<(usize, usize)>,
|
||||||
sep_fg: Color,
|
sep_fg: Color,
|
||||||
}
|
}
|
||||||
|
from!(|args:(&ArrangerTui, usize)|ArrangerVRowSep = Self {
|
||||||
impl From<(&ArrangerTui, usize)> for ArrangerVRowSep {
|
rows: ArrangerScene::ppqs(args.0.scenes(), args.1),
|
||||||
fn from ((state, factor): (&ArrangerTui, usize)) -> Self {
|
sep_fg: TuiTheme::separator_fg(false),
|
||||||
Self {
|
});
|
||||||
rows: ArrangerScene::ppqs(state.scenes(), factor),
|
|
||||||
sep_fg: TuiTheme::separator_fg(false),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
render!(<Tui>|self: ArrangerVRowSep|render(move|to: &mut TuiOutput|{
|
render!(<Tui>|self: ArrangerVRowSep|render(move|to: &mut TuiOutput|{
|
||||||
Ok(for y in self.rows.iter().map(|row|row.1) {
|
Ok(for y in self.rows.iter().map(|row|row.1) {
|
||||||
let y = to.area().y() + (y / PPQ) as u16 + 1;
|
let y = to.area().y() + (y / PPQ) as u16 + 1;
|
||||||
|
|
@ -47,7 +39,6 @@ render!(<Tui>|self: ArrangerVRowSep|render(move|to: &mut TuiOutput|{
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
|
|
||||||
pub struct ArrangerVCursor {
|
pub struct ArrangerVCursor {
|
||||||
cols: Vec<(usize, usize)>,
|
cols: Vec<(usize, usize)>,
|
||||||
rows: Vec<(usize, usize)>,
|
rows: Vec<(usize, usize)>,
|
||||||
|
|
@ -56,20 +47,14 @@ pub struct ArrangerVCursor {
|
||||||
scenes_w: u16,
|
scenes_w: u16,
|
||||||
header_h: u16,
|
header_h: u16,
|
||||||
}
|
}
|
||||||
|
from!(|args:(&ArrangerTui, usize)|ArrangerVCursor = Self {
|
||||||
impl From<(&ArrangerTui, usize)> for ArrangerVCursor {
|
cols: track_widths(state.tracks()),
|
||||||
fn from ((state, factor): (&ArrangerTui, usize)) -> Self {
|
rows: ArrangerScene::ppqs(args.0.scenes(), args.1),
|
||||||
Self {
|
focused: true,
|
||||||
cols: track_widths(state.tracks()),
|
selected: state.selected,
|
||||||
rows: ArrangerScene::ppqs(state.scenes(), factor),
|
scenes_w: 3 + ArrangerScene::longest_name(state.scenes()) as u16,
|
||||||
focused: true,
|
header_h: 3,
|
||||||
selected: state.selected,
|
});
|
||||||
scenes_w: 3 + ArrangerScene::longest_name(state.scenes()) as u16,
|
|
||||||
header_h: 3,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
render!(<Tui>|self: ArrangerVCursor|render(move|to: &mut TuiOutput|{
|
render!(<Tui>|self: ArrangerVCursor|render(move|to: &mut TuiOutput|{
|
||||||
let area = to.area();
|
let area = to.area();
|
||||||
let focused = self.focused;
|
let focused = self.focused;
|
||||||
|
|
|
||||||
|
|
@ -167,14 +167,12 @@ impl Default for PhraseListModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl From<&Arc<RwLock<Phrase>>> for PhraseListModel {
|
from!(|phrase:<&Arc<RwLock<Phrase>>>| PhraseListModel = {
|
||||||
fn from (phrase: &Arc<RwLock<Phrase>>) -> Self {
|
let mut model = Self::default();
|
||||||
let mut model = Self::default();
|
model.phrases.push(phrase.clone());
|
||||||
model.phrases.push(phrase.clone());
|
model.phrase.store(1, Relaxed);
|
||||||
model.phrase.store(1, Relaxed);
|
model
|
||||||
model
|
});
|
||||||
}
|
|
||||||
}
|
|
||||||
has_phrases!(|self:PhraseListModel|self.phrases);
|
has_phrases!(|self:PhraseListModel|self.phrases);
|
||||||
has_phrase!(|self:PhraseListModel|self.phrases[self.phrase_index()]);
|
has_phrase!(|self:PhraseListModel|self.phrases[self.phrase_index()]);
|
||||||
impl PhraseListModel {
|
impl PhraseListModel {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue