Allow creation of region gain points by clicking on a line.
- Also fixes new AutomationLine points having huge offsets on creation via line click (window vs canvas event sample).
This commit is contained in:
parent
1387e756de
commit
1963c3ff10
@ -688,17 +688,18 @@ bool
|
||||
Editor::canvas_line_event (GdkEvent *event, ArdourCanvas::Item* item, AutomationLine* al)
|
||||
{
|
||||
ItemType type;
|
||||
|
||||
if (dynamic_cast<AudioRegionGainLine*> (al) != 0) {
|
||||
AudioRegionGainLine* gl;
|
||||
if ((gl = dynamic_cast<AudioRegionGainLine*> (al)) != 0) {
|
||||
type = GainLineItem;
|
||||
clicked_regionview = &gl->region_view ();
|
||||
} else {
|
||||
type = AutomationLineItem;
|
||||
clicked_regionview = 0;
|
||||
}
|
||||
|
||||
clicked_control_point = 0;
|
||||
clicked_axisview = &al->trackview;
|
||||
clicked_routeview = dynamic_cast<RouteTimeAxisView*>(clicked_axisview);
|
||||
clicked_regionview = 0;
|
||||
|
||||
return typed_event (item, event, type);
|
||||
}
|
||||
|
@ -4057,8 +4057,9 @@ MarkerDrag::update_item (Location*)
|
||||
|
||||
ControlPointDrag::ControlPointDrag (Editor* e, ArdourCanvas::Item* i)
|
||||
: Drag (e, i),
|
||||
_cumulative_x_drag (0),
|
||||
_cumulative_y_drag (0)
|
||||
_cumulative_x_drag (0)
|
||||
, _cumulative_y_drag (0)
|
||||
, _pushing (false)
|
||||
{
|
||||
if (_zero_gain_fraction < 0.0) {
|
||||
_zero_gain_fraction = gain_to_slider_position_with_max (dB_to_coefficient (0.0), Config->get_max_gain());
|
||||
@ -4278,8 +4279,15 @@ LineDrag::finished (GdkEvent* event, bool movement_occured)
|
||||
AutomationTimeAxisView* atv;
|
||||
|
||||
if ((atv = dynamic_cast<AutomationTimeAxisView*>(_editor->clicked_axisview)) != 0) {
|
||||
framepos_t where = _editor->window_event_sample (event, 0, 0);
|
||||
framepos_t where = _editor->canvas_event_sample (event, 0, 0);
|
||||
|
||||
atv->add_automation_event (event, where, event->button.y, false);
|
||||
} else if (dynamic_cast<AudioTimeAxisView*>(_editor->clicked_axisview) != 0) {
|
||||
AudioRegionView* arv;
|
||||
|
||||
if ((arv = dynamic_cast<AudioRegionView*>(_editor->clicked_regionview)) != 0) {
|
||||
arv->add_gain_point_event (arv->get_canvas_group (), event, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ class AudioRegionGainLine : public AutomationLine
|
||||
void end_drag (bool with_push, uint32_t final_index);
|
||||
|
||||
void remove_point (ControlPoint&);
|
||||
|
||||
AudioRegionView& region_view () { return rv; }
|
||||
|
||||
private:
|
||||
PBD::ScopedConnection _region_changed_connection;
|
||||
|
Loading…
Reference in New Issue
Block a user