13
0

Section operations need to use audio-time

cut/copy section does copy the tempo-map, so copying
a 4 Bar MIDI section will be 4 Bars after the paste.

This does not work the other way around:
With a tempo-map, 4 bars may correspond to 10 seconds
at the source position. While 4 bars at the target
position may correspond to a different audio-time
duration. This can lead to gaps or overlaps.
This commit is contained in:
Robin Gareus 2023-09-18 17:14:03 +02:00
parent 6a8946a746
commit f5fabb595a
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -7225,8 +7225,16 @@ Session::clear_object_selection ()
}
void
Session::cut_copy_section (timepos_t const& start, timepos_t const& end, timepos_t const& to, SectionOperation const op)
Session::cut_copy_section (timepos_t const& start_, timepos_t const& end_, timepos_t const& to_, SectionOperation const op)
{
timepos_t start = timepos_t::from_superclock (start_.superclocks());
timepos_t end = timepos_t::from_superclock (end_.superclocks());
timepos_t to = timepos_t::from_superclock (to_.superclocks());
#ifndef NDEBUG
cout << "Session::cut_copy_section " << start << " - " << end << " << to " << to << " op = " << op << "\n";
#endif
std::list<TimelineRange> ltr;
TimelineRange tlr (start, end, 0);
ltr.push_back (tlr);