more functional tempo mapping
TempoMarker drag modifies tempo (and thus beat-time positions and durations). BBTRuler drag modifies the map but not positions/durations
This commit is contained in:
parent
45490bf43f
commit
38bb89c110
|
@ -3489,7 +3489,7 @@ BBTRulerDrag::BBTRulerDrag (Editor* e, ArdourCanvas::Item* i)
|
|||
void
|
||||
BBTRulerDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
||||
{
|
||||
map = _editor->begin_tempo_map_edit ();
|
||||
map = _editor->begin_tempo_mapping ();
|
||||
|
||||
Drag::start_grab (event, cursor);
|
||||
|
||||
|
@ -3598,26 +3598,28 @@ BBTRulerDrag::finished (GdkEvent* event, bool movement_occurred)
|
|||
}
|
||||
}
|
||||
|
||||
XMLNode &after = map->get_state();
|
||||
|
||||
_editor->session()->add_command (new Temporal::TempoCommand (_("move BBT point"), _before_state, &after));
|
||||
_editor->commit_reversible_command ();
|
||||
|
||||
/* 2nd argument means "update tempo map display after the new map is
|
||||
* installed. We need to do this because the code above has not
|
||||
* actually changed anything about how tempo is displayed, it simply
|
||||
* modified the map.
|
||||
*/
|
||||
|
||||
_editor->commit_tempo_map_edit (map, true);
|
||||
|
||||
XMLNode &after = map->get_state();
|
||||
|
||||
_editor->session()->add_command (new Temporal::TempoCommand (_("move BBT point"), _before_state, &after));
|
||||
_editor->commit_reversible_command ();
|
||||
_editor->commit_tempo_mapping (map);
|
||||
}
|
||||
|
||||
void
|
||||
BBTRulerDrag::aborted (bool moved)
|
||||
{
|
||||
TempoMap::abort_update ();
|
||||
_editor->abort_tempo_mapping ();
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
TempoTwistDrag::TempoTwistDrag (Editor* e, ArdourCanvas::Item* i)
|
||||
: Drag (e, i, Temporal::BeatTime)
|
||||
, _tempo (0)
|
||||
|
|
|
@ -738,42 +738,45 @@ Editor::LocationMarkers::setup_lines ()
|
|||
void
|
||||
Editor::mouse_add_new_marker (timepos_t where, Location::Flags extra_flags, int32_t cue_id)
|
||||
{
|
||||
if (!_session) {
|
||||
return;
|
||||
}
|
||||
|
||||
string markername;
|
||||
string namebase;
|
||||
Location::Flags flags = Location::Flags (extra_flags|Location::IsMark);
|
||||
|
||||
if (_session) {
|
||||
std::cerr << "adding marker @ " << where << std::endl;
|
||||
|
||||
if (flags & Location::IsCueMarker) {
|
||||
/* XXX i18n needed for cue letter names */
|
||||
markername = string_compose (_("cue %1"), cue_marker_name (cue_id));
|
||||
} else {
|
||||
namebase = _("mark");
|
||||
_session->locations()->next_available_name (markername, namebase);
|
||||
if (flags & Location::IsCueMarker) {
|
||||
/* XXX i18n needed for cue letter names */
|
||||
markername = string_compose (_("cue %1"), cue_marker_name (cue_id));
|
||||
} else {
|
||||
namebase = _("mark");
|
||||
_session->locations()->next_available_name (markername, namebase);
|
||||
|
||||
if (!choose_new_marker_name (markername)) {
|
||||
return;
|
||||
}
|
||||
if (!choose_new_marker_name (markername)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Location *location = new Location (*_session, where, where, markername, flags, cue_id);
|
||||
begin_reversible_command (_("add marker"));
|
||||
|
||||
XMLNode &before = _session->locations()->get_state();
|
||||
_session->locations()->add (location, true);
|
||||
XMLNode &after = _session->locations()->get_state();
|
||||
_session->add_command (new MementoCommand<Locations>(*(_session->locations()), &before, &after));
|
||||
|
||||
/* find the marker we just added */
|
||||
|
||||
LocationMarkers *lam = find_location_markers (location);
|
||||
if (lam) {
|
||||
/* make it the selected marker */
|
||||
selection->set (lam->start);
|
||||
}
|
||||
|
||||
commit_reversible_command ();
|
||||
}
|
||||
|
||||
Location *location = new Location (*_session, where, where, markername, flags, cue_id);
|
||||
begin_reversible_command (_("add marker"));
|
||||
|
||||
XMLNode &before = _session->locations()->get_state();
|
||||
_session->locations()->add (location, true);
|
||||
XMLNode &after = _session->locations()->get_state();
|
||||
_session->add_command (new MementoCommand<Locations>(*(_session->locations()), &before, &after));
|
||||
|
||||
/* find the marker we just added */
|
||||
|
||||
LocationMarkers *lam = find_location_markers (location);
|
||||
if (lam) {
|
||||
/* make it the selected marker */
|
||||
selection->set (lam->start);
|
||||
}
|
||||
|
||||
commit_reversible_command ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -821,7 +821,7 @@ Editor::mid_tempo_change (MidTempoChanges what_changed)
|
|||
// TempoMap::SharedPtr map (TempoMap::use());
|
||||
// map->dump (std::cerr);
|
||||
|
||||
if (what_changed & TempoChanged) {
|
||||
if ((what_changed & MidTempoChanges(BBTChanged|TempoChanged))) {
|
||||
double min_tempo = DBL_MAX;
|
||||
double max_tempo = 0.0;
|
||||
|
||||
|
@ -850,8 +850,10 @@ Editor::mid_tempo_change (MidTempoChanges what_changed)
|
|||
update_tempo_based_rulers ();
|
||||
maybe_draw_grid_lines ();
|
||||
|
||||
foreach_time_axis_view (sigc::mem_fun (*this, &Editor::mid_tempo_per_track_update));
|
||||
|
||||
if (!(what_changed & BBTChanged)) {
|
||||
/* Nothing changes in tracks when it is a BBT change */
|
||||
foreach_time_axis_view (sigc::mem_fun (*this, &Editor::mid_tempo_per_track_update));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue