2005-09-25 14:42:24 -04:00
|
|
|
#ifndef __ardour_gtk_automation_time_axis_h__
|
|
|
|
#define __ardour_gtk_automation_time_axis_h__
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <list>
|
|
|
|
#include <string>
|
2006-07-27 12:52:14 -04:00
|
|
|
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
#include <ardour/types.h>
|
|
|
|
|
2005-11-15 21:57:22 -05:00
|
|
|
#include "canvas.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "time_axis_view.h"
|
2005-11-12 22:53:51 -05:00
|
|
|
#include "simplerect.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
using std::vector;
|
|
|
|
using std::list;
|
|
|
|
using std::string;
|
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class Session;
|
|
|
|
class Route;
|
|
|
|
}
|
|
|
|
|
|
|
|
class PublicEditor;
|
|
|
|
class TimeSelection;
|
2006-07-31 23:23:35 -04:00
|
|
|
class RegionSelection;
|
2005-09-25 14:42:24 -04:00
|
|
|
class PointSelection;
|
|
|
|
class AutomationLine;
|
|
|
|
class GhostRegion;
|
|
|
|
class Selection;
|
|
|
|
class Selectable;
|
|
|
|
|
|
|
|
class AutomationTimeAxisView : public TimeAxisView {
|
|
|
|
public:
|
|
|
|
AutomationTimeAxisView (ARDOUR::Session&,
|
2006-07-27 12:52:14 -04:00
|
|
|
boost::shared_ptr<ARDOUR::Route>,
|
2005-09-25 14:42:24 -04:00
|
|
|
PublicEditor&,
|
|
|
|
TimeAxisView& parent,
|
2005-11-15 21:57:22 -05:00
|
|
|
ArdourCanvas::Canvas& canvas,
|
2005-12-22 07:23:54 -05:00
|
|
|
const string & name, /* translatable */
|
|
|
|
const string & state_name, /* not translatable */
|
|
|
|
const string & plug_name = "");
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
~AutomationTimeAxisView();
|
|
|
|
|
2006-07-11 16:43:39 -04:00
|
|
|
virtual void set_height (TimeAxisView::TrackHeight);
|
2005-09-25 14:42:24 -04:00
|
|
|
void set_samples_per_unit (double);
|
|
|
|
std::string name() const { return _name; }
|
|
|
|
|
2006-09-28 13:23:52 -04:00
|
|
|
virtual void add_automation_event (ArdourCanvas::Item *item, GdkEvent *event, nframes_t, double) = 0;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-11 16:43:39 -04:00
|
|
|
virtual void clear_lines ();
|
|
|
|
virtual void add_line (AutomationLine&);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
vector<AutomationLine*> lines;
|
|
|
|
|
|
|
|
void set_selected_points (PointSelection&);
|
2006-09-28 13:23:52 -04:00
|
|
|
void get_selectables (nframes_t start, nframes_t end, double top, double bot, list<Selectable *>&);
|
2005-09-25 14:42:24 -04:00
|
|
|
void get_inverted_selectables (Selection&, list<Selectable*>& results);
|
|
|
|
|
2006-09-28 13:23:52 -04:00
|
|
|
void show_timestretch (nframes_t start, nframes_t end) {}
|
2005-09-25 14:42:24 -04:00
|
|
|
void hide_timestretch () {}
|
|
|
|
|
|
|
|
/* editing operations */
|
|
|
|
|
|
|
|
bool cut_copy_clear (Selection&, Editing::CutCopyOp);
|
|
|
|
bool cut_copy_clear_objects (PointSelection&, Editing::CutCopyOp);
|
2006-09-28 13:23:52 -04:00
|
|
|
bool paste (nframes_t, float times, Selection&, size_t nth);
|
2006-05-19 16:10:35 -04:00
|
|
|
void reset_objects (PointSelection&);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
void add_ghost (GhostRegion*);
|
|
|
|
void remove_ghost (GhostRegion*);
|
|
|
|
|
|
|
|
void show_all_control_points ();
|
|
|
|
void hide_all_but_selected_control_points ();
|
|
|
|
void set_state (const XMLNode&);
|
|
|
|
XMLNode* get_state_node ();
|
|
|
|
|
|
|
|
protected:
|
2006-07-27 12:52:14 -04:00
|
|
|
boost::shared_ptr<ARDOUR::Route> route;
|
2005-11-15 21:57:22 -05:00
|
|
|
ArdourCanvas::SimpleRect* base_rect;
|
2005-09-25 14:42:24 -04:00
|
|
|
string _name;
|
|
|
|
string _state_name;
|
|
|
|
bool in_destructor;
|
|
|
|
|
2006-08-03 07:54:06 -04:00
|
|
|
bool first_call_to_set_height;
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::Button hide_button;
|
|
|
|
Gtk::Button height_button;
|
|
|
|
Gtk::Button clear_button;
|
|
|
|
Gtk::Button auto_button;
|
|
|
|
Gtk::Menu* automation_menu;
|
|
|
|
Gtk::Label* plugname;
|
|
|
|
bool plugname_packed;
|
|
|
|
|
|
|
|
Gtk::CheckMenuItem* auto_off_item;
|
|
|
|
Gtk::CheckMenuItem* auto_play_item;
|
|
|
|
Gtk::CheckMenuItem* auto_touch_item;
|
|
|
|
Gtk::CheckMenuItem* auto_write_item;
|
|
|
|
|
|
|
|
void clear_clicked ();
|
|
|
|
void height_clicked ();
|
|
|
|
void hide_clicked ();
|
|
|
|
void auto_clicked ();
|
|
|
|
|
|
|
|
virtual void build_display_menu ();
|
|
|
|
|
|
|
|
list<GhostRegion*> ghosts;
|
|
|
|
|
|
|
|
bool cut_copy_clear_one (AutomationLine&, Selection&, Editing::CutCopyOp);
|
|
|
|
bool cut_copy_clear_objects_one (AutomationLine&, PointSelection&, Editing::CutCopyOp);
|
2006-09-28 13:23:52 -04:00
|
|
|
bool paste_one (AutomationLine&, nframes_t, float times, Selection&, size_t nth);
|
2006-05-19 16:10:35 -04:00
|
|
|
void reset_objects_one (AutomationLine&, PointSelection&);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
virtual void set_automation_state (ARDOUR::AutoState) = 0;
|
|
|
|
bool ignore_state_request;
|
|
|
|
|
|
|
|
void automation_state_changed ();
|
2005-09-25 16:33:00 -04:00
|
|
|
sigc::connection automation_connection;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
void entered ();
|
|
|
|
void exited ();
|
2006-12-14 11:21:43 -05:00
|
|
|
|
|
|
|
static Pango::FontDescription name_font;
|
|
|
|
static bool have_name_font;
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_gtk_automation_time_axis_h__ */
|