- RegionList::const_iterator in_o = other->regions.begin();
- RegionList::iterator in_n = regions.begin();
-
- while (in_o != other->regions.end()) {
- boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(*in_o);
-
- // We look only for crossfades which begin with the current region, so we don't get doubles
-
- for (Crossfades::const_iterator xfades = other->_crossfades.begin(); xfades != other->_crossfades.end(); ++xfades) {
- if ((*xfades)->in() == ar) {
- // We found one! Now copy it!
-
- RegionList::const_iterator out_o = other->regions.begin();
- RegionList::const_iterator out_n = regions.begin();
-
- while (out_o != other->regions.end()) {
-
- boost::shared_ptr<AudioRegion>ar2 = boost::dynamic_pointer_cast<AudioRegion>(*out_o);
-
- if ((*xfades)->out() == ar2) {
- boost::shared_ptr<AudioRegion>in = boost::dynamic_pointer_cast<AudioRegion>(*in_n);
- boost::shared_ptr<AudioRegion>out = boost::dynamic_pointer_cast<AudioRegion>(*out_n);
- boost::shared_ptr<Crossfade> new_fade = boost::shared_ptr<Crossfade> (new Crossfade (*xfades, in, out));
- add_crossfade(new_fade);
- break;
- }
-
- out_o++;
- out_n++;
- }
-// cerr << "HUH!? second region in the crossfade not found!" << endl;
- }
- }
-
- in_o++;
- in_n++;
- }