2 Copyright (C) 2016 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_slavable_h__
21 #define __ardour_slavable_h__
27 #include <boost/shared_ptr.hpp>
29 #include "pbd/signals.h"
31 #include "evoral/Parameter.hpp"
33 #include "ardour/libardour_visibility.h"
41 class AutomationControl;
43 class LIBARDOUR_API Slavable
47 virtual ~Slavable() {}
49 XMLNode& get_state () const;
50 int set_state (XMLNode const&, int);
52 void assign (boost::shared_ptr<VCA>, bool loading);
53 void unassign (boost::shared_ptr<VCA>);
55 PBD::Signal2<void,boost::shared_ptr<VCA>,bool> AssignmentChange;
57 virtual boost::shared_ptr<AutomationControl> automation_control (const Evoral::Parameter& id) = 0;
59 static std::string xml_node_name;
61 /* signal sent VCAManager once assignment is possible */
62 static PBD::Signal1<void,VCAManager*> Assign;
65 virtual int assign_controls (boost::shared_ptr<VCA>, bool loading);
66 virtual int unassign_controls (boost::shared_ptr<VCA>);
69 mutable Glib::Threads::RWLock master_lock;
70 std::set<uint32_t> _masters;
71 PBD::ScopedConnection assign_connection;
72 PBD::ScopedConnectionList unassign_connections;
74 int do_assign (VCAManager* s);
75 void weak_unassign (boost::weak_ptr<VCA>);
81 #endif /* __ardour_slavable_h__ */