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>
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.
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.
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.
21 #ifndef __gtk_ardour_automation_region_view_h__
22 #define __gtk_ardour_automation_region_view_h__
24 #include "ardour/types.h"
26 #include "region_view.h"
27 #include "automation_time_axis.h"
28 #include "automation_line.h"
38 class AutomationRegionView : public RegionView
41 AutomationRegionView(ArdourCanvas::Container*,
42 AutomationTimeAxisView&,
43 boost::shared_ptr<ARDOUR::Region>,
44 const Evoral::Parameter& parameter,
45 boost::shared_ptr<ARDOUR::AutomationList>,
46 double initial_samples_per_pixel,
47 uint32_t basic_color);
49 ~AutomationRegionView();
53 bool paste (samplepos_t pos,
56 boost::shared_ptr<const ARDOUR::AutomationList> slist);
58 ARDOUR::DoubleBeatsSamplesConverter const & region_relative_time_converter () const {
59 return _region_relative_time_converter;
62 ARDOUR::DoubleBeatsSamplesConverter const & source_relative_time_converter () const {
63 return _source_relative_time_converter;
66 inline AutomationTimeAxisView* automation_view() const
67 { return dynamic_cast<AutomationTimeAxisView*>(&trackview); }
69 boost::shared_ptr<AutomationLine> line() { return _line; }
71 // We are a ghost. Meta ghosts? Crazy talk.
72 virtual GhostRegion* add_ghost(TimeAxisView&) { return 0; }
74 uint32_t get_fill_color() const;
76 void set_height (double);
77 void reset_width_dependent_items(double pixel_width);
80 void create_line(boost::shared_ptr<ARDOUR::AutomationList> list);
81 bool set_position(samplepos_t pos, void* src, double* ignored);
82 void region_resized (const PBD::PropertyChange&);
83 bool canvas_group_event(GdkEvent* ev);
84 void add_automation_event (GdkEvent* event, samplepos_t when, double y, bool with_guard_points);
85 void mouse_mode_changed ();
90 ARDOUR::DoubleBeatsSamplesConverter _region_relative_time_converter;
91 ARDOUR::DoubleBeatsSamplesConverter _source_relative_time_converter;
92 Evoral::Parameter _parameter;
93 boost::shared_ptr<AutomationLine> _line;
94 PBD::ScopedConnection _mouse_mode_connection;
97 #endif /* __gtk_ardour_automation_region_view_h__ */