From cc30495ba0da2745193f8c32be3053450ecdbcf2 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 22 Oct 2022 05:36:23 +0200 Subject: [PATCH] Properly convert v6 MusicTime locked MIDI regions --- libs/ardour/region.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 5956b0a02d..7db3cae691 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -1356,6 +1356,19 @@ Region::_set_state (const XMLNode& node, int version, PropertyChange& what_chang if (node.get_property (X_("position"), p) && node.get_property (X_("length"), l)) { _length = timecnt_t (l, timepos_t (p)); } + + std::string lock_style; + if (node.get_property (X_("positional-lock-style"), lock_style)) { + if (lock_style == "MusicTime") { + double beat, start_beats, length_beats; + if (node.get_property (X_("beat"), beat) && node.get_property (X_("length-beats"), length_beats)) { + _length = timecnt_t (Temporal::Beats::from_double (length_beats), timepos_t (Temporal::Beats::from_double (beat))); + } + if (node.get_property (X_("start-beats"), start_beats)) { + _start = timepos_t (Temporal::Beats::from_double (start_beats)); + } + } + } } /* Regions derived from "Destructive/Tape" mode tracks in earlier