Ardour  8.12
velocity_ghost_region.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2014 David Robillard <d@drobilla.net>
3  * Copyright (C) 2009-2010 Carl Hetherington <carl@carlh.net>
4  * Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
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 along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #ifndef __gtk_ardour_velocity_region_view_h__
22 #define __gtk_ardour_velocity_region_view_h__
23 
24 #include "canvas/poly_line.h"
25 
26 #include "ghostregion.h"
27 
28 namespace ArdourCanvas {
29 class Lollipop;
30 }
31 
33 {
34 public:
35  VelocityGhostRegion (MidiRegionView&, TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
37 
40  void update_note (GhostEvent* note);
41  void update_hit (GhostEvent* hit);
44 
45  void set_colors ();
47 
48  int y_position_to_velocity (double y) const;
49 
50  void set_selected (bool);
51 
52  bool line_draw_motion (ArdourCanvas::Duple const & d, ArdourCanvas::Rectangle const & r, double last_x);
53  bool line_extended (ArdourCanvas::Duple const & from, ArdourCanvas::Duple const & to, ArdourCanvas::Rectangle const & r, double last_x);
54 
55  void start_line_drag ();
56  void end_line_drag (bool did_change);
57 
59 
60 private:
61  bool dragging;
65  bool selected;
66 
70  void lollis_close_to_x (int x, double distance, std::vector<GhostEvent*>& events);
71  void lollis_between (int x0, int x1, std::vector<GhostEvent*>& events);
74 };
75 
76 #endif /* __gtk_ardour_velocity_region_view_h__ */
ArdourCanvas::Rectangle * base_rect
Definition: ghostregion.h:83
EventList events
Definition: ghostregion.h:151
bool lollevent(GdkEvent *, MidiGhostRegion::GhostEvent *)
void note_selected(NoteBase *)
ArdourCanvas::Rectangle & base_item()
void update_contents_height()
bool line_draw_motion(ArdourCanvas::Duple const &d, ArdourCanvas::Rectangle const &r, double last_x)
void lollis_between(int x0, int x1, std::vector< GhostEvent * > &events)
void end_line_drag(bool did_change)
ArdourCanvas::PolyLine * dragging_line
void drag_lolli(ArdourCanvas::Lollipop *l, GdkEventMotion *ev)
void set_size_and_position(MidiGhostRegion::GhostEvent &)
int y_position_to_velocity(double y) const
void add_note(NoteBase *)
VelocityGhostRegion(MidiRegionView &, TimeAxisView &tv, TimeAxisView &source_tv, double initial_unit_pos)
bool base_event(GdkEvent *)
void remove_note(NoteBase *)
void update_note(GhostEvent *note)
void set_selected(bool)
void update_hit(GhostEvent *hit)
void lollis_close_to_x(int x, double distance, std::vector< GhostEvent * > &events)
bool line_extended(ArdourCanvas::Duple const &from, ArdourCanvas::Duple const &to, ArdourCanvas::Rectangle const &r, double last_x)