mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 19:56:31 +01:00
use the correct region tempo map when getting BBT metric in a CueEditor
This commit is contained in:
parent
cab3d96a4c
commit
297e146152
1 changed files with 5 additions and 13 deletions
|
|
@ -1572,25 +1572,17 @@ edit_last_mark_label (std::vector<ArdourCanvas::Ruler::Mark>& marks, const std::
|
||||||
void
|
void
|
||||||
CueEditor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, samplepos_t leftmost, samplepos_t rightmost, gint /*maxchars*/)
|
CueEditor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, samplepos_t leftmost, samplepos_t rightmost, gint /*maxchars*/)
|
||||||
{
|
{
|
||||||
EC_LOCAL_TEMPO_SCOPE;
|
// no EC_LOCAL_TEMPO_SCOPE here since we use an explicit TempoMap for
|
||||||
|
// all calculations
|
||||||
|
|
||||||
if (!_session) {
|
if (!_session || !_region) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool provided = false;
|
bool provided = false;
|
||||||
std::shared_ptr<Temporal::TempoMap> tmap;
|
std::shared_ptr<Temporal::TempoMap const> tmap (_region->tempo_map());
|
||||||
std::shared_ptr<MidiRegion> mr = std::dynamic_pointer_cast<MidiRegion> (_region);
|
|
||||||
|
|
||||||
if (mr) {
|
if (!tmap) {
|
||||||
std::shared_ptr<SMFSource> smf (std::dynamic_pointer_cast<SMFSource> (mr->midi_source()));
|
|
||||||
|
|
||||||
if (smf) {
|
|
||||||
tmap = smf->tempo_map (provided);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!provided) {
|
|
||||||
tmap.reset (new Temporal::TempoMap (Temporal::Tempo (120, 4), Temporal::Meter (4, 4)));
|
tmap.reset (new Temporal::TempoMap (Temporal::Tempo (120, 4), Temporal::Meter (4, 4)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue