2 Copyright (C) 2007 Paul Davis
3 Author: David Robillard
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.
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.
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.
20 #ifndef __gtk_ardour_automation_region_view_h__
21 #define __gtk_ardour_automation_region_view_h__
23 #include "ardour/types.h"
25 #include "region_view.h"
26 #include "automation_time_axis.h"
27 #include "automation_line.h"
37 class AutomationRegionView : public RegionView
40 AutomationRegionView(ArdourCanvas::Container*,
41 AutomationTimeAxisView&,
42 boost::shared_ptr<ARDOUR::Region>,
43 const Evoral::Parameter& parameter,
44 boost::shared_ptr<ARDOUR::AutomationList>,
45 double initial_samples_per_pixel,
46 uint32_t basic_color);
48 ~AutomationRegionView();
52 bool paste (framepos_t pos,
55 boost::shared_ptr<const ARDOUR::AutomationList> slist);
57 ARDOUR::DoubleBeatsFramesConverter const & region_relative_time_converter () const {
58 return _region_relative_time_converter;
61 ARDOUR::DoubleBeatsFramesConverter const & source_relative_time_converter () const {
62 return _source_relative_time_converter;
65 inline AutomationTimeAxisView* automation_view() const
66 { return dynamic_cast<AutomationTimeAxisView*>(&trackview); }
68 boost::shared_ptr<AutomationLine> line() { return _line; }
70 // We are a ghost. Meta ghosts? Crazy talk.
71 virtual GhostRegion* add_ghost(TimeAxisView&) { return 0; }
73 uint32_t get_fill_color() const;
75 void set_height (double);
76 void reset_width_dependent_items(double pixel_width);
79 void create_line(boost::shared_ptr<ARDOUR::AutomationList> list);
80 bool set_position(framepos_t pos, void* src, double* ignored);
81 void region_resized (const PBD::PropertyChange&);
82 bool canvas_group_event(GdkEvent* ev);
83 void add_automation_event (GdkEvent* event, framepos_t when, double y, bool with_guard_points);
84 void mouse_mode_changed ();
89 ARDOUR::DoubleBeatsFramesConverter _region_relative_time_converter;
90 ARDOUR::DoubleBeatsFramesConverter _source_relative_time_converter;
91 Evoral::Parameter _parameter;
92 boost::shared_ptr<AutomationLine> _line;
93 PBD::ScopedConnection _mouse_mode_connection;
96 #endif /* __gtk_ardour_automation_region_view_h__ */