Ardour  9.0-pre0-582-g084a23a80d
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 #pragma once
21 
22 #include <iostream>
23 #include "note_base.h"
24 
25 namespace ArdourCanvas {
26  class Polygon;
27 }
28 
29 class Hit : public NoteBase
30 {
31 public:
33 
35  ArdourCanvas::Item* parent,
36  double size,
37  const std::shared_ptr<NoteType> note = std::shared_ptr<NoteType>(),
38  bool with_events = true);
39 
40  ~Hit();
41 
42  void show ();
43  void hide ();
44 
49 
51 
53 
55 
56  void set_outline_color (uint32_t);
57  void set_fill_color (uint32_t);
58 
59  void set_ignore_events (bool);
60 
61  void move_event (double, double);
62 
63  /* no trimming of percussive hits */
64  bool big_enough_to_trim() const { return false; }
65 
67 
68  double visual_velocity() const;
69 
70 private:
72 };
73 
Definition: hit.h:30
Hit(MidiView &region, ArdourCanvas::Item *parent, double size, const std::shared_ptr< NoteType > note=std::shared_ptr< NoteType >(), bool with_events=true)
Evoral::Note< Temporal::Beats > NoteType
Definition: hit.h:32
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:64
void set_height(ArdourCanvas::Coord)
ArdourCanvas::Coord x0() const
~Hit()
static ArdourCanvas::Points points(ArdourCanvas::Distance height)
ArdourCanvas::Coord x1() const
ArdourCanvas::Duple position()
void move_event(double, double)
void hide()
void show()
ArdourCanvas::Polygon * _polygon
Definition: hit.h:71
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:116
PBD::PropertyDescriptor< bool > region
std::vector< Duple > Points
gint height
Definition: xcursors.h:1