CANVAS_DEBUG_NAME (line, "region gain envelope line");
line->set_data ("line", this);
line->set_outline_width (2.0);
+ line->set_covers_threshold (4.0);
line->Event.connect (sigc::mem_fun (*this, &AutomationLine::event_handler));
}
void
-AutomationLine::show ()
+AutomationLine::update_visibility ()
{
if (_visible & Line) {
/* Only show the line there are some points, otherwise we may show an out-of-date line
} else {
line->hide ();
}
- } else {
- line->hide();
- /* if the line is not visible, then no control points should be visible */
- for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
- (*i)->hide ();
- }
- return;
- }
- if (_visible & ControlPoints) {
- for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
- (*i)->show ();
- }
- } else if (_visible & SelectedControlPoints) {
- for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
- if ((*i)->get_selected()) {
+ if (_visible & ControlPoints) {
+ for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
(*i)->show ();
- } else {
+ }
+ } else if (_visible & SelectedControlPoints) {
+ for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
+ if ((*i)->get_selected()) {
+ (*i)->show ();
+ } else {
+ (*i)->hide ();
+ }
+ }
+ } else {
+ for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
(*i)->hide ();
}
}
+
} else {
+ line->hide ();
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
(*i)->hide ();
}
}
+
}
void
line->set (line_points);
- if (_visible && alist->interpolation() != AutomationList::Discrete) {
- line->show();
- }
+ update_visibility ();
}
set_selected_points (trackview.editor().get_selection().points);
_visible = VisibleAspects (_visible | va);
if (old != _visible) {
- show ();
+ update_visibility ();
}
}
{
if (_visible != va) {
_visible = va;
- show ();
+ update_visibility ();
}
}
_visible = VisibleAspects (_visible & ~va);
if (old != _visible) {
- show ();
+ update_visibility ();
}
}
y = max (0.0, y);
y = min (2.0, y);
} else if (alist->parameter().type() == PanAzimuthAutomation ||
- alist->parameter().type() == PanElevationAutomation ||
- alist->parameter().type() == PanWidthAutomation) {
+ alist->parameter().type() == PanElevationAutomation) {
y = 1.0 - y;
+ } else if (alist->parameter().type() == PanWidthAutomation) {
+ y = 2.0 * y - 1.0;
} else if (alist->parameter().type() == PluginAutomation) {
y = y * (double)(alist->get_max_y()- alist->get_min_y()) + alist->get_min_y();
} else {
alist->parameter().type() == EnvelopeAutomation) {
y = gain_to_slider_position_with_max (y, Config->get_max_gain());
} else if (alist->parameter().type() == PanAzimuthAutomation ||
- alist->parameter().type() == PanElevationAutomation ||
- alist->parameter().type() == PanWidthAutomation) {
- // vertical coordinate axis reversal
+ alist->parameter().type() == PanElevationAutomation) {
y = 1.0 - y;
+ } else if (alist->parameter().type() == PanWidthAutomation) {
+ y = .5 + y * .5;
} else if (alist->parameter().type() == PluginAutomation) {
y = (y - alist->get_min_y()) / (double)(alist->get_max_y()- alist->get_min_y());
} else {