mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
colorize phrase cursor
This commit is contained in:
parent
d042285c80
commit
1408c0c3ce
1 changed files with 2 additions and 2 deletions
|
|
@ -130,6 +130,7 @@ render!(<Tui>|self: PianoHorizontalKeys<'a>|render(|to|Ok({
|
||||||
|
|
||||||
pub struct PianoHorizontalCursor<'a>(&'a PianoHorizontal);
|
pub struct PianoHorizontalCursor<'a>(&'a PianoHorizontal);
|
||||||
render!(<Tui>|self: PianoHorizontalCursor<'a>|render(|to|Ok({
|
render!(<Tui>|self: PianoHorizontalCursor<'a>|render(|to|Ok({
|
||||||
|
let style = Some(Style::default().fg(self.0.color.lightest.rgb));
|
||||||
let note_hi = self.0.note_hi();
|
let note_hi = self.0.note_hi();
|
||||||
let note_len = self.0.note_len();
|
let note_len = self.0.note_len();
|
||||||
let note_lo = self.0.note_lo().get();
|
let note_lo = self.0.note_lo().get();
|
||||||
|
|
@ -138,7 +139,6 @@ render!(<Tui>|self: PianoHorizontalCursor<'a>|render(|to|Ok({
|
||||||
let time_start = self.0.time_start().get();
|
let time_start = self.0.time_start().get();
|
||||||
let time_zoom = self.0.time_zoom().get();
|
let time_zoom = self.0.time_zoom().get();
|
||||||
let [x0, y0, w, _] = to.area().xywh();
|
let [x0, y0, w, _] = to.area().xywh();
|
||||||
let style = Some(Style::default().fg(Color::Rgb(0,255,0)));
|
|
||||||
for (area_y, screen_y, note) in note_y_iter(note_lo, note_hi, y0) {
|
for (area_y, screen_y, note) in note_y_iter(note_lo, note_hi, y0) {
|
||||||
if note == note_point {
|
if note == note_point {
|
||||||
for x in 0..w {
|
for x in 0..w {
|
||||||
|
|
@ -227,7 +227,7 @@ impl PianoHorizontal {
|
||||||
}
|
}
|
||||||
/// Draw the piano roll background using full blocks on note on and half blocks on legato: █▄ █▄ █▄
|
/// Draw the piano roll background using full blocks on note on and half blocks on legato: █▄ █▄ █▄
|
||||||
fn draw_fg (buf: &mut BigBuffer, phrase: &Phrase, zoom: usize) {
|
fn draw_fg (buf: &mut BigBuffer, phrase: &Phrase, zoom: usize) {
|
||||||
let style = Style::default().fg(phrase.color.lightest.rgb);//.bg(Color::Rgb(0, 0, 0));
|
let style = Style::default().fg(phrase.color.base.rgb);//.bg(Color::Rgb(0, 0, 0));
|
||||||
let mut notes_on = [false;128];
|
let mut notes_on = [false;128];
|
||||||
for (x, time_start) in (0..phrase.length).step_by(zoom).enumerate() {
|
for (x, time_start) in (0..phrase.length).step_by(zoom).enumerate() {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue