fix Playlist::remove_gaps() for ExternalOverlap regions; add per-gap callback
This commit is contained in:
parent
c8c506f702
commit
3d15b61e37
@ -163,7 +163,7 @@ public:
|
||||
void duplicate_ranges (std::list<AudioRange>&, float times);
|
||||
void nudge_after (samplepos_t start, samplecnt_t distance, bool forwards);
|
||||
void fade_range (std::list<AudioRange>&);
|
||||
void remove_gaps (samplepos_t gap_threshold, samplepos_t leave_gap);
|
||||
void remove_gaps (samplepos_t gap_threshold, samplepos_t leave_gap, boost::function<void (samplepos_t, samplecnt_t)> gap_callback);
|
||||
|
||||
boost::shared_ptr<Region> combine (const RegionList&);
|
||||
void uncombine (boost::shared_ptr<Region>);
|
||||
|
@ -884,7 +884,7 @@ Playlist::remove_region_internal (boost::shared_ptr<Region> region, ThawList& th
|
||||
}
|
||||
|
||||
void
|
||||
Playlist::remove_gaps (samplepos_t gap_threshold, samplepos_t leave_gap)
|
||||
Playlist::remove_gaps (samplepos_t gap_threshold, samplepos_t leave_gap, boost::function<void (samplepos_t, samplecnt_t)> gap_callback)
|
||||
{
|
||||
RegionWriteLock rlock (this);
|
||||
RegionList::iterator i;
|
||||
@ -904,7 +904,13 @@ Playlist::remove_gaps (samplepos_t gap_threshold, samplepos_t leave_gap)
|
||||
break;
|
||||
}
|
||||
|
||||
const samplepos_t gap = (*nxt)->position() - ((*i)->position() + (*i)->length());
|
||||
samplepos_t end_of_this_region = (*i)->position() + (*i)->length();
|
||||
|
||||
if (end_of_this_region >= (*nxt)->position()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const samplepos_t gap = (*nxt)->position() - end_of_this_region;
|
||||
|
||||
if (gap < gap_threshold) {
|
||||
continue;
|
||||
@ -914,6 +920,8 @@ Playlist::remove_gaps (samplepos_t gap_threshold, samplepos_t leave_gap)
|
||||
|
||||
ripple_unlocked ((*nxt)->position(), -shift, 0, rlock.thawlist, false);
|
||||
|
||||
gap_callback ((*nxt)->position(), shift);
|
||||
|
||||
closed = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user