summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_drag.h
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-12-11 12:54:54 +0000
committerCarl Hetherington <carl@carlh.net>2011-12-11 12:54:54 +0000
commitab4e7cf4720071b709742dfaa1311244cb0d093f (patch)
tree9320560d5d41c4a74967e3ee0fb8c2f238f101c0 /gtk2_ardour/editor_drag.h
parente3b4fa678d26055463ada04448987f025b6cac49 (diff)
Move note creation code into a Drag; fix snapping of note
starts when drag-created (part of #4505). git-svn-id: svn://localhost/ardour2/branches/3.0@10972 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_drag.h')
-rw-r--r--gtk2_ardour/editor_drag.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h
index 44b2d50767..72a7534be2 100644
--- a/gtk2_ardour/editor_drag.h
+++ b/gtk2_ardour/editor_drag.h
@@ -458,6 +458,25 @@ class NoteDrag : public Drag
double _note_height;
};
+class NoteCreateDrag : public Drag
+{
+public:
+ NoteCreateDrag (Editor *, ArdourCanvas::Item *, MidiRegionView *);
+ ~NoteCreateDrag ();
+
+ void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
+ void motion (GdkEvent *, bool);
+ void finished (GdkEvent *, bool);
+ void aborted (bool);
+
+private:
+ double y_to_region (double) const;
+
+ MidiRegionView* _region_view;
+ ArdourCanvas::SimpleRect* _drag_rect;
+ framepos_t _note[2];
+};
+
/** Drag to move MIDI patch changes */
class PatchChangeDrag : public Drag
{