update drobilla's fascistic dir-locals.el to force emacs users into whitespace submis...
[ardour.git] / gtk2_ardour / canvas-hit.cc
1 #include "canvas-note.h"
2 #include "midi_region_view.h"
3 #include "public_editor.h"
4 #include "evoral/Note.hpp"
5 #include "utils.h"
6
7 using namespace ARDOUR;
8
9 namespace Gnome {
10 namespace Canvas {
11
12 CanvasHit::CanvasHit (MidiRegionView&                   region,
13                       Group&                            group,
14                       double                            size,
15                       const boost::shared_ptr<NoteType> note,
16                       bool with_events) 
17         : Diamond(group, size)
18         , CanvasNoteEvent(region, this, note)
19 {
20         if (with_events) {
21                 signal_event().connect (sigc::mem_fun (*this, &CanvasHit::on_event));
22         }
23 }
24
25 bool
26 CanvasHit::on_event(GdkEvent* ev)
27 {
28         if (!CanvasNoteEvent::on_event (ev)) {
29                 return _region.get_time_axis_view().editor().canvas_note_event (ev, this);
30         } 
31         return true;
32 }
33
34 void
35 CanvasHit::move_event(double dx, double dy)
36 {
37         move_by (dx, dy);
38 }
39
40 } // namespace Gnome
41 } // namespace Canvas