Ardour  9.0-pre0-582-g084a23a80d
solo_isolate_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 
26 
27 class XMLNode;
28 
29 namespace ARDOUR {
30 
31 class Session;
32 class Soloable;
33 class Muteable;
34 
36 {
37  public:
38  SoloIsolateControl (Session& session, std::string const & name, Soloable& soloable, Temporal::TimeDomainProvider const &);
39 
40  double get_value () const;
41 
42  /* Export additional API so that objects that only get access
43  * to a Controllable/AutomationControl can do more fine-grained
44  * operations with respect to solo isolate. Obviously, they would need
45  * to dynamic_cast<SoloControl> first.
46  *
47  * Solo Isolate state is not representable by a single scalar value,
48  * so set_value() and get_value() is not enough.
49  *
50  * This means that the Controllable is technically
51  * asymmetric. It is possible to call ::set_value (0.0) to
52  * disable (self)solo, and then call ::get_value() and get a
53  * return of 1.0 because the control is isolated by
54  * upstream/downstream or a master.
55  */
56 
57  void mod_solo_isolated_by_upstream (int32_t delta);
58 
59  /* API to check different aspects of solo isolate substate
60  */
61 
62  uint32_t solo_isolated_by_upstream () const {
63  return _solo_isolated_by_upstream;
64  }
65  bool self_solo_isolated () const {
66  return _solo_isolated;
67  }
68  bool solo_isolated() const { return self_solo_isolated() || solo_isolated_by_upstream(); }
69 
70  int set_state (XMLNode const&, int);
71  XMLNode& get_state () const;
72 
73  protected:
74  void master_changed (bool from_self, PBD::Controllable::GroupControlDisposition gcd, std::weak_ptr<AutomationControl>);
76 
77  private:
81 
82  void set_solo_isolated (bool yn, Controllable::GroupControlDisposition group_override);
83 
84 };
85 
86 } /* namespace */
87 
void mod_solo_isolated_by_upstream(int32_t delta)
void master_changed(bool from_self, PBD::Controllable::GroupControlDisposition gcd, std::weak_ptr< AutomationControl >)
SoloIsolateControl(Session &session, std::string const &name, Soloable &soloable, Temporal::TimeDomainProvider const &)
XMLNode & get_state() const
void actually_set_value(double, PBD::Controllable::GroupControlDisposition group_override)
uint32_t solo_isolated_by_upstream() const
int set_state(XMLNode const &, int)
void set_solo_isolated(bool yn, Controllable::GroupControlDisposition group_override)
Definition: xml++.h:114
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API
void session(lua_State *L)