mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
Tempo ramps - massively speed up dragging of tempo marks.
This commit is contained in:
parent
db77ca99a1
commit
ba0cfe81a4
2 changed files with 20 additions and 4 deletions
|
|
@ -126,7 +126,6 @@ Editor::tempo_map_changed (const PropertyChange& /*ignored*/)
|
||||||
void
|
void
|
||||||
Editor::marker_position_changed ()
|
Editor::marker_position_changed ()
|
||||||
{
|
{
|
||||||
// yes its identical...
|
|
||||||
if (!_session) {
|
if (!_session) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -136,10 +135,27 @@ Editor::marker_position_changed ()
|
||||||
if (tempo_lines) {
|
if (tempo_lines) {
|
||||||
tempo_lines->tempo_map_changed();
|
tempo_lines->tempo_map_changed();
|
||||||
}
|
}
|
||||||
|
TempoMarker* tempo_marker;
|
||||||
|
MeterMarker* meter_marker;
|
||||||
|
const TempoSection *ts;
|
||||||
|
const MeterSection *ms;
|
||||||
|
|
||||||
|
for (Marks::iterator x = metric_marks.begin(); x != metric_marks.end(); ++x) {
|
||||||
|
if ((tempo_marker = dynamic_cast<TempoMarker*> (*x)) != 0) {
|
||||||
|
if ((ts = &tempo_marker->tempo()) != 0) {
|
||||||
|
cerr << "tempo section found for tempo marker " << endl;
|
||||||
|
tempo_marker->set_position (ts->frame ());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((meter_marker = dynamic_cast<MeterMarker*> (*x)) != 0) {
|
||||||
|
if ((ms = &meter_marker->meter()) != 0) {
|
||||||
|
cerr << "meter section found for meter marker " << endl;
|
||||||
|
meter_marker->set_position (ms->frame ());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
std::vector<TempoMap::BBTPoint> grid;
|
std::vector<TempoMap::BBTPoint> grid;
|
||||||
compute_current_bbt_points (grid, leftmost_frame, leftmost_frame + current_page_samples());
|
compute_current_bbt_points (grid, leftmost_frame, leftmost_frame + current_page_samples());
|
||||||
_session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); // redraw metric markers
|
|
||||||
draw_measures (grid);
|
draw_measures (grid);
|
||||||
update_tempo_based_rulers (grid);
|
update_tempo_based_rulers (grid);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1220,8 +1220,8 @@ TempoMap::beats_to_bbt (double beats)
|
||||||
|
|
||||||
framecnt_t frame = frame_at_beat (beats);
|
framecnt_t frame = frame_at_beat (beats);
|
||||||
uint32_t cnt = 0;
|
uint32_t cnt = 0;
|
||||||
|
/* XX most of this is utter crap */
|
||||||
if (n_meters() < 2) {
|
if (n_meters() == 1) {
|
||||||
uint32_t bars = (uint32_t) floor (beats / prev_ms->note_divisor());
|
uint32_t bars = (uint32_t) floor (beats / prev_ms->note_divisor());
|
||||||
double remaining_beats = beats - (bars * prev_ms->note_divisor());
|
double remaining_beats = beats - (bars * prev_ms->note_divisor());
|
||||||
double remaining_ticks = (remaining_beats - floor (remaining_beats)) * BBT_Time::ticks_per_beat;
|
double remaining_ticks = (remaining_beats - floor (remaining_beats)) * BBT_Time::ticks_per_beat;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue