summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_drag.h
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-08-19 22:01:10 +0000
committerCarl Hetherington <carl@carlh.net>2010-08-19 22:01:10 +0000
commit611c33e6807b028a6a521017188d704445ba1d06 (patch)
treebb150f67b671fbc8905dc9e31f2b42892696329e /gtk2_ardour/editor_drag.h
parent7b6b75f38ff6b34de3f70e36045498f227c1727d (diff)
Snap to note start rather than mouse pointer when dragging MIDI notes. Fixes #3187.
git-svn-id: svn://localhost/ardour2/branches/3.0@7654 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_drag.h')
-rw-r--r--gtk2_ardour/editor_drag.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h
index 647655e7fb..b194366380 100644
--- a/gtk2_ardour/editor_drag.h
+++ b/gtk2_ardour/editor_drag.h
@@ -35,6 +35,12 @@ namespace ARDOUR {
class Location;
}
+namespace Gnome {
+ namespace Canvas {
+ class CanvasNoteEvent;
+ }
+}
+
class Editor;
class EditorCursor;
class TimeAxisView;
@@ -356,6 +362,7 @@ private:
bool at_front;
};
+/** Drags to move MIDI notes */
class NoteDrag : public Drag
{
public:
@@ -367,12 +374,16 @@ class NoteDrag : public Drag
void aborted ();
private:
- MidiRegionView* region;
- double last_x;
- double last_y;
- double drag_delta_x;
- double drag_delta_note;
- bool was_selected;
+
+ ARDOUR::frameoffset_t total_dx () const;
+ int8_t total_dy () const;
+
+ MidiRegionView* _region;
+ Gnome::Canvas::CanvasNoteEvent* _primary;
+ double _cumulative_dx;
+ double _cumulative_dy;
+ bool _was_selected;
+ double _note_height;
};
/** Drag of region gain */