Tempo ramps - fix BBTPoint wtf.
- tempo tick lines should draw properly now.
This commit is contained in:
@@ -76,7 +76,7 @@ TempoLines::draw_ticks (std::vector<ARDOUR::TempoMap::BBTPoint>& grid,
|
||||
framepos_t f = 0;
|
||||
|
||||
if (grid.begin()->c != 0.0) {
|
||||
const double pulses_per_div = l * (grid.begin()->tempo.note_type() / grid.begin()->meter->note_divisor()) / (double) divisions;
|
||||
const double pulses_per_div = l * (grid.begin()->tempo.note_type() / grid.begin()->meter.note_divisor()) / (double) divisions;
|
||||
const double time_at_pulse = log (((grid.begin()->c * (pulses_per_div / grid.begin()->tempo.note_type())) /
|
||||
grid.begin()->tempo.pulses_per_minute()) + 1) / grid.begin()->c;
|
||||
f = grid.begin()->frame + (framecnt_t) floor ((time_at_pulse * 60.0 * frame_rate) + 0.5);
|
||||
@@ -86,6 +86,7 @@ TempoLines::draw_ticks (std::vector<ARDOUR::TempoMap::BBTPoint>& grid,
|
||||
}
|
||||
|
||||
if (f > leftmost_frame) {
|
||||
|
||||
lines.add (PublicEditor::instance().sample_to_pixel_unrounded (f), 1.0, c);
|
||||
}
|
||||
}
|
||||
@@ -151,8 +152,7 @@ TempoLines::draw (std::vector<ARDOUR::TempoMap::BBTPoint>& grid,
|
||||
/* draw subdivisions of this beat */
|
||||
std::vector<ARDOUR::TempoMap::BBTPoint> vec;
|
||||
vec.push_back (*i);
|
||||
|
||||
draw_ticks(vec, divisions, leftmost_frame, frame_rate);
|
||||
draw_ticks (vec, divisions, leftmost_frame, frame_rate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
|
||||
|
||||
struct BBTPoint {
|
||||
framepos_t frame;
|
||||
const MeterSection* meter;
|
||||
Meter meter;
|
||||
Tempo tempo;
|
||||
double c;
|
||||
uint32_t bar;
|
||||
@@ -311,7 +311,7 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
|
||||
|
||||
BBTPoint (const MeterSection& m, const Tempo& t, framepos_t f,
|
||||
uint32_t b, uint32_t e, double func_c)
|
||||
: frame (f), meter (&m), tempo (t.beats_per_minute(), t.note_type()), c (func_c), bar (b), beat (e) {}
|
||||
: frame (f), meter (m.note_divisor(), m.divisions_per_bar()), tempo (t.beats_per_minute(), t.note_type()), c (func_c), bar (b), beat (e) {}
|
||||
|
||||
Timecode::BBT_Time bbt() const { return Timecode::BBT_Time (bar, beat, 0); }
|
||||
operator Timecode::BBT_Time() const { return bbt(); }
|
||||
|
||||
Reference in New Issue
Block a user