diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-11-27 19:31:33 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-11-27 19:31:33 +0000 |
commit | 00afa40d458debc3fc53d25a6c077881678ea53e (patch) | |
tree | 78825f62718a26b241efc1427156844b9bdaa2c3 /gtk2_ardour/automation_line.cc | |
parent | db1f21d75ca02c9ed953540e9aaeeb4d3a98d5bf (diff) |
many small changes, see ardour-dev for more
git-svn-id: svn://localhost/ardour2/trunk@1160 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/automation_line.cc')
-rw-r--r-- | gtk2_ardour/automation_line.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index 44c100fd37..cdb978fb84 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -21,6 +21,7 @@ #include <cmath> #include <climits> #include <vector> +#include <fstream> #include <pbd/stl_delete.h> #include <pbd/memento_command.h> @@ -416,7 +417,7 @@ AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool wi ControlPoint* after; /* find the first point that can't move */ - + for (uint32_t n = cp.view_index + 1; (after = nth (n)) != 0; ++n) { if (!after->can_slide) { x_limit = after->get_x() - 1.0; @@ -748,7 +749,8 @@ AutomationLine::determine_visible_control_points (ALPoints& points) if (view_index && pi != npoints && /* not the first, not the last */ (((this_rx == prev_rx) && (this_ry == prev_ry)) || /* same point */ - (((this_rx - prev_rx) < (box_size + 2)) && /* too close horizontally */ + (this_rx == prev_rx) || /* identical x coordinate */ + (((this_rx - prev_rx) < (box_size + 2)) && /* not identical, but still too close horizontally */ ((abs ((int)(this_ry - prev_ry)) < (int) (box_size + 2)))))) { /* too close vertically */ continue; } @@ -849,9 +851,11 @@ AutomationLine::determine_visible_control_points (ALPoints& points) if (_visible) { line->show (); } + } set_selected_points (trackview.editor.get_selection().points); + } string @@ -901,7 +905,7 @@ AutomationLine::start_drag (ControlPoint* cp, float fraction) } trackview.editor.current_session()->begin_reversible_command (str); - trackview.editor.current_session()->add_command (new MementoCommand<AutomationLine>(*this, &get_state(), 0)); + trackview.editor.current_session()->add_command (new MementoCommand<AutomationList>(alist, &get_state(), 0)); first_drag_fraction = fraction; last_drag_fraction = fraction; @@ -950,7 +954,7 @@ AutomationLine::end_drag (ControlPoint* cp) update_pending = false; - trackview.editor.current_session()->add_command (new MementoCommand<AutomationLine>(*this, 0, &get_state())); + trackview.editor.current_session()->add_command (new MementoCommand<AutomationList>(alist, 0, &alist.get_state())); trackview.editor.current_session()->commit_reversible_command (); trackview.editor.current_session()->set_dirty (); } @@ -1027,11 +1031,11 @@ AutomationLine::remove_point (ControlPoint& cp) model_representation (cp, mr); trackview.editor.current_session()->begin_reversible_command (_("remove control point")); - XMLNode &before = get_state(); + XMLNode &before = alist.get_state(); alist.erase (mr.start, mr.end); - trackview.editor.current_session()->add_command(new MementoCommand<AutomationLine>(*this, &before, &get_state())); + trackview.editor.current_session()->add_command(new MementoCommand<AutomationList>(alist, &before, &alist.get_state())); trackview.editor.current_session()->commit_reversible_command (); trackview.editor.current_session()->set_dirty (); } |