Ardour  8.12
phase_control.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Paul Davis <paul@linuxaudiosystems.com>
3  *
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.
8  *
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.
13  *
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  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef __ardour_phase_control_h__
20 #define __ardour_phase_control_h__
21 
22 #include <memory>
23 #include <string>
24 
25 #include <boost/dynamic_bitset.hpp>
26 
29 
30 namespace ARDOUR {
31 
32 class Session;
33 
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.
36  */
37 
39 {
40  public:
41  PhaseControl (Session& session, std::string const & name, Temporal::TimeDomainProvider const &);
42 
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.
47  */
48 
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]; }
52 
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);
58 
59  int set_state (XMLNode const&, int);
60  XMLNode& get_state () const;
61 
62  protected:
64 
65  private:
66  boost::dynamic_bitset<> _phase_invert;
67 };
68 
69 } /* namespace */
70 
71 #endif /* __libardour_phase_control_h__ */
boost::dynamic_bitset _phase_invert
Definition: phase_control.h:66
void set_phase_invert(boost::dynamic_bitset<>)
void resize(uint32_t)
uint64_t count() const
Definition: phase_control.h:55
int set_state(XMLNode const &, int)
bool inverted(uint32_t chn) const
Definition: phase_control.h:51
void set_phase_invert(uint32_t, bool yn)
uint64_t size() const
Definition: phase_control.h:56
XMLNode & get_state() const
PhaseControl(Session &session, std::string const &name, Temporal::TimeDomainProvider const &)
void actually_set_value(double, PBD::Controllable::GroupControlDisposition group_override)
Definition: xml++.h:114
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API
void session(lua_State *L)