23 #include <boost/algorithm/string.hpp>
24 #include <boost/lexical_cast.hpp>
37 #include "canvas/debug.h"
83 ArdourCanvas::Canvas& canvas,
85 const string & nomparent
93 , _base_rect (new
ArdourCanvas::Rectangle (_canvas_display))
95 , auto_button (
X_(
""))
96 , _show_regions (show_regions)
99 string tipname = nomparent;
100 if (!tipname.empty()) {
108 if (!tipname.empty()) {
128 ?
"midi automation track fill"
129 :
"audio automation track fill");
184 name_label.set_alignment (Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
186 name_label.set_ellipsize (Pango::ELLIPSIZE_END);
195 Gtk::DrawingArea *blank0 = manage (
new Gtk::DrawingArea());
196 Gtk::DrawingArea *blank1 = manage (
new Gtk::DrawingArea());
202 blank0->set_name (
"AudioTrackControlsBaseUnselected");
205 blank0->set_name (
"MidiTrackControlsBaseUnselected");
208 blank0->set_name (
"AudioBusControlsBaseUnselected");
210 blank0->set_size_request (-1, -1);
211 blank1->set_size_request (1, 0);
212 VSeparator* separator = manage (
new VSeparator());
213 separator->set_name(
"TrackSeparator");
214 separator->set_size_request (1, -1);
302 using namespace Menu_Helpers;
309 items.push_back (MenuElem (
S_(
"Automation|Manual"), sigc::bind (sigc::mem_fun(*
this,
311 items.push_back (MenuElem (
_(
"Play"), sigc::bind (sigc::mem_fun(*
this,
313 items.push_back (MenuElem (
_(
"Write"), sigc::bind (sigc::mem_fun(*
this,
315 items.push_back (MenuElem (
_(
"Touch"), sigc::bind (sigc::mem_fun(*
this,
415 if (s == AutomationList::Discrete) {
463 bool const changed_between_small_and_normal = ( (height < normal && h >= normal) || (
height >= normal || h < normal) );
534 using namespace Menu_Helpers;
545 items.push_back (SeparatorElem());
547 items.push_back (SeparatorElem());
551 Menu* auto_state_menu = manage (
new Menu);
552 auto_state_menu->set_name (
"ArdourContextMenu");
553 MenuList& as_items = auto_state_menu->items();
555 as_items.push_back (CheckMenuElem (
S_(
"Automation|Manual"), sigc::bind (
558 auto_off_item =
dynamic_cast<Gtk::CheckMenuItem*
>(&as_items.back());
560 as_items.push_back (CheckMenuElem (
_(
"Play"), sigc::bind (
563 auto_play_item =
dynamic_cast<Gtk::CheckMenuItem*
>(&as_items.back());
565 as_items.push_back (CheckMenuElem (
_(
"Write"), sigc::bind (
570 as_items.push_back (CheckMenuElem (
_(
"Touch"), sigc::bind (
577 items.push_back (MenuElem (
_(
"State"), *auto_state_menu));
587 Menu* auto_mode_menu = manage (
new Menu);
588 auto_mode_menu->set_name (
"ArdourContextMenu");
589 MenuList& am_items = auto_mode_menu->items();
591 RadioMenuItem::Group group;
593 am_items.push_back (RadioMenuElem (group,
_(
"Discrete"), sigc::bind (
595 AutomationList::Discrete)));
599 am_items.push_back (RadioMenuElem (group,
_(
"Linear"), sigc::bind (
602 mode_line_item =
dynamic_cast<Gtk::CheckMenuItem*
>(&am_items.back());
605 items.push_back (MenuElem (
_(
"Mode"), *auto_mode_menu));
648 list->
add (when, y, with_guard_points);
663 if (l == selection.
lines.end()) {
665 l = selection.
lines.begin();
689 if (p == selection.
lines.end()) {
690 if (greedy && selection.
lines.size() == 1) {
691 p = selection.
lines.begin();
703 XMLNode &before = alist->get_state();
704 alist->paste (**p, model_pos, times);
861 assert (automatable);
863 Automatable::Controls& controls (automatable->
controls());
865 for (Automatable::Controls::iterator i = controls.begin(); i != controls.end(); ++i) {
869 if (ac && ac->
alist()) {
877 visible.insert (i->first);
893 list<boost::shared_ptr<AutomationLine> >
896 list<boost::shared_ptr<AutomationLine> >
lines;
899 lines.push_back (
_line);
919 error <<
"Automation time axis has no state ID" <<
endmsg;
937 bool & has_parameter,
946 if (a !=
X_(
"automation")) {
953 has_parameter =
false;
957 has_parameter =
true;
962 assert (p.size() == 3);
965 boost::lexical_cast<int> (p[0]),
966 boost::lexical_cast<int> (p[2]),
967 boost::lexical_cast<int> (p[1])
976 list<boost::shared_ptr<AutomationLine> >
lines;
978 lines.push_back (
_line);
994 XMLNode &before = alist->get_state();
1003 if (alist->cut (start, end) != 0) {
1010 if ((what_we_got = alist->
cut (start, end)) != 0) {
1016 if ((what_we_got = alist->
copy (start, end)) != 0) {
1022 if ((what_we_got = alist->
cut (start, end)) != 0) {
1029 for (AutomationList::iterator x = what_we_got->
begin(); x != what_we_got->
end(); ++x) {
1030 double when = (*x)->when;
1031 double val = (*x)->value;
Gtk::Menu * automation_menu
bool transport_rolling() const
void cut_copy_clear_one(AutomationLine &, Selection &, Editing::CutCopyOp)
int atoi(const string &s)
virtual void snap_to_with_modifier(framepos_t &first, GdkEvent const *ev, ARDOUR::RoundMode direction=ARDOUR::RoundNearest, bool for_mark=false)=0
Gtk::CheckMenuItem * mode_line_item
Gtk::CheckMenuItem * auto_touch_item
virtual A from(B b) const =0
virtual void update_contents_height()
AutomationSelection lines
void set_selected_points(PointSelection &)
bool has_automation() const
PBD::Signal0< void > DropReferences
const std::string & value() const
void set_interpolation(ARDOUR::AutomationList::InterpolationStyle)
bool is_midi_track() const
Gtk::CheckMenuItem * auto_play_item
std::string gui_property(const std::string &property_name) const
boost::shared_ptr< ARDOUR::Route > _route
bool is_audio_track() const
bool touched(double top, double bot)
void add_visibility(VisibleAspects)
std::string state_id() const
bool in_write_pass() const
boost::shared_ptr< AutomationLine > _line
LIBPBD_API void split(std::string, std::vector< std::string > &, char)
virtual void set_height(uint32_t h, TrackHeightMode m=OnlySelf)
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
static ARDOUR_UI * instance()
void view_to_model_coord(double &x, double &y) const
boost::shared_ptr< ARDOUR::AutomationList > the_list() const
virtual int set_height(double)
Pango::FontDescription get_font_for_style(std::string widgetname)
const std::string & name() const
Lists of selected things.
void add_command(Command *const cmd)
Representation of the interface of the Editor class.
std::list< boost::shared_ptr< AutomationLine > > lines() const
Gtk::Table controls_table
LIBPBD_API Transmitter error
int set_state(const XMLNode &, int version)
void increase_n_lines(Evoral::Parameter t, size_t delta=1)
AutomationStreamView * _view
std::ostream & endmsg(std::ostream &ostr)
static Pango::FontDescription name_font
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > start
virtual void set_parameter_automation_state(Evoral::Parameter param, AutoState)
Gtk::Frame time_axis_frame
boost::shared_ptr< ARDOUR::AutomationControl > _control
virtual void set_height(uint32_t, TrackHeightMode m=OnlySelf)
virtual bool set_marked_for_display(bool)
virtual void build_display_menu()
ARDOUR::AutoState automation_state() const
bool has_automation() const
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="")
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)
void add(std::list< Selectable * > const &)
std::string controls_base_selected_name
ArdourCanvas::Container * _canvas_display
static bool parse_state_id(std::string const &, PBD::ID &, bool &, Evoral::Parameter &)
bool paste(framepos_t pos, unsigned paste_count, float times, boost::shared_ptr< ARDOUR::AutomationList > list)
ArdourCanvas::Container * _ghost_group
PBD::Signal2< void, std::string, void * > gui_changed
XMLProperty * property(const char *)
static boost::shared_ptr< AutomationController > create(boost::shared_ptr< ARDOUR::Automatable > parent, const Evoral::Parameter ¶m, const ARDOUR::ParameterDescriptor &desc, boost::shared_ptr< ARDOUR::AutomationControl > ac)
boost::shared_ptr< ARDOUR::Automatable > _automatable
~AutomationTimeAxisView()
Evoral::Parameter parameter() const
const ParameterDescriptor & desc() const
bool string_is_affirmative(const std::string &str)
AutoState automation_state() const
const PBD::ID & id() const
void get_selectables(ARDOUR::framepos_t, ARDOUR::framepos_t, double, double, std::list< Selectable * > &, bool within=false)
virtual void begin_reversible_command(std::string cmd_name)=0
bool ignore_state_request
Gtk::CheckMenuItem * mode_discrete_item
void set_selected_points(PointSelection &)
virtual void commit_reversible_command()=0
void cut_copy_clear(Selection &, Editing::CutCopyOp)
void add_line(boost::shared_ptr< AutomationLine >)
virtual Selection & get_cut_buffer() const =0
static EventTypeMap & instance()
boost::shared_ptr< ControlList > cut(double, double)
virtual int set_samples_per_pixel(double)
PBD::Signal1< void, InterpolationStyle > InterpolationChanged
void automation_state_changed()
LIBARDOUR_API RuntimeProfile * Profile
ItemCounts counts
Count of consumed selection items.
const Parameter & parameter() const
void set_tip(Gtk::Widget &w, const gchar *tip)
PBD::ScopedConnectionList _route_connections
PBD::ScopedConnectionList _list_connections
void set_interpolation(ARDOUR::AutomationList::InterpolationStyle)
ArdourCanvas::Rectangle * _base_rect
std::list< boost::shared_ptr< AutomationLine > > get_lines() const
Glib::RefPtr< Gtk::SizeGroup > controls_button_size_group
ARDOUR::framepos_t start()
ArdourCanvas::Container * selection_group
void disable_vertical_scroll()
boost::shared_ptr< ControlList > copy(double, double)
virtual void set_samples_per_pixel(double)
Gtk::CheckMenuItem * auto_write_item
virtual bool canvas_automation_track_event(GdkEvent *event, ArdourCanvas::Item *, AutomationTimeAxisView *)=0
static void what_has_visible_automation(const boost::shared_ptr< ARDOUR::Automatable > &automatable, std::set< Evoral::Parameter > &visible)
void model_to_view_coord(double &x, double &y) const
virtual framecnt_t get_paste_offset(framepos_t pos, unsigned paste_count, framecnt_t duration)=0
void get_selectables(ARDOUR::framepos_t, ARDOUR::framepos_t, double, double, std::list< Selectable * > &)
bool parameter_is_midi(AutomationType type)
const Evoral::TimeConverter< double, ARDOUR::framepos_t > & time_converter() const
ARDOUR::AutomationList::InterpolationStyle interpolation() const
boost::shared_ptr< ControlList > list()
size_t n_lines(Evoral::Parameter t) const
static UIConfiguration * config()
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
XMLNode * extra_xml(const std::string &str, bool add_if_missing=false)
sigc::signal< void > ColorsChanged
float times
Number of times to paste.
static bool have_name_font
void get_inverted_selectables(Selection &, std::list< Selectable * > &results)
void add_automation_event(GdkEvent *, framepos_t, double, bool with_guard_points)
boost::shared_ptr< AutomationList > alist() const
std::string controls_base_unselected_name
void set_gui_property(const std::string &property_name, const T &value)
void set_samples_per_pixel(double)
void set_line_color(uint32_t)
const_iterator get_nth(const Evoral::Parameter ¶m, size_t nth) const
boost::shared_ptr< AutomationController > _controller
static uint32_t preset_height(Height)
bool greedy
If true, greedily steal items that don't match.
virtual void add(double when, double value, bool with_guards=true, bool with_default=true)
unsigned count
Number of previous pastes to the same position.
void get_inverted_selectables(Selection &, std::list< Selectable * > &results)
void build_display_menu()
void set_automation_state(ARDOUR::AutoState)
void set_automation_state(ARDOUR::AutoState state)
Gtk::EventBox controls_ebox
boost::shared_ptr< AutomationLine > line()
ARDOUR::Session * _session
bool first_call_to_set_height
std::string string_compose(const std::string &fmt, const T1 &o1)
bool paste(ARDOUR::framepos_t, const Selection &, PasteContext &)
void cleanup_gui_properties()
void set_selected_points(PointSelection const &)
PBD::Signal1< void, AutoState > automation_state_changed