mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 19:56:31 +01:00
use TempoMapChange for define_one_bar
This commit is contained in:
parent
0e20c4b3eb
commit
9c5d396334
1 changed files with 4 additions and 12 deletions
|
|
@ -7436,25 +7436,17 @@ Editor::define_one_bar (timepos_t const & start, timepos_t const & end)
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
begin_reversible_command (_("set tempo from region"));
|
TempoMapChange tmc (*this, _("set tempo from region"));
|
||||||
XMLNode& before (tmap->get_state());
|
|
||||||
|
|
||||||
if (do_global) {
|
if (do_global) {
|
||||||
tmap->set_tempo (Tempo (beats_per_minute, t.end_note_types_per_minute(), t.note_type()), timepos_t());
|
tmc.map().set_tempo (Tempo (beats_per_minute, t.end_note_types_per_minute(), t.note_type()), timepos_t());
|
||||||
} else if (t.time() == start) {
|
} else if (t.time() == start) {
|
||||||
tmap->set_tempo (Tempo (beats_per_minute, t.end_note_types_per_minute(), t.note_type()), start);
|
tmc.map().set_tempo (Tempo (beats_per_minute, t.end_note_types_per_minute(), t.note_type()), start);
|
||||||
} else {
|
} else {
|
||||||
/* constant tempo */
|
/* constant tempo */
|
||||||
const Tempo tempo (beats_per_minute, t.note_type());
|
const Tempo tempo (beats_per_minute, t.note_type());
|
||||||
tmap->set_tempo (tempo, start);
|
tmc.map().set_tempo (tempo, start);
|
||||||
}
|
}
|
||||||
|
|
||||||
XMLNode& after (tmap->get_state());
|
|
||||||
|
|
||||||
_session->add_command (new Temporal::TempoCommand (_("set tempo from range"), &before, &after));
|
|
||||||
|
|
||||||
TempoMap::update (tmap);
|
|
||||||
commit_reversible_command ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue