2007-04-26 20:54:31 +00:00
|
|
|
/*
|
2019-08-02 23:26:43 +02:00
|
|
|
* Copyright (C) 2005-2017 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
|
* Copyright (C) 2005 Karsten Wiese <fzuuzf@googlemail.com>
|
|
|
|
|
* Copyright (C) 2005 Taybin Rutkin <taybin@taybin.com>
|
|
|
|
|
* Copyright (C) 2006-2014 David Robillard <d@drobilla.net>
|
|
|
|
|
* Copyright (C) 2006 Sampo Savolainen <v2@iki.fi>
|
|
|
|
|
* Copyright (C) 2009-2012 Carl Hetherington <carl@carlh.net>
|
|
|
|
|
* Copyright (C) 2014-2015 Ben Loftis <ben@harrisonconsoles.com>
|
|
|
|
|
* Copyright (C) 2015-2017 Robin Gareus <robin@gareus.org>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
*/
|
2007-04-26 20:54:31 +00:00
|
|
|
|
2005-09-25 18:42:24 +00:00
|
|
|
#ifndef __ardour_gtk_automation_time_axis_h__
|
|
|
|
|
#define __ardour_gtk_automation_time_axis_h__
|
|
|
|
|
|
|
|
|
|
#include <list>
|
|
|
|
|
#include <string>
|
2007-06-29 04:02:58 +00:00
|
|
|
#include <utility>
|
2006-07-27 16:52:14 +00:00
|
|
|
|
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
|
2009-02-25 18:26:51 +00:00
|
|
|
#include "ardour/types.h"
|
|
|
|
|
#include "ardour/automatable.h"
|
|
|
|
|
#include "ardour/automation_list.h"
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
#include "canvas/rectangle.h"
|
|
|
|
|
|
2017-07-15 17:38:28 +02:00
|
|
|
#include "widgets/ardour_button.h"
|
|
|
|
|
#include "widgets/ardour_dropdown.h"
|
|
|
|
|
|
2005-09-25 18:42:24 +00:00
|
|
|
#include "time_axis_view.h"
|
2007-06-29 04:02:58 +00:00
|
|
|
#include "automation_controller.h"
|
2005-09-25 18:42:24 +00:00
|
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
|
class Session;
|
2017-06-08 23:45:07 +02:00
|
|
|
class Stripable;
|
2007-09-06 02:30:39 +00:00
|
|
|
class AutomationControl;
|
2005-09-25 18:42:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class PublicEditor;
|
|
|
|
|
class TimeSelection;
|
2006-08-01 03:23:35 +00:00
|
|
|
class RegionSelection;
|
2005-09-25 18:42:24 +00:00
|
|
|
class PointSelection;
|
|
|
|
|
class AutomationLine;
|
|
|
|
|
class Selection;
|
|
|
|
|
class Selectable;
|
2007-09-06 02:30:39 +00:00
|
|
|
class AutomationStreamView;
|
|
|
|
|
class AutomationController;
|
2014-11-16 17:04:27 -05:00
|
|
|
class ItemCounts;
|
2007-06-30 18:41:50 +00:00
|
|
|
|
2017-07-01 21:11:14 +02:00
|
|
|
class AutomationTimeAxisView : public TimeAxisView
|
|
|
|
|
{
|
|
|
|
|
public:
|
2009-12-17 18:24:23 +00:00
|
|
|
AutomationTimeAxisView (ARDOUR::Session*,
|
2017-07-01 21:11:14 +02:00
|
|
|
boost::shared_ptr<ARDOUR::Stripable>,
|
|
|
|
|
boost::shared_ptr<ARDOUR::Automatable>,
|
|
|
|
|
boost::shared_ptr<ARDOUR::AutomationControl>,
|
|
|
|
|
Evoral::Parameter,
|
|
|
|
|
PublicEditor&,
|
|
|
|
|
TimeAxisView& parent,
|
|
|
|
|
bool show_regions,
|
|
|
|
|
ArdourCanvas::Canvas& canvas,
|
2020-04-15 02:38:18 +02:00
|
|
|
const std::string & name = "", /* translatable */
|
2017-07-01 21:11:14 +02:00
|
|
|
const std::string & plug_name = "");
|
2005-09-25 18:42:24 +00:00
|
|
|
|
|
|
|
|
~AutomationTimeAxisView();
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2015-03-19 21:47:34 +01:00
|
|
|
virtual void set_height (uint32_t, TrackHeightMode m = OnlySelf);
|
2013-04-12 11:31:50 -04:00
|
|
|
void set_samples_per_pixel (double);
|
2005-09-25 18:42:24 +00:00
|
|
|
std::string name() const { return _name; }
|
2016-06-05 15:39:22 -04:00
|
|
|
Gdk::Color color () const;
|
2020-04-15 02:38:18 +02:00
|
|
|
void update_name_from_param ();
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2016-06-03 15:15:30 -04:00
|
|
|
boost::shared_ptr<ARDOUR::Stripable> stripable() const;
|
2016-06-02 08:54:33 -04:00
|
|
|
ARDOUR::PresentationInfo const & presentation_info () const;
|
|
|
|
|
|
2020-10-19 12:37:54 -06:00
|
|
|
void add_automation_event (GdkEvent *, Temporal::timepos_t const &, double, bool with_guard_points);
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2007-06-30 18:41:50 +00:00
|
|
|
void clear_lines ();
|
2010-09-09 21:35:28 +00:00
|
|
|
|
|
|
|
|
/** @return Our AutomationLine, if this view has one, or 0 if it uses AutomationRegionViews */
|
2007-06-30 18:41:50 +00:00
|
|
|
boost::shared_ptr<AutomationLine> line() { return _line; }
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2010-09-09 21:35:28 +00:00
|
|
|
/** @return All AutomationLines associated with this view */
|
|
|
|
|
std::list<boost::shared_ptr<AutomationLine> > lines () const;
|
|
|
|
|
|
2005-09-25 18:42:24 +00:00
|
|
|
void set_selected_points (PointSelection&);
|
2020-10-02 21:26:17 -06:00
|
|
|
void get_selectables (Temporal::timepos_t const &, Temporal::timepos_t const &, double top, double bot, std::list<Selectable *>&, bool within = false);
|
2009-05-12 17:03:42 +00:00
|
|
|
void get_inverted_selectables (Selection&, std::list<Selectable*>& results);
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2020-10-14 23:09:22 -06:00
|
|
|
void show_timestretch (Temporal::timepos_t const &/*start*/, Temporal::timepos_t const & /*end*/, int /*layers*/, int /*layer*/) {}
|
2005-09-25 18:42:24 +00:00
|
|
|
void hide_timestretch () {}
|
|
|
|
|
|
|
|
|
|
/* editing operations */
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2012-04-27 21:34:44 +00:00
|
|
|
void cut_copy_clear (Selection&, Editing::CutCopyOp);
|
2020-09-26 09:14:59 -06:00
|
|
|
bool paste (Temporal::timepos_t const &, const Selection&, PasteContext&);
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2009-10-15 18:56:11 +00:00
|
|
|
int set_state (const XMLNode&, int version);
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2011-07-07 00:37:13 +00:00
|
|
|
std::string state_id() const;
|
2011-07-13 17:13:30 +00:00
|
|
|
static bool parse_state_id (std::string const &, PBD::ID &, bool &, Evoral::Parameter &);
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2017-05-05 12:31:49 +01:00
|
|
|
boost::shared_ptr<ARDOUR::AutomationControl> control() const { return _control; }
|
|
|
|
|
boost::shared_ptr<AutomationController> controller() const { return _controller; }
|
2011-02-17 16:18:27 +00:00
|
|
|
Evoral::Parameter parameter () const {
|
|
|
|
|
return _parameter;
|
|
|
|
|
}
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2010-01-01 22:11:15 +00:00
|
|
|
ArdourCanvas::Item* base_item () const {
|
|
|
|
|
return _base_rect;
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-25 15:51:32 +00:00
|
|
|
bool has_automation () const;
|
|
|
|
|
|
2017-06-08 23:45:07 +02:00
|
|
|
boost::shared_ptr<ARDOUR::Stripable> parent_stripable () {
|
|
|
|
|
return _stripable;
|
2010-08-18 02:20:15 +00:00
|
|
|
}
|
|
|
|
|
|
2011-09-07 13:45:52 +00:00
|
|
|
bool show_regions () const {
|
|
|
|
|
return _show_regions;
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-01 21:11:14 +02:00
|
|
|
protected:
|
2014-11-17 00:13:53 -05:00
|
|
|
/* Note that for MIDI controller "automation" (in regions), all of these
|
2017-07-01 21:11:14 +02:00
|
|
|
* may be set. In this case, _automatable is likely _route so the
|
|
|
|
|
* controller will send immediate events out the route's MIDI port. */
|
2014-11-17 00:13:53 -05:00
|
|
|
|
2017-06-08 23:45:07 +02:00
|
|
|
/** parent strip */
|
|
|
|
|
boost::shared_ptr<ARDOUR::Stripable> _stripable;
|
2014-11-17 00:13:53 -05:00
|
|
|
/** control */
|
2011-02-17 16:18:27 +00:00
|
|
|
boost::shared_ptr<ARDOUR::AutomationControl> _control;
|
2017-06-08 23:45:07 +02:00
|
|
|
/** control owner; may be _stripable, something else (e.g. a pan control), or NULL */
|
2011-02-17 16:18:15 +00:00
|
|
|
boost::shared_ptr<ARDOUR::Automatable> _automatable;
|
2014-11-17 00:13:53 -05:00
|
|
|
/** controller owner */
|
2007-06-30 18:41:50 +00:00
|
|
|
boost::shared_ptr<AutomationController> _controller;
|
2011-02-17 16:18:27 +00:00
|
|
|
Evoral::Parameter _parameter;
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
ArdourCanvas::Rectangle* _base_rect;
|
2007-06-30 18:41:50 +00:00
|
|
|
boost::shared_ptr<AutomationLine> _line;
|
2011-02-17 16:18:15 +00:00
|
|
|
|
2014-01-09 11:53:03 -05:00
|
|
|
std::string _name;
|
|
|
|
|
|
2010-07-14 00:58:15 +00:00
|
|
|
/** AutomationStreamView if we are editing region-based automation (for MIDI), otherwise 0 */
|
|
|
|
|
AutomationStreamView* _view;
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2006-08-03 11:54:06 +00:00
|
|
|
bool first_call_to_set_height;
|
|
|
|
|
|
2017-07-15 17:38:28 +02:00
|
|
|
ArdourWidgets::ArdourButton hide_button;
|
|
|
|
|
ArdourWidgets::ArdourDropdown auto_dropdown;
|
2005-09-25 18:42:24 +00:00
|
|
|
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;
|
2017-07-25 16:10:38 +02:00
|
|
|
Gtk::CheckMenuItem* auto_latch_item;
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2007-07-07 03:19:04 +00:00
|
|
|
Gtk::CheckMenuItem* mode_discrete_item;
|
|
|
|
|
Gtk::CheckMenuItem* mode_line_item;
|
2017-06-20 14:48:38 +02:00
|
|
|
Gtk::CheckMenuItem* mode_log_item;
|
|
|
|
|
Gtk::CheckMenuItem* mode_exp_item;
|
2007-07-07 03:19:04 +00:00
|
|
|
|
2011-09-07 13:45:52 +00:00
|
|
|
bool _show_regions;
|
|
|
|
|
|
2007-06-30 18:41:50 +00:00
|
|
|
void add_line (boost::shared_ptr<AutomationLine>);
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2005-09-25 18:42:24 +00:00
|
|
|
void clear_clicked ();
|
|
|
|
|
void hide_clicked ();
|
|
|
|
|
|
2014-08-27 11:53:53 -05:00
|
|
|
virtual bool can_edit_name() const {return false;}
|
|
|
|
|
|
2007-06-30 18:41:50 +00:00
|
|
|
void build_display_menu ();
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2012-04-27 21:34:44 +00:00
|
|
|
void cut_copy_clear_one (AutomationLine&, Selection&, Editing::CutCopyOp);
|
2020-10-04 22:52:17 -06:00
|
|
|
bool paste_one (Temporal::timepos_t const &, unsigned, float times, const Selection&, ItemCounts& counts, bool greedy=false);
|
2011-05-23 10:03:14 +00:00
|
|
|
void route_going_away ();
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2007-06-29 04:02:58 +00:00
|
|
|
void set_automation_state (ARDOUR::AutoState);
|
2005-09-25 18:42:24 +00:00
|
|
|
bool ignore_state_request;
|
2017-06-20 14:48:38 +02:00
|
|
|
bool ignore_mode_request;
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2017-07-21 15:49:28 +02:00
|
|
|
bool propagate_time_selection () const;
|
|
|
|
|
|
2005-09-25 18:42:24 +00:00
|
|
|
void automation_state_changed ();
|
2007-07-07 03:19:04 +00:00
|
|
|
|
|
|
|
|
void set_interpolation (ARDOUR::AutomationList::InterpolationStyle);
|
2010-07-14 00:58:15 +00:00
|
|
|
void interpolation_changed (ARDOUR::AutomationList::InterpolationStyle);
|
2007-07-07 03:19:04 +00:00
|
|
|
|
2010-07-14 00:58:15 +00:00
|
|
|
PBD::ScopedConnectionList _list_connections;
|
2017-06-08 23:45:07 +02:00
|
|
|
PBD::ScopedConnectionList _stripable_connections;
|
2005-09-25 18:42:24 +00:00
|
|
|
|
|
|
|
|
void entered ();
|
|
|
|
|
void exited ();
|
2006-12-14 16:21:43 +00:00
|
|
|
|
2008-02-10 18:16:25 +00:00
|
|
|
//void set_colors ();
|
2007-06-15 22:08:27 +00:00
|
|
|
void color_handler ();
|
2007-04-11 13:07:51 +00:00
|
|
|
|
2011-06-02 17:50:37 +00:00
|
|
|
static Pango::FontDescription name_font;
|
2006-12-14 16:21:43 +00:00
|
|
|
static bool have_name_font;
|
2010-09-07 23:26:21 +00:00
|
|
|
|
2017-08-12 14:40:07 -04:00
|
|
|
std::string automation_state_off_string () const;
|
|
|
|
|
|
2010-09-07 23:26:21 +00:00
|
|
|
private:
|
|
|
|
|
int set_state_2X (const XMLNode &, int);
|
2005-09-25 18:42:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* __ardour_gtk_automation_time_axis_h__ */
|