mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
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
3 changed files with 46 additions and 39 deletions
|
|
@ -3489,7 +3489,7 @@ BBTRulerDrag::BBTRulerDrag (Editor* e, ArdourCanvas::Item* i)
|
||||||
void
|
void
|
||||||
BBTRulerDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
BBTRulerDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
||||||
{
|
{
|
||||||
map = _editor->begin_tempo_map_edit ();
|
map = _editor->begin_tempo_mapping ();
|
||||||
|
|
||||||
Drag::start_grab (event, cursor);
|
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
|
/* 2nd argument means "update tempo map display after the new map is
|
||||||
* installed. We need to do this because the code above has not
|
* installed. We need to do this because the code above has not
|
||||||
* actually changed anything about how tempo is displayed, it simply
|
* actually changed anything about how tempo is displayed, it simply
|
||||||
* modified the map.
|
* modified the map.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
_editor->commit_tempo_map_edit (map, true);
|
_editor->commit_tempo_mapping (map);
|
||||||
|
|
||||||
XMLNode &after = map->get_state();
|
|
||||||
|
|
||||||
_editor->session()->add_command (new Temporal::TempoCommand (_("move BBT point"), _before_state, &after));
|
|
||||||
_editor->commit_reversible_command ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BBTRulerDrag::aborted (bool moved)
|
BBTRulerDrag::aborted (bool moved)
|
||||||
{
|
{
|
||||||
TempoMap::abort_update ();
|
_editor->abort_tempo_mapping ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------*/
|
||||||
|
|
||||||
TempoTwistDrag::TempoTwistDrag (Editor* e, ArdourCanvas::Item* i)
|
TempoTwistDrag::TempoTwistDrag (Editor* e, ArdourCanvas::Item* i)
|
||||||
: Drag (e, i, Temporal::BeatTime)
|
: Drag (e, i, Temporal::BeatTime)
|
||||||
, _tempo (0)
|
, _tempo (0)
|
||||||
|
|
|
||||||
|
|
@ -738,11 +738,15 @@ Editor::LocationMarkers::setup_lines ()
|
||||||
void
|
void
|
||||||
Editor::mouse_add_new_marker (timepos_t where, Location::Flags extra_flags, int32_t cue_id)
|
Editor::mouse_add_new_marker (timepos_t where, Location::Flags extra_flags, int32_t cue_id)
|
||||||
{
|
{
|
||||||
|
if (!_session) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
string markername;
|
string markername;
|
||||||
string namebase;
|
string namebase;
|
||||||
Location::Flags flags = Location::Flags (extra_flags|Location::IsMark);
|
Location::Flags flags = Location::Flags (extra_flags|Location::IsMark);
|
||||||
|
|
||||||
if (_session) {
|
std::cerr << "adding marker @ " << where << std::endl;
|
||||||
|
|
||||||
if (flags & Location::IsCueMarker) {
|
if (flags & Location::IsCueMarker) {
|
||||||
/* XXX i18n needed for cue letter names */
|
/* XXX i18n needed for cue letter names */
|
||||||
|
|
@ -774,7 +778,6 @@ Editor::mouse_add_new_marker (timepos_t where, Location::Flags extra_flags, int3
|
||||||
|
|
||||||
commit_reversible_command ();
|
commit_reversible_command ();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::mouse_add_new_loop (timepos_t where)
|
Editor::mouse_add_new_loop (timepos_t where)
|
||||||
|
|
|
||||||
|
|
@ -821,7 +821,7 @@ Editor::mid_tempo_change (MidTempoChanges what_changed)
|
||||||
// TempoMap::SharedPtr map (TempoMap::use());
|
// TempoMap::SharedPtr map (TempoMap::use());
|
||||||
// map->dump (std::cerr);
|
// map->dump (std::cerr);
|
||||||
|
|
||||||
if (what_changed & TempoChanged) {
|
if ((what_changed & MidTempoChanges(BBTChanged|TempoChanged))) {
|
||||||
double min_tempo = DBL_MAX;
|
double min_tempo = DBL_MAX;
|
||||||
double max_tempo = 0.0;
|
double max_tempo = 0.0;
|
||||||
|
|
||||||
|
|
@ -850,8 +850,10 @@ Editor::mid_tempo_change (MidTempoChanges what_changed)
|
||||||
update_tempo_based_rulers ();
|
update_tempo_based_rulers ();
|
||||||
maybe_draw_grid_lines ();
|
maybe_draw_grid_lines ();
|
||||||
|
|
||||||
|
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));
|
foreach_time_axis_view (sigc::mem_fun (*this, &Editor::mid_tempo_per_track_update));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue