diff options
author | Robin Gareus <robin@gareus.org> | 2017-06-22 21:06:12 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-06-22 22:04:10 +0200 |
commit | 9334c99b355c7e326f5659794c88f61805aa16d0 (patch) | |
tree | c171795e0953acfe735170f1feed44d40773009c /libs/ardour/ardour | |
parent | faa52a33498b7d655c6e54176bd257d88eec3ea5 (diff) |
Update Slavable API
Do not use AutomationType to identify parameters, use complete
Evoral::Parameter and Automatable.
For "batch connections", a Slavables needs to implement an API to return
the relevant controls.
This is only a first step towards a more generic Master/Slave framework.
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/automatable.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/route.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/slavable.h | 22 | ||||
-rw-r--r-- | libs/ardour/ardour/slavable_automation_control.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/types.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/vca.h | 3 |
6 files changed, 24 insertions, 9 deletions
diff --git a/libs/ardour/ardour/automatable.h b/libs/ardour/ardour/automatable.h index 8adfb88aae..1acb8a60dc 100644 --- a/libs/ardour/ardour/automatable.h +++ b/libs/ardour/ardour/automatable.h @@ -117,6 +117,8 @@ public: framepos_t _last_automation_snapshot; + SlavableControlList slavables () const { return SlavableControlList(); } + private: PBD::ScopedConnectionList _control_connections; ///< connections to our controls' signals }; diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index fad986f936..d5611c6fe9 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -686,6 +686,8 @@ protected: boost::shared_ptr<Processor> the_instrument_unlocked() const; + SlavableControlList slavables () const; + private: int64_t _track_number; diff --git a/libs/ardour/ardour/slavable.h b/libs/ardour/ardour/slavable.h index 15d3e41991..6e584b2128 100644 --- a/libs/ardour/ardour/slavable.h +++ b/libs/ardour/ardour/slavable.h @@ -30,6 +30,7 @@ #include "evoral/Parameter.hpp" +#include "ardour/types.h" #include "ardour/libardour_visibility.h" class XMLNode; @@ -39,33 +40,39 @@ namespace ARDOUR { class VCA; class VCAManager; class AutomationControl; +class SlavableAutomationControl; class LIBARDOUR_API Slavable { - public: +public: Slavable (); virtual ~Slavable() {} XMLNode& get_state () const; int set_state (XMLNode const&, int); - void assign (boost::shared_ptr<VCA>, bool loading); + void assign (boost::shared_ptr<VCA>); void unassign (boost::shared_ptr<VCA>); PBD::Signal2<void,boost::shared_ptr<VCA>,bool> AssignmentChange; - virtual boost::shared_ptr<AutomationControl> automation_control (const Evoral::Parameter& id) = 0; + virtual boost::shared_ptr<AutomationControl> automation_control (const Evoral::Parameter&) = 0; static std::string xml_node_name; /* signal sent VCAManager once assignment is possible */ static PBD::Signal1<void,VCAManager*> Assign; - protected: - virtual int assign_controls (boost::shared_ptr<VCA>, bool loading); - virtual int unassign_controls (boost::shared_ptr<VCA>); +protected: + virtual SlavableControlList slavables () const = 0; + +private: + bool assign_controls (boost::shared_ptr<VCA>); + void unassign_controls (boost::shared_ptr<VCA>); + + bool assign_control (boost::shared_ptr<VCA>, boost::shared_ptr<SlavableAutomationControl>); + void unassign_control (boost::shared_ptr<VCA>, boost::shared_ptr<SlavableAutomationControl>); - private: mutable Glib::Threads::RWLock master_lock; std::set<uint32_t> _masters; PBD::ScopedConnection assign_connection; @@ -73,7 +80,6 @@ class LIBARDOUR_API Slavable int do_assign (VCAManager* s); void weak_unassign (boost::weak_ptr<VCA>); - }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/slavable_automation_control.h b/libs/ardour/ardour/slavable_automation_control.h index 5057ef4070..eaa4341616 100644 --- a/libs/ardour/ardour/slavable_automation_control.h +++ b/libs/ardour/ardour/slavable_automation_control.h @@ -40,7 +40,7 @@ public: double get_value () const; - void add_master (boost::shared_ptr<AutomationControl>, bool loading); + void add_master (boost::shared_ptr<AutomationControl>); void remove_master (boost::shared_ptr<AutomationControl>); void clear_masters (); bool slaved_to (boost::shared_ptr<AutomationControl>) const; diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index 258bbb191f..bcabf32b4e 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -55,6 +55,7 @@ namespace ARDOUR { class Stripable; class VCA; class AutomationControl; + class SlavableAutomationControl; typedef float Sample; typedef float pan_t; @@ -588,6 +589,7 @@ namespace ARDOUR { typedef std::list<boost::weak_ptr <Route> > WeakRouteList; typedef std::list<boost::weak_ptr <Stripable> > WeakStripableList; typedef std::list<boost::shared_ptr<AutomationControl> > ControlList; + typedef std::list<boost::shared_ptr<SlavableAutomationControl> > SlavableControlList; typedef std::list<boost::shared_ptr<VCA> > VCAList; diff --git a/libs/ardour/ardour/vca.h b/libs/ardour/ardour/vca.h index fa0b08a2cf..73dd6a917f 100644 --- a/libs/ardour/ardour/vca.h +++ b/libs/ardour/ardour/vca.h @@ -146,6 +146,9 @@ class LIBARDOUR_API VCA : public Stripable, boost::shared_ptr<AutomationControl> eq_lpf_controllable () const { return boost::shared_ptr<AutomationControl>(); } boost::shared_ptr<AutomationControl> filter_enable_controllable () const { return boost::shared_ptr<AutomationControl>(); } + protected: + SlavableControlList slavables () const; + private: int32_t _number; |