ardour
hit.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2007 Paul Davis
3  Author: Dave Robillard
4 
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.
9 
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.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19 
20 #ifndef __gtk_ardour_hit_h__
21 #define __gtk_ardour_hit_h__
22 
23 #include <iostream>
24 #include "note_base.h"
25 
26 namespace ArdourCanvas {
27  class Polygon;
28 }
29 
30 class Hit : public NoteBase
31 {
32 public:
34 
35  Hit (MidiRegionView& region,
36  ArdourCanvas::Item* parent,
37  double size,
39  bool with_events = true);
40 
41  ~Hit();
42 
43  void show ();
44  void hide ();
45 
46  ArdourCanvas::Coord x0 () const;
47  ArdourCanvas::Coord y0 () const;
48  ArdourCanvas::Coord x1 () const;
49  ArdourCanvas::Coord y1 () const;
50 
51  ArdourCanvas::Duple position ();
52 
53  void set_position (ArdourCanvas::Duple);
54 
55  void set_height (ArdourCanvas::Coord);
56 
57  void set_outline_color (uint32_t);
58  void set_fill_color (uint32_t);
59 
60  void set_ignore_events (bool);
61 
62  void move_event (double, double);
63 
64  /* no trimming of percussive hits */
65  bool big_enough_to_trim() const { return false; }
66 
67  static ArdourCanvas::Points points(ArdourCanvas::Distance height);
68 
69 private:
70  ArdourCanvas::Polygon* _polygon;
71 };
72 
73 #endif /* __gtk_ardour_hit_h__ */
ArdourCanvas::Duple position()
Definition: hit.cc:102
void set_fill_color(uint32_t)
Definition: hit.cc:62
ArdourCanvas::Coord x1() const
Definition: hit.cc:121
ArdourCanvas::Coord y1() const
Definition: hit.cc:135
void hide()
Definition: hit.cc:74
Hit(MidiRegionView &region, ArdourCanvas::Item *parent, double size, const boost::shared_ptr< NoteType > note=boost::shared_ptr< NoteType >(), bool with_events=true)
Definition: hit.cc:30
ArdourCanvas::Coord y0() const
Definition: hit.cc:128
Definition: hit.h:30
void set_position(ArdourCanvas::Duple)
Definition: hit.cc:108
void show()
Definition: hit.cc:68
Evoral::Note< Evoral::Beats > NoteType
Definition: hit.h:33
void move_event(double, double)
Definition: hit.cc:45
~Hit()
Definition: hit.cc:39
const boost::shared_ptr< NoteType > note() const
Definition: note_base.h:103
static ArdourCanvas::Points points(ArdourCanvas::Distance height)
Definition: hit.cc:80
bool big_enough_to_trim() const
Definition: hit.h:65
ArdourCanvas::Polygon * _polygon
Definition: hit.h:70
void set_outline_color(uint32_t)
Definition: hit.cc:56
void set_ignore_events(bool)
Definition: hit.cc:142
ArdourCanvas::Coord x0() const
Definition: hit.cc:114
void set_height(ArdourCanvas::Coord)
Definition: hit.cc:96