[ardour-dev] Fix for #1179 - splitting destroys adjacent crossfade

Markus Schwarzenberg schwarzb at ipms.fraunhofer.de
Thu Mar 23 06:02:08 PST 2006


On Wed, 22 Mar 2006 09:49:46 +0100 Markus Schwarzenberg <schwarzb at ipms.fraunhofer.de> wrote:

> For the current fix to work remove_region_internal and
> remove_dependents would have to be signalled to avoid removing the
> crossfades in questions somehow (optional argument?). Another solution
> would be to defer remove_region_internal until add_region_internal 
> is done (Still don't know possible side effects):
> 
>   	add_region_internal (left, ...) 
>   	add_region_internal (right, ...) 
> 
>       transfer_crossfades (region, left, right, position)
> 
>       remove_region_internal( ... )

Tried this yesterday, it works, but left behind ghost crossfades in 
some cases. will investigate this further.


Markus

AudioPlaylist::transfer_crossfades (Region *o, Region *l, Region *r, jack_nframes_t pos_avoid)
{
       AudioRegion *orig  = dynamic_cast<AudioRegion*>(o);
       AudioRegion *left  = dynamic_cast<AudioRegion*>(l);
       AudioRegion *right = dynamic_cast<AudioRegion*>(r);
       
       for (Crossfades::iterator x = _crossfades.begin(); x != _crossfades.end(); ++x) {

	      if ((*x)->_in == orig) {
		       if((*x)->_out->last_frame() < pos_avoid) {
			       (*x)->_in = left;
		       }
	      } 

	      if ((*x)->_out == orig) {
		       if((*x)->_in->first_frame() > pos_avoid) {
			       (*x)->_out = right;
		       }
	      } 
       }
}
 



More information about the Ardour-Dev mailing list