CrossfadeViewList::iterator i = crossfade_views.find (crossfade);
if (i != crossfade_views.end()) {
- if (!crossfades_visible || _layer_display == Stacked) {
+ if (!crossfades_visible) {
i->second->hide();
} else {
i->second->show ();
cv->set_valid (true);
crossfade->Invalidated.connect (mem_fun (*this, &AudioStreamView::remove_crossfade));
crossfade_views[cv->crossfade] = cv;
- if (!_trackview.session().config.get_xfades_visible() || !crossfades_visible || _layer_display == Stacked) {
+ if (!_trackview.session().config.get_xfades_visible() || !crossfades_visible) {
cv->hide ();
}
+
+ update_content_height (cv);
}
void
// Flag crossfade views as invalid
for (xi = crossfade_views.begin(); xi != crossfade_views.end(); ++xi) {
xi->second->set_valid (false);
- if (xi->second->visible() && _layer_display != Stacked) {
+ if (xi->second->visible()) {
xi->second->show ();
}
}
AudioStreamView::reveal_xfades_involving (AudioRegionView& rv)
{
for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) {
- if (i->second->crossfade->involves (rv.audio_region()) && i->second->visible() && _layer_display != Stacked) {
+ if (i->second->crossfade->involves (rv.audio_region()) && i->second->visible()) {
i->second->show ();
}
}
AudioStreamView::update_contents_height ()
{
StreamView::update_contents_height ();
-
+
for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) {
- if (_layer_display == Overlaid) {
- i->second->show ();
- i->second->set_height (height);
- } else {
- i->second->hide ();
- }
+ update_content_height (i->second);
+ }
+}
+
+void
+AudioStreamView::update_content_height (CrossfadeView* cv)
+{
+ cv->show ();
+
+ if (_layer_display == Overlaid) {
+
+ cv->set_y (0);
+ cv->set_height (height);
+
+ } else {
+
+ layer_t const inl = cv->crossfade->in()->layer ();
+ layer_t const outl = cv->crossfade->out()->layer ();
+
+ layer_t const high = max (inl, outl);
+ layer_t const low = min (inl, outl);
+
+ const double h = child_height ();
+
+ cv->set_y ((_layers - high - 1) * h);
+ cv->set_height ((high - low + 1) * h);
+
}
}
void
CrossfadeView::set_height (double height)
{
+ double h = 0;
if (height <= TimeAxisView::hSmaller) {
- TimeAxisViewItem::set_height (height - 3);
+ h = height - 3;
} else {
- TimeAxisViewItem::set_height (height - NAME_HIGHLIGHT_SIZE - 3 );
+ h = height - NAME_HIGHLIGHT_SIZE - 3;
}
+ TimeAxisViewItem::set_height (h);
+
+ _height = h;
redraw_curves ();
}
Points* points;
int32_t npoints;
float* vec;
- double h;
if (!crossfade->following_overlap()) {
/* curves should not be visible */
return;
}
- /*
- At "height - 3.0" the bottom of the crossfade touches the name highlight or the bottom of the track (if the
- track is either Small or Smaller.
- */
-
- double tav_height = get_time_axis_view().current_height();
- if (tav_height == TimeAxisView::hSmaller ||
- tav_height == TimeAxisView::hSmall) {
- h = tav_height - 3.0;
- } else {
- h = tav_height - NAME_HIGHLIGHT_SIZE - 3.0;
- }
-
- if (h < 0) {
+ if (_height < 0) {
/* no space allocated yet */
return;
}
for (int i = 0, pci = 0; i < npoints; ++i) {
Art::Point &p = (*points)[pci++];
p.set_x(i);
- p.set_y(2.0 + h - (h * vec[i]));
+ p.set_y(2.0 + _height - (_height * vec[i]));
}
fade_in->property_points() = *points;
for (int i = 0, pci = 0; i < npoints; ++i) {
Art::Point &p = (*points)[pci++];
p.set_x(i);
- p.set_y(2.0 + h - (h * vec[i]));
+ p.set_y(2.0 + _height - (_height * vec[i]));
}
fade_out->property_points() = *points;