- try {
-
- if (top->coverage (bottom->position(), bottom->last_frame()) != OverlapNone) {
-
- /* check if the upper region is within the lower region */
-
- if (top->first_frame() > bottom->first_frame() &&
- top->last_frame() < bottom->last_frame()) {
-
-
- /* [ -------- 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.
- */
-
- jack_nframes_t xfade_length = min ((jack_nframes_t) 720, top->length());
-
- /* in, out */
- xfade = new Crossfade (*top, *bottom, xfade_length, top->first_frame(), StartOfIn);
- add_crossfade (*xfade);
- xfade = new Crossfade (*bottom, *top, xfade_length, top->last_frame() - xfade_length, EndOfOut);
- add_crossfade (*xfade);
-
- } else {
-
- xfade = new Crossfade (*other, *region, _session.get_xfade_model(), _session.get_crossfades_active());
- add_crossfade (*xfade);
- }
- }
- }
-
- catch (failed_constructor& err) {
- continue;
- }
-
- catch (Crossfade::NoCrossfadeHere& err) {
- continue;
- }
-