diff options
author | David Robillard <d@drobilla.net> | 2008-03-15 00:37:17 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-03-15 00:37:17 +0000 |
commit | 2aad1914404ba51a00930fd7f385f319027b1ece (patch) | |
tree | e30c6658e8cba8408cc8c42c4c2e48fcc0cf0e8c /gtk2_ardour/canvas-note.h | |
parent | 704e5b809be940437266a2845c704c0e01dd47f4 (diff) |
Apply note resizing patch from hans.
git-svn-id: svn://localhost/ardour2/branches/3.0@3145 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/canvas-note.h')
-rw-r--r-- | gtk2_ardour/canvas-note.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/gtk2_ardour/canvas-note.h b/gtk2_ardour/canvas-note.h index 3948765d66..d6c1d95553 100644 --- a/gtk2_ardour/canvas-note.h +++ b/gtk2_ardour/canvas-note.h @@ -1,6 +1,7 @@ /* - Copyright (C) 2007 Paul Davis + Copyright (C) 2007 Paul Davis Author: Dave Robillard + Author: Hans Baier This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,16 +39,34 @@ public: : SimpleRect(group), CanvasMidiEvent(region, this, note) { } - + double x1() { return property_x1(); } double y1() { return property_y1(); } double x2() { return property_x2(); } double y2() { return property_y2(); } - + void set_outline_color(uint32_t c) { property_outline_color_rgba() = c; } void set_fill_color(uint32_t c) { property_fill_color_rgba() = c; } - - bool on_event(GdkEvent* ev) { return CanvasMidiEvent::on_event(ev); } + + bool on_event(GdkEvent* ev); + + enum NoteEnd { + NOTE_ON, + NOTE_OFF + }; + + enum Mouse2State { + None, + RelativeResize, + AbsoluteResize + }; + +protected: + Mouse2State _mouse2_state; + +private: + // single click resizing with mouse-2 + void resize_note(double pressed_x, double event_x, double middle_point); }; } // namespace Gnome |