- for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
-
- nframes_t xfade_length;
-
- other = boost::dynamic_pointer_cast<AudioRegion> (*i);
-
- if (other == region) {
- continue;
- }
-
- if (other->muted() || region->muted()) {
- continue;
- }
-
-
- if (other->layer() < region->layer()) {
- top = region;
- bottom = other;
- } else {
- top = other;
- bottom = region;
- }
-
- if (!top->opaque()) {
- continue;
- }
-
- OverlapType c = top->coverage (bottom->position(), bottom->last_frame());
-
- try {
- switch (c) {
- case OverlapNone:
- break;
-
- case OverlapInternal:
- /* {=============== top =============}
- * [ ----- bottom ------- ]
- */
- break;
-
- case OverlapExternal:
-
- /* [ -------- top ------- ]
- * {=========== bottom =============}
- */
-
- /* to avoid discontinuities at the region boundaries of an internal
- overlap (this region is completely within another), we create
- two hidden crossfades at each boundary. this is not dependent
- on the auto-xfade option, because we require it as basic
- audio engineering.
- */
-
- xfade_length = min ((nframes_t) 720, top->length());