X-Git-Url: https://main.carlh.net/gitweb/?p=ardour.git;a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fautomatable.h;h=d2fbb1aa8d574bb6457d51bb24040ed79c6908cd;hp=5f9f7d2b91165d271145023178ad871aa85e1f80;hb=6b1b72a247bf04c81292fc41af4f69c9b7f90379;hpb=f485cfa324717f57b9f820f43f1b53307b96a8b9 diff --git a/libs/ardour/ardour/automatable.h b/libs/ardour/ardour/automatable.h index 5f9f7d2b91..d2fbb1aa8d 100644 --- a/libs/ardour/ardour/automatable.h +++ b/libs/ardour/ardour/automatable.h @@ -26,6 +26,7 @@ #include +#include "pbd/rcu.h" #include "pbd/signals.h" #include "evoral/ControlSet.hpp" @@ -50,14 +51,34 @@ public: Automatable(Session&); Automatable (const Automatable& other); - virtual ~Automatable(); + virtual ~Automatable(); + + static bool skip_saving_automation; // to be used only by session-state boost::shared_ptr control_factory(const Evoral::Parameter& id); + boost::shared_ptr automation_control (PBD::ID const & id) const; + /* derived classes need to provide some way to search their own child + automatable's for a control. normally, we'd just make the method + above virtual, and let them override it. But that wouldn't + differentiate the "check children" and "just your own" cases. + + We could theoretically just overload the above method with an extra + "bool recurse = default", but the rules of name hiding for C++ mean + that making a method virtual will hide other overloaded versions of + the same name. This means that virtual automation_control (PBD::ID + const &) would hide automation_control (Evoral::Parameter const & + id). + + So, skip around all that with a different name. + */ + virtual boost::shared_ptr automation_control_recurse (PBD::ID const & id) const { + return automation_control (id); + } + boost::shared_ptr automation_control (const Evoral::Parameter& id) { return automation_control (id, false); } - boost::shared_ptr automation_control (const Evoral::Parameter& id, bool create_if_missing); boost::shared_ptr automation_control (const Evoral::Parameter& id) const; @@ -65,18 +86,16 @@ public: virtual bool find_next_event (double start, double end, Evoral::ControlEvent& ev, bool only_active = true) const; void clear_controls (); - virtual void transport_located (framepos_t now); - virtual void transport_stopped (framepos_t now); + virtual void non_realtime_locate (samplepos_t now); + virtual void non_realtime_transport_stop (samplepos_t now, bool flush); + + virtual void automation_run (samplepos_t, pframes_t, bool only_active = false); virtual std::string describe_parameter(Evoral::Parameter param); - virtual std::string value_as_string (boost::shared_ptr) const; AutoState get_parameter_automation_state (Evoral::Parameter param); virtual void set_parameter_automation_state (Evoral::Parameter param, AutoState); - AutoStyle get_parameter_automation_style (Evoral::Parameter param); - void set_parameter_automation_style (Evoral::Parameter param, AutoStyle); - void protect_automation (); const std::set& what_can_be_automated() const { return _can_automate_list; } @@ -89,21 +108,26 @@ public: PBD::Signal0 AutomationStateChanged; - protected: +protected: Session& _a_session; void can_automate(Evoral::Parameter); - virtual void automation_list_automation_state_changed (Evoral::Parameter, AutoState) {} + virtual void automation_list_automation_state_changed (Evoral::Parameter, AutoState); + SerializedRCUManager _automated_controls; int load_automation (const std::string& path); int old_set_automation_state(const XMLNode&); std::set _can_automate_list; - framepos_t _last_automation_snapshot; + samplepos_t _last_automation_snapshot; + + SlavableControlList slavables () const { return SlavableControlList(); } private: + inline void find_next_ac_event (boost::shared_ptr, double start, double end, Evoral::ControlEvent& ev) const; + PBD::ScopedConnectionList _control_connections; ///< connections to our controls' signals };