mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 11:06:32 +01:00
when building a tempo map for the Pianoroll, consider using the main tempo map
This is only relevant when a Pianoroll is used to edit a timeline region.
This commit is contained in:
parent
a582255559
commit
ce236c49ca
1 changed files with 20 additions and 2 deletions
|
|
@ -2555,10 +2555,28 @@ Pianoroll::set_region (std::shared_ptr<ARDOUR::MidiRegion> r)
|
|||
}
|
||||
|
||||
if (!provided) {
|
||||
/* COPY MAIN SESSION TEMPO MAP? */
|
||||
Temporal::TempoMap::SharedPtr tmap (Temporal::TempoMap::use());
|
||||
|
||||
if (with_transport_controls) {
|
||||
/* clip editing, timeline irrelevant, sort of */
|
||||
|
||||
if (tmap->n_tempos() == 1 && tmap->n_meters() == 1) {
|
||||
/* Single entry tempo map, use the values there */
|
||||
map.reset (new Temporal::TempoMap (tmap->tempo_at (timepos_t (0)), tmap->meter_at (timepos_t (0))));
|
||||
} else {
|
||||
|
||||
map.reset (new Temporal::TempoMap (Temporal::Tempo (120, 4), Temporal::Meter (4, 4)));
|
||||
}
|
||||
|
||||
} else {
|
||||
/* COPY MAIN SESSION TEMPO MAP? */
|
||||
Meter m (tmap->meter_at (r->source_position()));
|
||||
Tempo t (tmap->tempo_at (r->source_position()));
|
||||
|
||||
map.reset (new Temporal::TempoMap (t, m));
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
EditingContext::TempoMapScope tms (*this, map);
|
||||
/* Compute zoom level to show entire source plus some margin if possible */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue