2 * Copyright (C) 2013-2017 Paul Davis <paul@linuxaudiosystems.com>
3 * Copyright (C) 2014-2015 David Robillard <d@drobilla.net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef __gtk_ardour_hit_h__
21 #define __gtk_ardour_hit_h__
24 #include "note_base.h"
26 namespace ArdourCanvas {
30 class Hit : public NoteBase
33 typedef Evoral::Note<Temporal::Beats> NoteType;
35 Hit (MidiRegionView& region,
36 ArdourCanvas::Item* parent,
38 const boost::shared_ptr<NoteType> note = boost::shared_ptr<NoteType>(),
39 bool with_events = true);
46 ArdourCanvas::Coord x0 () const;
47 ArdourCanvas::Coord y0 () const;
48 ArdourCanvas::Coord x1 () const;
49 ArdourCanvas::Coord y1 () const;
51 ArdourCanvas::Duple position ();
53 void set_position (ArdourCanvas::Duple);
55 void set_height (ArdourCanvas::Coord);
57 void set_outline_color (uint32_t);
58 void set_fill_color (uint32_t);
60 void set_ignore_events (bool);
62 void move_event (double, double);
64 /* no trimming of percussive hits */
65 bool big_enough_to_trim() const { return false; }
67 static ArdourCanvas::Points points(ArdourCanvas::Distance height);
70 ArdourCanvas::Polygon* _polygon;
73 #endif /* __gtk_ardour_hit_h__ */