13
0

Do not use session-range as implicit section

This commit is contained in:
Robin Gareus 2023-08-29 00:28:32 +02:00
parent 2f6a0abf04
commit 6b8c7292a5
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -1572,13 +1572,12 @@ Location*
Locations::next_section (Location* l, timepos_t& start, timepos_t& end) const
{
vector<LocationPair> locs;
Location* session_range = NULL;
{
Glib::Threads::RWLock::ReaderLock lm (_lock);
for (auto const& i: locations) {
if (i->is_session_range ()) {
session_range = i;
continue;
} else if (i->is_section ()) {
locs.push_back (make_pair (i->start(), i));
}
@ -1588,20 +1587,6 @@ Locations::next_section (Location* l, timepos_t& start, timepos_t& end) const
LocationStartEarlierComparison cmp;
sort (locs.begin(), locs.end(), cmp);
if (session_range) {
if (locs.empty()) {
//locs.push_back (make_pair (session_range->start (), session_range));
locs.push_back (make_pair (session_range->end (), (ARDOUR::Location*)NULL));
} else {
if (locs.back().second->start () < session_range->end ()) {
locs.push_back (make_pair (session_range->end (), (ARDOUR::Location*)NULL));
}
if (locs.front().second->start () > session_range->start ()) {
//locs.insert (locs.begin (), make_pair (session_range->start (), session_range));
}
}
}
if (locs.size () < 2) {
return NULL;
}