use new action map API instead of ActionManager::get_action
[ardour.git] / gtk2_ardour / note.h
1 /*
2     Copyright (C) 2007 Paul Davis
3     Author: Dave Robillard
4     Author: Hans Baier
5
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software
18     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 #ifndef __gtk_ardour_note_h__
22 #define __gtk_ardour_note_h__
23
24 #include <iostream>
25 #include "note_base.h"
26 #include "midi_util.h"
27
28 namespace ArdourCanvas {
29         class Container;
30         class Note;
31 }
32
33 class Note : public NoteBase
34 {
35 public:
36         typedef Evoral::Note<Temporal::Beats> NoteType;
37
38         Note (MidiRegionView&                   region,
39               ArdourCanvas::Item*               parent,
40               const boost::shared_ptr<NoteType> note = boost::shared_ptr<NoteType>(),
41               bool with_events = true);
42
43         ~Note ();
44
45         ArdourCanvas::Coord x0 () const;
46         ArdourCanvas::Coord y0 () const;
47         ArdourCanvas::Coord x1 () const;
48         ArdourCanvas::Coord y1 () const;
49
50         void set (ArdourCanvas::Rect);
51         void set_x0 (ArdourCanvas::Coord);
52         void set_y0 (ArdourCanvas::Coord);
53         void set_x1 (ArdourCanvas::Coord);
54         void set_y1 (ArdourCanvas::Coord);
55
56         void set_outline_what (ArdourCanvas::Rectangle::What);
57         void set_outline_all ();
58
59         void set_outline_color (uint32_t);
60         void set_fill_color (uint32_t);
61
62         void show ();
63         void hide ();
64
65         void set_ignore_events (bool);
66
67         void set_velocity (double);
68         void move_event (double dx, double dy);
69
70 private:
71         ArdourCanvas::Note* _note;
72 };
73
74 #endif /* __gtk_ardour_note_h__ */