1 #ifndef __ardour_gtk_automation_time_axis_h__
2 #define __ardour_gtk_automation_time_axis_h__
8 #include <boost/shared_ptr.hpp>
10 #include <ardour/types.h>
13 #include "time_axis_view.h"
14 #include "simplerect.h"
27 class RegionSelection;
34 class AutomationTimeAxisView : public TimeAxisView {
36 AutomationTimeAxisView (ARDOUR::Session&,
37 boost::shared_ptr<ARDOUR::Route>,
40 ArdourCanvas::Canvas& canvas,
41 const string & name, /* translatable */
42 const string & state_name, /* not translatable */
43 const string & plug_name = "");
45 ~AutomationTimeAxisView();
47 virtual void set_height (TimeAxisView::TrackHeight);
48 void set_samples_per_unit (double);
49 std::string name() const { return _name; }
51 virtual void add_automation_event (ArdourCanvas::Item *item, GdkEvent *event, nframes_t, double) = 0;
53 virtual void clear_lines ();
54 virtual void add_line (AutomationLine&);
56 vector<AutomationLine*> lines;
58 void set_selected_points (PointSelection&);
59 void get_selectables (nframes_t start, nframes_t end, double top, double bot, list<Selectable *>&);
60 void get_inverted_selectables (Selection&, list<Selectable*>& results);
62 void show_timestretch (nframes_t start, nframes_t end) {}
63 void hide_timestretch () {}
65 /* editing operations */
67 bool cut_copy_clear (Selection&, Editing::CutCopyOp);
68 bool cut_copy_clear_objects (PointSelection&, Editing::CutCopyOp);
69 bool paste (nframes_t, float times, Selection&, size_t nth);
70 void reset_objects (PointSelection&);
72 void add_ghost (GhostRegion*);
73 void remove_ghost (GhostRegion*);
75 void show_all_control_points ();
76 void hide_all_but_selected_control_points ();
77 void set_state (const XMLNode&);
78 XMLNode* get_state_node ();
81 boost::shared_ptr<ARDOUR::Route> route;
82 ArdourCanvas::SimpleRect* base_rect;
87 bool first_call_to_set_height;
89 Gtk::Button hide_button;
90 Gtk::Button height_button;
91 Gtk::Button clear_button;
92 Gtk::Button auto_button;
93 Gtk::Menu* automation_menu;
97 Gtk::CheckMenuItem* auto_off_item;
98 Gtk::CheckMenuItem* auto_play_item;
99 Gtk::CheckMenuItem* auto_touch_item;
100 Gtk::CheckMenuItem* auto_write_item;
102 void clear_clicked ();
103 void height_clicked ();
104 void hide_clicked ();
105 void auto_clicked ();
107 virtual void build_display_menu ();
109 list<GhostRegion*> ghosts;
111 bool cut_copy_clear_one (AutomationLine&, Selection&, Editing::CutCopyOp);
112 bool cut_copy_clear_objects_one (AutomationLine&, PointSelection&, Editing::CutCopyOp);
113 bool paste_one (AutomationLine&, nframes_t, float times, Selection&, size_t nth);
114 void reset_objects_one (AutomationLine&, PointSelection&);
116 virtual void set_automation_state (ARDOUR::AutoState) = 0;
117 bool ignore_state_request;
119 void automation_state_changed ();
120 sigc::connection automation_connection;
126 #endif /* __ardour_gtk_automation_time_axis_h__ */