X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fnote.cc;h=3adcd751f8f8d8c2f2cb163684c1159bf2f5b986;hb=b49e3982502f5e483422960dc11be967d7c790f4;hp=c9a60a7de93e7247277448b897c308ccee6bd416;hpb=b855e5f3220027502a3c88f189d511fe2a5a3c2b;p=ardour.git diff --git a/gtk2_ardour/note.cc b/gtk2_ardour/note.cc index c9a60a7de9..3adcd751f8 100644 --- a/gtk2_ardour/note.cc +++ b/gtk2_ardour/note.cc @@ -19,7 +19,10 @@ */ #include "evoral/Note.hpp" + #include "canvas/rectangle.h" +#include "canvas/debug.h" + #include "note.h" #include "midi_region_view.h" #include "public_editor.h" @@ -28,17 +31,11 @@ using namespace ARDOUR; using namespace ArdourCanvas; Note::Note ( - MidiRegionView& region, - Group* group, - const boost::shared_ptr note, - bool with_events - ) + MidiRegionView& region, Group* group, const boost::shared_ptr note, bool with_events) : NoteBase (region, with_events, note) + , _rectangle (new ArdourCanvas::Rectangle (group)) { - _rectangle = new ArdourCanvas::Rectangle (group); -#ifdef CANVAS_DEBUG - _rectangle->name = "note"; -#endif + CANVAS_DEBUG_NAME (_rectangle, "note"); set_item (_rectangle); } @@ -50,15 +47,7 @@ Note::~Note () void Note::move_event (double dx, double dy) { - _rectangle->move (Duple (dx, dy)); - - /* XXX */ - // if (_text) { - // _text->hide(); - // _text->property_x() = _text->property_x() + dx; - // _text->property_y() = _text->property_y() + dy; - // _text->show(); - // } + _rectangle->set (_rectangle->get().translate (Duple (dx, dy))); } Coord @@ -134,11 +123,17 @@ Note::set_y1 (Coord y1) } void -Note::set_outline_what (int what) +Note::set_outline_what (ArdourCanvas::Rectangle::What what) { _rectangle->set_outline_what (what); } +void +Note::set_outline_all () +{ + _rectangle->set_outline_all (); +} + void Note::set_ignore_events (bool ignore) {