X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fcanvas-note.h;h=49a37c17c9a4e6cc988eb5109fe0c3534f4bf41f;hb=b15e1cba3b11f73f3155c5dbd8a162c2512f5641;hp=97739b42076625525aaddbea1e16929b52407fb3;hpb=8d44391f4ba571c4dbcec0a87033c83414f515e8;p=ardour.git diff --git a/gtk2_ardour/canvas-note.h b/gtk2_ardour/canvas-note.h index 97739b4207..49a37c17c9 100644 --- a/gtk2_ardour/canvas-note.h +++ b/gtk2_ardour/canvas-note.h @@ -29,8 +29,16 @@ namespace Gnome { namespace Canvas { -class CanvasNote : public SimpleRect, public CanvasNoteEvent { -public: +class CanvasNote : public SimpleRect, public CanvasNoteEvent +{ + public: + typedef Evoral::Note NoteType; + + CanvasNote (MidiRegionView& region, + Group& group, + const boost::shared_ptr note = boost::shared_ptr(), + bool with_events = true); + double x1() { return property_x1(); } double y1() { return property_y1(); } double x2() { return property_x2(); } @@ -39,33 +47,25 @@ public: void set_outline_color(uint32_t c) { property_outline_color_rgba() = c; hide(); show(); } void set_fill_color(uint32_t c) { property_fill_color_rgba() = c; hide(); show(); } - bool on_event(GdkEvent* ev); - - enum NoteEnd { - NOTE_ON, - NOTE_OFF - }; - - enum NoteState { - None, - RelativeResize, - AbsoluteResize - }; + void show() { SimpleRect::show(); } + void hide() { SimpleRect::hide(); } - CanvasNote( - MidiRegionView& region, - Group& group, - const boost::shared_ptr note = boost::shared_ptr()) + bool on_event(GdkEvent* ev); + void move_event(double dx, double dy); +}; - : SimpleRect(group), CanvasNoteEvent(region, this, note), _note_state(None) - { +class NoEventCanvasNote : public CanvasNote +{ + public: + NoEventCanvasNote (MidiRegionView& region, + Group& group, + const boost::shared_ptr note = boost::shared_ptr()) + : 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; } - -protected: - NoteState _note_state; - -private: - }; } // namespace Gnome