mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +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,8 +2555,26 @@ Pianoroll::set_region (std::shared_ptr<ARDOUR::MidiRegion> r)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!provided) {
|
if (!provided) {
|
||||||
/* COPY MAIN SESSION TEMPO MAP? */
|
Temporal::TempoMap::SharedPtr tmap (Temporal::TempoMap::use());
|
||||||
map.reset (new Temporal::TempoMap (Temporal::Tempo (120, 4), Temporal::Meter (4, 4)));
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue