ardour
automation_region_view.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2007 Paul Davis
3  Author: David Robillard
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
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19 
20 #ifndef __gtk_ardour_automation_region_view_h__
21 #define __gtk_ardour_automation_region_view_h__
22 
23 #include "ardour/types.h"
24 
25 #include "region_view.h"
26 #include "automation_time_axis.h"
27 #include "automation_line.h"
28 #include "enums.h"
29 
30 namespace ARDOUR {
31  class AutomationList;
32  class Parameter;
33 };
34 
35 class TimeAxisView;
36 
38 {
39 public:
40  AutomationRegionView(ArdourCanvas::Container*,
43  const Evoral::Parameter& parameter,
45  double initial_samples_per_pixel,
46  uint32_t basic_color);
47 
49 
50  void init (bool wfd);
51 
52  bool paste (framepos_t pos,
53  unsigned paste_count,
54  float times,
56 
59  }
60 
63  }
64 
66  { return dynamic_cast<AutomationTimeAxisView*>(&trackview); }
67 
69 
70  // We are a ghost. Meta ghosts? Crazy talk.
71  virtual GhostRegion* add_ghost(TimeAxisView&) { return 0; }
72 
73  uint32_t get_fill_color() const;
74 
75  void set_height (double);
77 
78 protected:
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 ();
85  void entered();
86  void exited();
87 
88 private:
94 };
95 
96 #endif /* __gtk_ardour_automation_region_view_h__ */
AutomationTimeAxisView * automation_view() const
bool paste(framepos_t pos, unsigned paste_count, float times, boost::shared_ptr< const ARDOUR::AutomationList > slist)
void create_line(boost::shared_ptr< ARDOUR::AutomationList > list)
TimeAxisView & trackview
boost::shared_ptr< AutomationLine > _line
boost::shared_ptr< AutomationLine > line()
PBD::ScopedConnection _mouse_mode_connection
uint32_t get_fill_color() const
void region_resized(const PBD::PropertyChange &)
ARDOUR::DoubleBeatsFramesConverter const & region_relative_time_converter() const
Definition: amp.h:29
bool canvas_group_event(GdkEvent *ev)
Evoral::Parameter _parameter
ARDOUR::DoubleBeatsFramesConverter _region_relative_time_converter
void reset_width_dependent_items(double pixel_width)
void add_automation_event(GdkEvent *event, framepos_t when, double y, bool with_guard_points)
LIBGTKMM2EXT_API int pixel_width(const std::string &str, Pango::FontDescription &font)
ARDOUR::DoubleBeatsFramesConverter const & source_relative_time_converter() const
bool set_position(framepos_t pos, void *src, double *ignored)
AutomationRegionView(ArdourCanvas::Container *, AutomationTimeAxisView &, boost::shared_ptr< ARDOUR::Region >, const Evoral::Parameter &parameter, boost::shared_ptr< ARDOUR::AutomationList >, double initial_samples_per_pixel, uint32_t basic_color)
int64_t framepos_t
virtual GhostRegion * add_ghost(TimeAxisView &)
ARDOUR::DoubleBeatsFramesConverter _source_relative_time_converter