don't trim regions in conjunction with xfade trimming unless auto-xfade and full-overlap-xfades are selected
git-svn-id: svn://localhost/ardour2/branches/3.0@12245 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
dc9fb4a033
commit
eaf548f49f
@ -1583,18 +1583,18 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
|
|||||||
|
|
||||||
Points* points = get_canvas_points ("xfade edit redraw", npoints);
|
Points* points = get_canvas_points ("xfade edit redraw", npoints);
|
||||||
boost::scoped_ptr<float> vec (new float[npoints]);
|
boost::scoped_ptr<float> vec (new float[npoints]);
|
||||||
double effective_height = _height - NAME_HIGHLIGHT_SIZE;
|
double effective_height = _height - NAME_HIGHLIGHT_SIZE - 1.0;
|
||||||
|
|
||||||
ar->fade_in()->curve().get_vector (0, ar->fade_in()->back()->when, vec.get(), npoints);
|
ar->fade_in()->curve().get_vector (0, ar->fade_in()->back()->when, vec.get(), npoints);
|
||||||
|
|
||||||
for (int i = 0, pci = 0; i < npoints; ++i) {
|
for (int i = 0, pci = 0; i < npoints; ++i) {
|
||||||
Gnome::Art::Point &p ((*points)[pci++]);
|
Gnome::Art::Point &p ((*points)[pci++]);
|
||||||
p.set_x (i);
|
p.set_x (i);
|
||||||
p.set_y (effective_height - (effective_height * vec.get()[i]));
|
p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
start_xfade_rect->property_x1() = ((*points)[0]).get_x();
|
start_xfade_rect->property_x1() = ((*points)[0]).get_x();
|
||||||
start_xfade_rect->property_y1() = 0;
|
start_xfade_rect->property_y1() = 1.0;
|
||||||
start_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
|
start_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
|
||||||
start_xfade_rect->property_y2() = effective_height;
|
start_xfade_rect->property_y2() = effective_height;
|
||||||
start_xfade_rect->show ();
|
start_xfade_rect->show ();
|
||||||
@ -1613,7 +1613,7 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
|
|||||||
for (int i = 0, pci = 0; i < npoints; ++i) {
|
for (int i = 0, pci = 0; i < npoints; ++i) {
|
||||||
Gnome::Art::Point &p ((*points)[pci++]);
|
Gnome::Art::Point &p ((*points)[pci++]);
|
||||||
p.set_x (i);
|
p.set_x (i);
|
||||||
p.set_y (effective_height - (effective_height * (1.0 - vec.get()[i])));
|
p.set_y (1.0 + effective_height - (effective_height * (1.0 - vec.get()[i])));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -1623,7 +1623,7 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
|
|||||||
for (int i = 0, pci = 0; i < npoints; ++i) {
|
for (int i = 0, pci = 0; i < npoints; ++i) {
|
||||||
Gnome::Art::Point &p ((*points)[pci++]);
|
Gnome::Art::Point &p ((*points)[pci++]);
|
||||||
p.set_x (i);
|
p.set_x (i);
|
||||||
p.set_y (effective_height - (effective_height * vec.get()[i]));
|
p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1692,16 +1692,16 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn
|
|||||||
ar->fade_out()->curve().get_vector (0, ar->fade_out()->back()->when, vec.get(), npoints);
|
ar->fade_out()->curve().get_vector (0, ar->fade_out()->back()->when, vec.get(), npoints);
|
||||||
|
|
||||||
double rend = trackview.editor().frame_to_pixel (_region->length() - len);
|
double rend = trackview.editor().frame_to_pixel (_region->length() - len);
|
||||||
double effective_height = _height - NAME_HIGHLIGHT_SIZE;
|
double effective_height = _height - NAME_HIGHLIGHT_SIZE - 1;
|
||||||
|
|
||||||
for (int i = 0, pci = 0; i < npoints; ++i) {
|
for (int i = 0, pci = 0; i < npoints; ++i) {
|
||||||
Gnome::Art::Point &p ((*points)[pci++]);
|
Gnome::Art::Point &p ((*points)[pci++]);
|
||||||
p.set_x (rend + i);
|
p.set_x (rend + i);
|
||||||
p.set_y (effective_height - (effective_height * vec.get()[i]));
|
p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
end_xfade_rect->property_x1() = ((*points)[0]).get_x();
|
end_xfade_rect->property_x1() = ((*points)[0]).get_x();
|
||||||
end_xfade_rect->property_y1() = 0;
|
end_xfade_rect->property_y1() = 1;
|
||||||
end_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
|
end_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
|
||||||
end_xfade_rect->property_y2() = effective_height;
|
end_xfade_rect->property_y2() = effective_height;
|
||||||
end_xfade_rect->show ();
|
end_xfade_rect->show ();
|
||||||
@ -1720,7 +1720,7 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn
|
|||||||
for (int i = 0, pci = 0; i < npoints; ++i) {
|
for (int i = 0, pci = 0; i < npoints; ++i) {
|
||||||
Gnome::Art::Point &p ((*points)[pci++]);
|
Gnome::Art::Point &p ((*points)[pci++]);
|
||||||
p.set_x (rend + i);
|
p.set_x (rend + i);
|
||||||
p.set_y (_height - (_height * (1.0 - vec.get()[i])));
|
p.set_y (1.0 + effective_height - (effective_height * (1.0 - vec.get()[i])));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -1730,7 +1730,7 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn
|
|||||||
for (int i = 0, pci = 0; i < npoints; ++i) {
|
for (int i = 0, pci = 0; i < npoints; ++i) {
|
||||||
Gnome::Art::Point &p ((*points)[pci++]);
|
Gnome::Art::Point &p ((*points)[pci++]);
|
||||||
p.set_x (rend + i);
|
p.set_x (rend + i);
|
||||||
p.set_y (effective_height - (effective_height * vec.get()[i]));
|
p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1149,7 +1149,9 @@ AudioRegion::set_fade_in_length (framecnt_t len)
|
|||||||
_inverse_fade_in->extend_to (len);
|
_inverse_fade_in->extend_to (len);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_fade_in_is_xfade) {
|
if (_session.config.get_xfade_model() == FullCrossfade &&
|
||||||
|
_session.config.get_auto_xfade() &&
|
||||||
|
_fade_in_is_xfade) {
|
||||||
|
|
||||||
/* trim a single other region below us to the new start
|
/* trim a single other region below us to the new start
|
||||||
of the fade.
|
of the fade.
|
||||||
@ -1161,7 +1163,6 @@ AudioRegion::set_fade_in_length (framecnt_t len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_default_fade_in = false;
|
_default_fade_in = false;
|
||||||
send_change (PropertyChange (Properties::fade_in));
|
send_change (PropertyChange (Properties::fade_in));
|
||||||
}
|
}
|
||||||
@ -1186,8 +1187,10 @@ AudioRegion::set_fade_out_length (framecnt_t len)
|
|||||||
_inverse_fade_out->extend_to (len);
|
_inverse_fade_out->extend_to (len);
|
||||||
}
|
}
|
||||||
_default_fade_out = false;
|
_default_fade_out = false;
|
||||||
|
|
||||||
if (_fade_out_is_xfade) {
|
if (_session.config.get_xfade_model() == FullCrossfade &&
|
||||||
|
_session.config.get_auto_xfade() &&
|
||||||
|
_fade_out_is_xfade) {
|
||||||
|
|
||||||
/* trim a single other region below us to the new start
|
/* trim a single other region below us to the new start
|
||||||
of the fade.
|
of the fade.
|
||||||
|
Loading…
Reference in New Issue
Block a user