ardour
automation_time_axis.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2000-2007 Paul Davis
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 
18 */
19 
20 #ifndef __ardour_gtk_automation_time_axis_h__
21 #define __ardour_gtk_automation_time_axis_h__
22 
23 #include <list>
24 #include <string>
25 #include <utility>
26 
27 #include <boost/shared_ptr.hpp>
28 
29 #include "ardour/types.h"
30 #include "ardour/automatable.h"
31 #include "ardour/automation_list.h"
32 
33 #include "canvas/rectangle.h"
34 
35 #include "time_axis_view.h"
36 #include "automation_controller.h"
37 #include "ardour_button.h"
38 
39 namespace ARDOUR {
40  class Session;
41  class Route;
42  class AutomationControl;
43 }
44 
45 class PublicEditor;
46 class TimeSelection;
47 class RegionSelection;
48 class PointSelection;
49 class AutomationLine;
50 class Selection;
51 class Selectable;
54 class ItemCounts;
55 
57  public:
63  PublicEditor&,
65  bool show_regions,
66  ArdourCanvas::Canvas& canvas,
67  const std::string & name, /* translatable */
68  const std::string & plug_name = "");
69 
71 
72  virtual void set_height (uint32_t, TrackHeightMode m = OnlySelf);
73  void set_samples_per_pixel (double);
74  std::string name() const { return _name; }
75 
76  void add_automation_event (GdkEvent *, framepos_t, double, bool with_guard_points);
77 
78  void clear_lines ();
79 
82 
84  std::list<boost::shared_ptr<AutomationLine> > lines () const;
85 
87  void get_selectables (ARDOUR::framepos_t start, ARDOUR::framepos_t end, double top, double bot, std::list<Selectable *>&, bool within = false);
88  void get_inverted_selectables (Selection&, std::list<Selectable*>& results);
89 
90  void show_timestretch (framepos_t /*start*/, framepos_t /*end*/, int /*layers*/, int /*layer*/) {}
91  void hide_timestretch () {}
92 
93  /* editing operations */
94 
97 
98  int set_state (const XMLNode&, int version);
99 
100  std::string state_id() const;
101  static bool parse_state_id (std::string const &, PBD::ID &, bool &, Evoral::Parameter &);
102 
106  return _parameter;
107  }
108 
109  ArdourCanvas::Item* base_item () const {
110  return _base_rect;
111  }
112 
113  bool has_automation () const;
114 
116  return _route;
117  }
118 
119  bool show_regions () const {
120  return _show_regions;
121  }
122 
123  static void what_has_visible_automation (const boost::shared_ptr<ARDOUR::Automatable>& automatable, std::set<Evoral::Parameter>& visible);
124 
125  protected:
126  /* Note that for MIDI controller "automation" (in regions), all of these
127  may be set. In this case, _automatable is likely _route so the
128  controller will send immediate events out the route's MIDI port. */
129 
139 
140  ArdourCanvas::Rectangle* _base_rect;
142 
143  std::string _name;
144 
147 
150 
153  Gtk::Menu* automation_menu;
154  Gtk::Label* plugname;
156 
157  Gtk::CheckMenuItem* auto_off_item;
158  Gtk::CheckMenuItem* auto_play_item;
159  Gtk::CheckMenuItem* auto_touch_item;
160  Gtk::CheckMenuItem* auto_write_item;
161 
162  Gtk::CheckMenuItem* mode_discrete_item;
163  Gtk::CheckMenuItem* mode_line_item;
164 
166 
168 
169  void clear_clicked ();
170  void hide_clicked ();
171  void auto_clicked ();
172 
173  virtual bool can_edit_name() const {return false;}
174 
175  void build_display_menu ();
176 
178  bool paste_one (ARDOUR::framepos_t, unsigned, float times, const Selection&, ItemCounts& counts, bool greedy=false);
179  void route_going_away ();
180 
183 
184  void automation_state_changed ();
185 
188 
191 
192  void entered ();
193  void exited ();
194 
195  //void set_colors ();
196  void color_handler ();
197 
198  static Pango::FontDescription name_font;
199  static bool have_name_font;
200 
201 private:
202  int set_state_2X (const XMLNode &, int);
203 };
204 
205 #endif /* __ardour_gtk_automation_time_axis_h__ */
void cut_copy_clear_one(AutomationLine &, Selection &, Editing::CutCopyOp)
Gtk::CheckMenuItem * mode_line_item
Gtk::CheckMenuItem * auto_touch_item
boost::shared_ptr< ARDOUR::AutomationControl > control()
void set_interpolation(ARDOUR::AutomationList::InterpolationStyle)
Gtk::CheckMenuItem * auto_play_item
boost::shared_ptr< ARDOUR::Route > _route
std::string state_id() const
boost::shared_ptr< AutomationLine > _line
boost::shared_ptr< ARDOUR::Route > parent_route()
Lists of selected things.
Definition: selection.h:66
Representation of the interface of the Editor class.
std::list< boost::shared_ptr< AutomationLine > > lines() const
void show_timestretch(framepos_t, framepos_t, int, int)
int set_state(const XMLNode &, int version)
std::string name() const
AutomationStreamView * _view
static Pango::FontDescription name_font
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > start
Definition: region.cc:63
boost::shared_ptr< ARDOUR::AutomationControl > _control
virtual void set_height(uint32_t, TrackHeightMode m=OnlySelf)
Definition: id.h:32
Gtk::CheckMenuItem * auto_off_item
AutomationTimeAxisView(ARDOUR::Session *, boost::shared_ptr< ARDOUR::Route >, boost::shared_ptr< ARDOUR::Automatable >, boost::shared_ptr< ARDOUR::AutomationControl >, Evoral::Parameter, PublicEditor &, TimeAxisView &parent, bool show_regions, ArdourCanvas::Canvas &canvas, const std::string &name, const std::string &plug_name="")
virtual bool can_edit_name() const
void interpolation_changed(ARDOUR::AutomationList::InterpolationStyle)
void get_selectables(ARDOUR::framepos_t start, ARDOUR::framepos_t end, double top, double bot, std::list< Selectable * > &, bool within=false)
static bool parse_state_id(std::string const &, PBD::ID &, bool &, Evoral::Parameter &)
boost::shared_ptr< ARDOUR::Automatable > _automatable
Evoral::Parameter parameter() const
Definition: amp.h:29
Gtk::CheckMenuItem * mode_discrete_item
void set_selected_points(PointSelection &)
void cut_copy_clear(Selection &, Editing::CutCopyOp)
void add_line(boost::shared_ptr< AutomationLine >)
ArdourCanvas::Item * base_item() const
int64_t framepos_t
Definition: types.h:66
CutCopyOp
Definition: editing.h:198
TimeAxisView * parent
PBD::ScopedConnectionList _route_connections
PBD::ScopedConnectionList _list_connections
ArdourCanvas::Rectangle * _base_rect
Gtk::CheckMenuItem * auto_write_item
static void what_has_visible_automation(const boost::shared_ptr< ARDOUR::Automatable > &automatable, std::set< Evoral::Parameter > &visible)
Definition: xml++.h:95
boost::shared_ptr< AutomationController > controller()
bool paste_one(ARDOUR::framepos_t, unsigned, float times, const Selection &, ItemCounts &counts, bool greedy=false)
int set_state_2X(const XMLNode &, int)
Evoral::Parameter _parameter
void add_automation_event(GdkEvent *, framepos_t, double, bool with_guard_points)
boost::shared_ptr< AutomationController > _controller
void get_inverted_selectables(Selection &, std::list< Selectable * > &results)
void set_automation_state(ARDOUR::AutoState)
int64_t framepos_t
boost::shared_ptr< AutomationLine > line()
bool paste(ARDOUR::framepos_t, const Selection &, PasteContext &)
AutoState
Definition: types.h:145