diff options
author | nick_m <mainsbridge@gmail.com> | 2016-11-21 04:57:32 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-11-21 04:57:32 +1100 |
commit | e0c06f39e197fae146b15361327de54cb1a14443 (patch) | |
tree | 22a29728f185cbc3d3bea0ecda34e0bfdb100504 /gtk2_ardour/editor_drag.cc | |
parent | eef18c47fd5d4851ef8acfd11c9c70d1ce7b8998 (diff) |
clean up HitCreateDrag. should be a no-op.
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 12bac904a2..4cba008f5f 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -6336,7 +6336,6 @@ NoteCreateDrag::aborted (bool) HitCreateDrag::HitCreateDrag (Editor* e, ArdourCanvas::Item* i, MidiRegionView* rv) : Drag (e, i) , _region_view (rv) - , _y (0.0) { } @@ -6344,21 +6343,6 @@ HitCreateDrag::~HitCreateDrag () { } -framecnt_t -HitCreateDrag::grid_frames (framepos_t t) const -{ - bool success; - Evoral::Beats grid_beats = _editor->get_grid_type_as_beats (success, t); - if (!success) { - grid_beats = Evoral::Beats(1); - } - const Evoral::Beats t_beats = _region_view->region_frames_to_region_beats (t); - - return _region_view->region_beats_to_region_frames (t_beats + grid_beats) - - _region_view->region_beats_to_region_frames (t_beats); - -} - void HitCreateDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor) { @@ -6379,9 +6363,9 @@ HitCreateDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor) const framepos_t start = map.frame_at_quarter_note (eqaf) - _region_view->region()->position(); MidiStreamView* sv = _region_view->midi_stream_view (); - _y = sv->note_to_y (sv->y_to_note (y_to_region (event->button.y))); + const double y = sv->note_to_y (sv->y_to_note (y_to_region (event->button.y))); - _region_view->create_note_at (start, _y, grid_beats, event->button.state, false); + _region_view->create_note_at (start, y, grid_beats, event->button.state, false); } void @@ -6400,7 +6384,7 @@ HitCreateDrag::motion (GdkEvent* event, bool) const framepos_t start = map.frame_at_quarter_note (eqaf) - _region_view->region()->position (); MidiStreamView* sv = _region_view->midi_stream_view (); - _y = sv->note_to_y (sv->y_to_note (y_to_region (event->button.y))); + const double y = sv->note_to_y (sv->y_to_note (y_to_region (event->button.y))); bool success = false; Evoral::Beats grid_beats = _editor->get_grid_type_as_beats (success, pf); @@ -6408,7 +6392,7 @@ HitCreateDrag::motion (GdkEvent* event, bool) grid_beats = Evoral::Beats(1); } - _region_view->create_note_at (start, _y, grid_beats, event->button.state, false); + _region_view->create_note_at (start, y, grid_beats, event->button.state, false); } |