#include "canvas-simplerect.h"
#include "canvas-curve.h"
#include "crossfade_view.h"
+#include "global_signals.h"
#include "gui_thread.h"
#include "rgb_macros.h"
#include "audio_time_axis.h"
crossfade (xf),
left_view (lview),
right_view (rview),
- _all_in_view (false)
+ _all_in_view (false),
+ _child_height (0)
{
_valid = true;
_visible = true;
}
void
-CrossfadeView::set_height (double h)
+CrossfadeView::set_heights (double fade_height, double child_height)
{
- if (h > TimeAxisView::preset_height (HeightSmall)) {
- h -= NAME_HIGHLIGHT_SIZE;
+ if (child_height > TimeAxisViewItem::NAME_HIGHLIGHT_THRESH) {
+ fade_height -= NAME_HIGHLIGHT_SIZE;
+ child_height -= NAME_HIGHLIGHT_SIZE;
}
- TimeAxisViewItem::set_height (h);
+ TimeAxisViewItem::set_height (fade_height);
+ _child_height = child_height;
redraw_curves ();
}
/* Hence the number of points that we will render */
int32_t const npoints = editor.frame_to_pixel (max_frames - min_frames);
-
+
if (!_visible || !crossfade->active() || npoints < 3) {
fade_in->hide();
fade_out->hide();
for (int i = 0, pci = 0; i < npoints; ++i) {
Art::Point &p = (*points)[pci++];
p.set_x (xoff + i + 1);
- p.set_y (_height - ((_height - 2) * vec[i]));
+
+ double const ho = crossfade->in()->layer() > crossfade->out()->layer() ? _child_height : _height;
+ p.set_y (ho - ((_child_height - 2) * vec[i]));
}
fade_in->property_points() = *points;
for (int i = 0, pci = 0; i < npoints; ++i) {
Art::Point &p = (*points)[pci++];
p.set_x (xoff + i + 1);
- p.set_y (_height - ((_height - 2) * vec[i]));
+
+ double const ho = crossfade->in()->layer() < crossfade->out()->layer() ? _child_height : _height;
+ p.set_y (ho - ((_child_height - 2) * vec[i]));
}
-
+
fade_out->property_points() = *points;
delete [] vec;
_valid = yn;
}
-AudioRegionView&
-CrossfadeView::upper_regionview () const
-{
- if (left_view.region()->layer() > right_view.region()->layer()) {
- return left_view;
- } else {
- return right_view;
- }
-}
-
void
CrossfadeView::show ()
{
the other case where the horizontal position change will uncover `undrawn'
sections).
*/
-
+
if (!_all_in_view) {
redraw_curves ();
}