[ardour-dev] Fix for #1179 - splitting destroys adjacent crossfade
Sampo Savolainen
v2 at iki.fi
Thu Mar 23 08:05:50 PST 2006
On Thu, 2006-03-23 at 15:02 +0100, Markus Schwarzenberg wrote:
> 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;
> }
> }
> }
> }
Thanks for the code. I have something quite similar in my code at the
moment, but there are other issues. If you split the region, edit the
crossfade and undo the split, the original crossfades will have the
modifications done after the split.
Hmm.. Maybe one day we'll get it right.. :)
--
Sampo Savolainen <v2 at iki.fi>
More information about the Ardour-Dev
mailing list