13
0

grid: display grid lines for triplets/quintuplets/septuplets

This commit is contained in:
jean-emmanuel 2024-02-25 20:52:37 +01:00 committed by Robin Gareus
parent 81bd75e7ae
commit f190493e32
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -358,25 +358,48 @@ Editor::compute_current_bbt_points (Temporal::TempoMapPoints& grid, samplepos_t
const Beats lower_beat = (left < Beats() ? Beats() : left); const Beats lower_beat = (left < Beats() ? Beats() : left);
const samplecnt_t sr (_session->sample_rate()); const samplecnt_t sr (_session->sample_rate());
int divisor;
switch (_grid_type) {
case GridTypeBeatDiv3:
case GridTypeBeatDiv6:
case GridTypeBeatDiv12:
case GridTypeBeatDiv24:
divisor = 3;
break;
case GridTypeBeatDiv5:
case GridTypeBeatDiv10:
case GridTypeBeatDiv20:
divisor = 5;
break;
case GridTypeBeatDiv7:
case GridTypeBeatDiv14:
case GridTypeBeatDiv28:
divisor = 7;
break;
default:
divisor = 2;
break;
};
switch (bbt_ruler_scale) { switch (bbt_ruler_scale) {
case bbt_show_quarters: case bbt_show_quarters:
tmap->get_grid (grid, max (tmap->superclock_at (lower_beat), (superclock_t) 0), samples_to_superclock (rightmost, sr), 0, 1); tmap->get_grid (grid, max (tmap->superclock_at (lower_beat), (superclock_t) 0), samples_to_superclock (rightmost, sr), 0, 1);
break; break;
case bbt_show_eighths: case bbt_show_eighths:
tmap->get_grid (grid, max (tmap->superclock_at (lower_beat), (superclock_t) 0), samples_to_superclock (rightmost, sr), 0, 2); tmap->get_grid (grid, max (tmap->superclock_at (lower_beat), (superclock_t) 0), samples_to_superclock (rightmost, sr), 0, 1 * divisor);
break; break;
case bbt_show_sixteenths: case bbt_show_sixteenths:
tmap->get_grid (grid, max (tmap->superclock_at (lower_beat), (superclock_t) 0), samples_to_superclock (rightmost, sr), 0, 4); tmap->get_grid (grid, max (tmap->superclock_at (lower_beat), (superclock_t) 0), samples_to_superclock (rightmost, sr), 0, 2 * divisor);
break; break;
case bbt_show_thirtyseconds: case bbt_show_thirtyseconds:
tmap->get_grid (grid, max (tmap->superclock_at (lower_beat), (superclock_t) 0), samples_to_superclock (rightmost, sr), 0, 8); tmap->get_grid (grid, max (tmap->superclock_at (lower_beat), (superclock_t) 0), samples_to_superclock (rightmost, sr), 0, 4 * divisor);
break; break;
case bbt_show_sixtyfourths: case bbt_show_sixtyfourths:
tmap->get_grid (grid, max (tmap->superclock_at (lower_beat), (superclock_t) 0), samples_to_superclock (rightmost, sr), 0, 16); tmap->get_grid (grid, max (tmap->superclock_at (lower_beat), (superclock_t) 0), samples_to_superclock (rightmost, sr), 0, 8 * divisor);
break; break;
case bbt_show_onetwentyeighths: case bbt_show_onetwentyeighths:
tmap->get_grid (grid, max (tmap->superclock_at (lower_beat), (superclock_t) 0), samples_to_superclock (rightmost, sr), 0, 32); tmap->get_grid (grid, max (tmap->superclock_at (lower_beat), (superclock_t) 0), samples_to_superclock (rightmost, sr), 0, 16 * divisor);
break; break;
case bbt_show_1: case bbt_show_1: