2 Copyright (C) 2016 Paul Davis
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2 of the License, or (at your option)
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 675 Mass Ave, Cambridge, MA 02139, USA.
19 #ifndef __ardour_phase_control_h__
20 #define __ardour_phase_control_h__
24 #include <boost/shared_ptr.hpp>
25 #include <boost/dynamic_bitset.hpp>
27 #include "ardour/slavable_automation_control.h"
28 #include "ardour/libardour_visibility.h"
34 /* Note that PhaseControl is not Slavable. There's no particular reason for
35 * this, it could be changed at any time. But it seems useless.
38 class LIBARDOUR_API PhaseControl : public AutomationControl
41 PhaseControl (Session& session, std::string const & name);
43 /* There are two approaches to designing/using a PhaseControl. One is
44 * to have one such control for every channel of the control's
45 * owner. The other is to have a single control which manages all
46 * channels. For now (Spring 2016) we're using the second design.
49 void set_phase_invert (uint32_t, bool yn);
50 void set_phase_invert (boost::dynamic_bitset<>);
51 bool inverted (uint32_t chn) const { return _phase_invert[chn]; }
53 bool none () const { return !_phase_invert.any(); }
54 bool any() const { return _phase_invert.any(); }
55 uint64_t count() const { return _phase_invert.count(); }
56 uint64_t size() const { return _phase_invert.size(); }
57 void resize (uint32_t);
59 int set_state (XMLNode const&, int);
60 XMLNode& get_state ();
63 void actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
66 boost::dynamic_bitset<> _phase_invert;
71 #endif /* __libardour_phase_control_h__ */