13
0

fix some inactive tempi bugs

- no tempo curve for inactive tempi

	- inactive and meter-locked tempi cannot be deleted.
This commit is contained in:
nick_m 2017-01-07 01:12:09 +11:00
parent bdb8cce6e3
commit 4cb0090583
2 changed files with 21 additions and 6 deletions

View File

@ -141,6 +141,13 @@ Editor::draw_metric_marks (const Metrics& metrics)
(*x)->set_min_tempo (min_tempo); (*x)->set_min_tempo (min_tempo);
++tmp; ++tmp;
if (tmp != tempo_curves.end()) { if (tmp != tempo_curves.end()) {
if (!(*x)->tempo().active()) {
(*x)->hide();
} else {
(*x)->show();
}
(*x)->set_position ((*x)->tempo().frame(), (*tmp)->tempo().frame()); (*x)->set_position ((*x)->tempo().frame(), (*tmp)->tempo().frame());
} else { } else {
(*x)->set_position ((*x)->tempo().frame(), UINT32_MAX); (*x)->set_position ((*x)->tempo().frame(), UINT32_MAX);
@ -243,6 +250,13 @@ Editor::marker_position_changed ()
(*x)->set_min_tempo (min_tempo); (*x)->set_min_tempo (min_tempo);
++tmp; ++tmp;
if (tmp != tempo_curves.end()) { if (tmp != tempo_curves.end()) {
if (!(*x)->tempo().active()) {
(*x)->hide();
} else {
(*x)->show();
}
(*x)->set_position ((*x)->tempo().frame(), (*tmp)->tempo().frame()); (*x)->set_position ((*x)->tempo().frame(), (*tmp)->tempo().frame());
} else { } else {
(*x)->set_position ((*x)->tempo().frame(), UINT32_MAX); (*x)->set_position ((*x)->tempo().frame(), UINT32_MAX);
@ -441,7 +455,7 @@ Editor::remove_tempo_marker (ArdourCanvas::Item* item)
abort(); /*NOTREACHED*/ abort(); /*NOTREACHED*/
} }
if (!tempo_marker->tempo().initial()) { if (!tempo_marker->tempo().locked_to_meter() && tempo_marker->tempo().active()) {
Glib::signal_idle().connect (sigc::bind (sigc::mem_fun(*this, &Editor::real_remove_tempo_marker), &tempo_marker->tempo())); Glib::signal_idle().connect (sigc::bind (sigc::mem_fun(*this, &Editor::real_remove_tempo_marker), &tempo_marker->tempo()));
} }
} }

View File

@ -743,6 +743,8 @@ TempoMap::TempoMap (framecnt_t fr)
MeterSection *m = new MeterSection (0.0, 0.0, 0.0, start, _default_meter.divisions_per_bar(), _default_meter.note_divisor(), AudioTime, fr); MeterSection *m = new MeterSection (0.0, 0.0, 0.0, start, _default_meter.divisions_per_bar(), _default_meter.note_divisor(), AudioTime, fr);
t->set_initial (true); t->set_initial (true);
t->set_locked_to_meter (true);
m->set_initial (true); m->set_initial (true);
/* note: frame time is correct (zero) for both of these */ /* note: frame time is correct (zero) for both of these */
@ -2609,13 +2611,12 @@ TempoMap::set_active_tempi (const Metrics& metrics, const framepos_t& frame)
TempoSection* t; TempoSection* t;
if ((*i)->is_tempo()) { if ((*i)->is_tempo()) {
t = static_cast<TempoSection*> (*i); t = static_cast<TempoSection*> (*i);
if (t->initial()) { if (t->locked_to_meter()) {
t->set_active (true); t->set_active (true);
continue;
} else if (t->position_lock_style() == AudioTime) { } else if (t->position_lock_style() == AudioTime) {
if (t->active () && t->frame() < frame) { if (t->frame() < frame) {
t->set_active (false); t->set_active (false);
t->set_pulse (0.0); t->set_pulse (-1.0);
} else if (t->frame() > frame) { } else if (t->frame() > frame) {
t->set_active (true); t->set_active (true);
} else if (t->frame() == frame) { } else if (t->frame() == frame) {
@ -2806,7 +2807,7 @@ TempoMap::solve_map_minute (Metrics& imaginary, MeterSection* section, const dou
if (section->initial()) { if (section->initial()) {
/* lock the first tempo to our first meter */ /* lock the first tempo to our first meter */
if (!set_active_tempi (imaginary, section->frame_at_minute (minute))) { if (!set_active_tempi (imaginary, frame_at_minute (minute))) {
return false; return false;
} }
} }