Ardour  8.12
hit.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013-2017 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2014-2015 David Robillard <d@drobilla.net>
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 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.
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,
38  const std::shared_ptr<NoteType> note = std::shared_ptr<NoteType>(),
39  bool with_events = true);
40 
41  ~Hit();
42 
43  void show ();
44  void hide ();
45 
50 
52 
54 
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 
68 
69  double visual_velocity() const;
70 
71 private:
73 };
74 
75 #endif /* __gtk_ardour_hit_h__ */
Definition: hit.h:31
Evoral::Note< Temporal::Beats > NoteType
Definition: hit.h:33
ArdourCanvas::Coord y0() const
void set_fill_color(uint32_t)
void set_outline_color(uint32_t)
double visual_velocity() const
bool big_enough_to_trim() const
Definition: hit.h:65
void set_height(ArdourCanvas::Coord)
ArdourCanvas::Coord x0() const
~Hit()
static ArdourCanvas::Points points(ArdourCanvas::Distance height)
Hit(MidiRegionView &region, ArdourCanvas::Item *parent, double size, const std::shared_ptr< NoteType > note=std::shared_ptr< NoteType >(), bool with_events=true)
ArdourCanvas::Coord x1() const
ArdourCanvas::Duple position()
void move_event(double, double)
void hide()
void show()
ArdourCanvas::Polygon * _polygon
Definition: hit.h:72
ArdourCanvas::Coord y1() const
void set_position(ArdourCanvas::Duple)
void set_ignore_events(bool)
const std::shared_ptr< NoteType > note() const
Definition: note_base.h:117
std::vector< Duple > Points
gint height
Definition: xcursors.h:1