mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
vertical scroll sequencer, pt.4
This commit is contained in:
parent
d1c892a235
commit
6665921de3
2 changed files with 12 additions and 4 deletions
|
|
@ -113,7 +113,15 @@ impl Handle<Tui> for PhraseEditor<Tui> {
|
||||||
false => { self.note_axis.write().unwrap().start_dec(1); },
|
false => { self.note_axis.write().unwrap().start_dec(1); },
|
||||||
},
|
},
|
||||||
key!(KeyCode::Down) => match self.entered {
|
key!(KeyCode::Down) => match self.entered {
|
||||||
true => { self.note_axis.write().unwrap().point_inc(1); },
|
true => {
|
||||||
|
let mut axis = self.note_axis.write().unwrap();
|
||||||
|
axis.point_inc(1);
|
||||||
|
if let Some(point) = axis.point {
|
||||||
|
if point > 73 {
|
||||||
|
axis.point = Some(73);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
false => { self.note_axis.write().unwrap().start_inc(1); },
|
false => { self.note_axis.write().unwrap().start_inc(1); },
|
||||||
},
|
},
|
||||||
key!(KeyCode::Left) => {
|
key!(KeyCode::Left) => {
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ impl<E: Engine> PhraseEditor<E> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn redraw (phrase: &Phrase) -> BigBuffer {
|
fn redraw (phrase: &Phrase) -> BigBuffer {
|
||||||
let mut buf = BigBuffer::new(usize::MAX.min(phrase.length), 64);
|
let mut buf = BigBuffer::new(usize::MAX.min(phrase.length), 65);
|
||||||
Self::fill_seq_bg(&mut buf, phrase.length, phrase.ppq);
|
Self::fill_seq_bg(&mut buf, phrase.length, phrase.ppq);
|
||||||
Self::fill_seq_fg(&mut buf, &phrase);
|
Self::fill_seq_fg(&mut buf, &phrase);
|
||||||
buf
|
buf
|
||||||
|
|
@ -285,12 +285,12 @@ impl<E: Engine> PhraseEditor<E> {
|
||||||
}
|
}
|
||||||
/// Colors of piano keys
|
/// Colors of piano keys
|
||||||
const KEY_COLORS: [(Color, Color);6] = [
|
const KEY_COLORS: [(Color, Color);6] = [
|
||||||
(Color::Rgb(255, 255, 255), Color::Rgb(0, 0, 0)),
|
|
||||||
(Color::Rgb(255, 255, 255), Color::Rgb(0, 0, 0)),
|
|
||||||
(Color::Rgb(255, 255, 255), Color::Rgb(255, 255, 255)),
|
(Color::Rgb(255, 255, 255), Color::Rgb(255, 255, 255)),
|
||||||
(Color::Rgb(0, 0, 0), Color::Rgb(255, 255, 255)),
|
(Color::Rgb(0, 0, 0), Color::Rgb(255, 255, 255)),
|
||||||
(Color::Rgb(0, 0, 0), Color::Rgb(255, 255, 255)),
|
(Color::Rgb(0, 0, 0), Color::Rgb(255, 255, 255)),
|
||||||
(Color::Rgb(0, 0, 0), Color::Rgb(255, 255, 255)),
|
(Color::Rgb(0, 0, 0), Color::Rgb(255, 255, 255)),
|
||||||
|
(Color::Rgb(255, 255, 255), Color::Rgb(0, 0, 0)),
|
||||||
|
(Color::Rgb(255, 255, 255), Color::Rgb(0, 0, 0)),
|
||||||
];
|
];
|
||||||
pub(crate) fn keys_vert () -> Buffer {
|
pub(crate) fn keys_vert () -> Buffer {
|
||||||
let area = [0, 0, 5, 64];
|
let area = [0, 0, 5, 64];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue