Ardour  9.0-pre0-427-gd2a3450e2f
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 #pragma once
20 
21 #include <memory>
22 #include <string>
23 
24 #include <boost/dynamic_bitset.hpp>
25 
28 
29 namespace ARDOUR {
30 
31 class Session;
32 
33 /* Note that PhaseControl is not Slavable. There's no particular reason for
34  * this, it could be changed at any time. But it seems useless.
35  */
36 
38 {
39  public:
40  PhaseControl (Session& session, std::string const & name, Temporal::TimeDomainProvider const &);
41 
42  /* There are two approaches to designing/using a PhaseControl. One is
43  * to have one such control for every channel of the control's
44  * owner. The other is to have a single control which manages all
45  * channels. For now (Spring 2016) we're using the second design.
46  */
47 
48  void set_phase_invert (uint32_t, bool yn);
49  void set_phase_invert (boost::dynamic_bitset<>);
50  bool inverted (uint32_t chn) const { return _phase_invert[chn]; }
51 
52  bool none () const { return !_phase_invert.any(); }
53  bool any() const { return _phase_invert.any(); }
54  uint64_t count() const { return _phase_invert.count(); }
55  uint64_t size() const { return _phase_invert.size(); }
56  void resize (uint32_t);
57 
58  int set_state (XMLNode const&, int);
59  XMLNode& get_state () const;
60 
61  protected:
63 
64  private:
65  boost::dynamic_bitset<> _phase_invert;
66 };
67 
68 } /* namespace */
69 
boost::dynamic_bitset _phase_invert
Definition: phase_control.h:65
void set_phase_invert(boost::dynamic_bitset<>)
void resize(uint32_t)
uint64_t count() const
Definition: phase_control.h:54
int set_state(XMLNode const &, int)
bool inverted(uint32_t chn) const
Definition: phase_control.h:50
void set_phase_invert(uint32_t, bool yn)
uint64_t size() const
Definition: phase_control.h:55
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)