Ardour  9.0-pre0-582-g084a23a80d
automation_region_view.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 #pragma once
22 
23 #include "ardour/types.h"
24 
25 #include "region_view.h"
26 #include "automation_time_axis.h"
27 #include "editor_automation_line.h"
28 #include "enums.h"
29 #include "line_merger.h"
30 
31 namespace ARDOUR {
32  class AutomationList;
33  class Parameter;
34 };
35 
36 class TimeAxisView;
37 
39 {
40 public:
43  std::shared_ptr<ARDOUR::Region>,
44  const Evoral::Parameter& parameter,
45  std::shared_ptr<ARDOUR::AutomationList>,
46  double initial_samples_per_pixel,
47  uint32_t basic_color);
48 
50 
51  void init (bool wfd);
52 
53  void set_selected (bool yn);
54 
55  bool paste (Temporal::timepos_t const & pos,
56  unsigned paste_count,
57  float times,
58  std::shared_ptr<const ARDOUR::AutomationList> slist);
59 
61  { return dynamic_cast<AutomationTimeAxisView*>(&trackview); }
62 
63  std::shared_ptr<EditorAutomationLine> line() { return _line; }
64 
65  // We are a ghost. Meta ghosts? Crazy talk.
66  virtual GhostRegion* add_ghost(TimeAxisView&) { return 0; }
67 
68  uint32_t get_fill_color() const;
69 
70  void set_height (double);
72 
74 
76 
79 
80 protected:
81  void create_line(std::shared_ptr<ARDOUR::AutomationList> list);
82  bool set_position(Temporal::timepos_t const & pos, void* src, double* ignored);
85  void add_automation_event (Temporal::timepos_t const & when, double y, bool with_guard_points);
87  void entered();
88  void exited();
89  void redisplay (bool) {}
90 
91 private:
93  std::shared_ptr<EditorAutomationLine> _line;
95 };
96 
PBD::ScopedConnection _mouse_mode_connection
void add_automation_event(Temporal::timepos_t const &when, double y, bool with_guard_points)
void create_line(std::shared_ptr< ARDOUR::AutomationList > list)
virtual GhostRegion * add_ghost(TimeAxisView &)
Evoral::Parameter _parameter
bool paste(Temporal::timepos_t const &pos, unsigned paste_count, float times, std::shared_ptr< const ARDOUR::AutomationList > slist)
AutomationRegionView(ArdourCanvas::Container *, AutomationTimeAxisView &, std::shared_ptr< ARDOUR::Region >, const Evoral::Parameter &parameter, std::shared_ptr< ARDOUR::AutomationList >, double initial_samples_per_pixel, uint32_t basic_color)
void init(bool wfd)
MergeableLine * make_merger()
std::shared_ptr< EditorAutomationLine > line()
void set_selected(bool yn)
void add_automation_event(GdkEvent *event)
uint32_t get_fill_color() const
std::shared_ptr< EditorAutomationLine > _line
void reset_width_dependent_items(double pixel_width)
Temporal::timepos_t drawn_time_filter(Temporal::timepos_t const &)
bool set_position(Temporal::timepos_t const &pos, void *src, double *ignored)
void set_height(double)
AutomationTimeAxisView * automation_view() const
bool canvas_group_event(GdkEvent *ev)
void region_resized(const PBD::PropertyChange &)
TimeAxisView & trackview
int pixel_width(const std::string &str, const Pango::FontDescription &font)