Tempo ramps - fix ambiguous api, fix flickering tempo curves.

This commit is contained in:
nick_m 2016-05-19 01:01:08 +10:00
parent e5ba2bc34c
commit 2d3d7a5355
14 changed files with 167 additions and 153 deletions

View file

@ -300,7 +300,7 @@ Editor::mouse_add_new_tempo_event (framepos_t frame)
if (pulse > 0.0) {
XMLNode &before = map.get_state();
/* add music-locked ramped (?) tempo using the bpm/note type at frame*/
map.add_tempo (map.tempo_at (frame), pulse, TempoSection::Ramp);
map.add_tempo_pulse (map.tempo_at (frame), pulse, TempoSection::Ramp);
XMLNode &after = map.get_state();
_session->add_command(new MementoCommand<TempoMap>(map, &before, &after));
@ -340,9 +340,9 @@ Editor::mouse_add_new_meter_event (framepos_t frame)
XMLNode &before = map.get_state();
if (meter_dialog.get_lock_style() == MusicTime) {
map.add_meter (Meter (bpb, note_type), map.bbt_to_beats (requested), requested);
map.add_meter_beat (Meter (bpb, note_type), map.bbt_to_beats (requested), requested);
} else {
map.add_meter (Meter (bpb, note_type), map.frame_time (requested), map.bbt_to_beats (requested), requested);
map.add_meter_frame (Meter (bpb, note_type), map.frame_time (requested), map.bbt_to_beats (requested), requested);
}
_session->add_command(new MementoCommand<TempoMap>(map, &before, &map.get_state()));
@ -396,9 +396,9 @@ Editor::edit_meter_section (MeterSection* section)
XMLNode &before = _session->tempo_map().get_state();
section->set_position_lock_style (meter_dialog.get_lock_style());
if (meter_dialog.get_lock_style() == MusicTime) {
_session->tempo_map().replace_meter (*section, Meter (bpb, note_type), when);
_session->tempo_map().replace_meter_bbt (*section, Meter (bpb, note_type), when);
} else {
_session->tempo_map().replace_meter (*section, Meter (bpb, note_type), frame);
_session->tempo_map().replace_meter_frame (*section, Meter (bpb, note_type), frame);
}
XMLNode &after = _session->tempo_map().get_state();
_session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
@ -432,10 +432,10 @@ Editor::edit_tempo_section (TempoSection* section)
section->set_position_lock_style (MusicTime);
framepos_t const f = _session->tempo_map().predict_tempo_frame (section, when);
double const p = _session->tempo_map().predict_tempo_pulse (section, f);
_session->tempo_map().replace_tempo (*section, Tempo (bpm, nt), p, tempo_dialog.get_tempo_type());
_session->tempo_map().replace_tempo_pulse (*section, Tempo (bpm, nt), p, tempo_dialog.get_tempo_type());
} else {
framepos_t const f = _session->tempo_map().predict_tempo_frame (section, when);
_session->tempo_map().replace_tempo (*section, Tempo (bpm, nt), f, tempo_dialog.get_tempo_type());
_session->tempo_map().replace_tempo_frame (*section, Tempo (bpm, nt), f, tempo_dialog.get_tempo_type());
}
XMLNode &after = _session->tempo_map().get_state();