diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-05-28 16:37:04 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-05-28 16:37:04 +0000 |
commit | 3e966771d042455a50a01e786af2af7b6f407395 (patch) | |
tree | b93b553d12b4c903087f26efa5ff06284add0cab /gtk2_ardour/canvas-note.h | |
parent | 3d6493abc9d332132aef250a551d60fe45f7b3eb (diff) |
clean up item event handling in MidiRegionViews by removing unnecessary InteractiveItem inheritance, and keep child->parent event handling order consistent as much as possible
git-svn-id: svn://localhost/ardour2/branches/3.0@7186 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/canvas-note.h')
-rw-r--r-- | gtk2_ardour/canvas-note.h | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/gtk2_ardour/canvas-note.h b/gtk2_ardour/canvas-note.h index 6147941ad2..49a37c17c9 100644 --- a/gtk2_ardour/canvas-note.h +++ b/gtk2_ardour/canvas-note.h @@ -29,10 +29,16 @@ namespace Gnome { namespace Canvas { -class CanvasNote : public SimpleRect, public CanvasNoteEvent { -public: +class CanvasNote : public SimpleRect, public CanvasNoteEvent +{ + public: typedef Evoral::Note<Evoral::MusicalTime> NoteType; + CanvasNote (MidiRegionView& region, + Group& group, + const boost::shared_ptr<NoteType> note = boost::shared_ptr<NoteType>(), + bool with_events = true); + double x1() { return property_x1(); } double y1() { return property_y1(); } double x2() { return property_x2(); } @@ -46,25 +52,16 @@ public: bool on_event(GdkEvent* ev); void move_event(double dx, double dy); - - CanvasNote (MidiRegionView& region, - Group& group, - const boost::shared_ptr<NoteType> note = boost::shared_ptr<NoteType>()) - : SimpleRect(group), CanvasNoteEvent(region, this, note) - { - } }; class NoEventCanvasNote : public CanvasNote { -public: - NoEventCanvasNote ( - MidiRegionView& region, - Group& group, - const boost::shared_ptr<NoteType> note = boost::shared_ptr<NoteType>() - ) - : CanvasNote (region, group, note) {} - + public: + NoEventCanvasNote (MidiRegionView& region, + Group& group, + const boost::shared_ptr<NoteType> note = boost::shared_ptr<NoteType>()) + : CanvasNote (region, group, note, false) {} + double point_vfunc(double, double, int, int, GnomeCanvasItem**) { /* return a huge value to tell the canvas that we're never the item for an event */ return 9999999999999.0; |