summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_drag.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2015-08-27 02:20:43 +1000
committernick_m <mainsbridge@gmail.com>2015-08-27 02:20:43 +1000
commit1963c3ff10c483bd8e3dec9cbd88cce54656b029 (patch)
treea81011856078d28d9fb51debed61de44ed199b7b /gtk2_ardour/editor_drag.cc
parent1387e756def903c7987941bab6b50c1f25ab7141 (diff)
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).
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r--gtk2_ardour/editor_drag.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 81e6cb7dff..04590da885 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -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);
+ }
}
}
}