Ardour  9.0-pre0-350-gf17a656217
mute_control.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2017 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2016-2017 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #pragma once
21 
22 #include <memory>
23 #include <string>
24 
26 
27 #include "ardour/mute_master.h"
29 
30 namespace ARDOUR {
31 
32 class Session;
33 class Muteable;
34 
36 {
37 public:
39 
40  double get_value () const;
41  double get_save_value() const { return muted_by_self(); }
42 
43  /* Export additional API so that objects that only get access
44  * to a Controllable/AutomationControl can do more fine-grained
45  * operations with respect to mute. Obviously, they would need
46  * to dynamic_cast<MuteControl> first.
47  *
48  * Mute state is not representable by a single scalar value,
49  * so set_value() and get_value() is not enough.
50  *
51  * This means that the Controllable is technically
52  * asymmetric. It is possible to call ::set_value (0.0) to
53  * turn off mute, and then call ::get_value() and get a
54  * return of 1.0 because the control is affected by
55  * upstream/downstream or a master.
56  */
57 
58  bool muted () const;
59  bool muted_by_self () const;
60  bool muted_by_masters () const;
61  bool muted_by_self_or_masters () const {
62  return muted_by_self() || muted_by_masters ();
63  }
64 
65  bool muted_by_others_soloing () const;
66 
69 
71 
72 protected:
73  bool handle_master_change (std::shared_ptr<AutomationControl>);
75 
76  void pre_remove_master (std::shared_ptr<AutomationControl>);
77  void post_add_master (std::shared_ptr<AutomationControl>);
78 
79 private:
81 };
82 
83 } /* namespace */
84 
void post_add_master(std::shared_ptr< AutomationControl >)
Muteable & _muteable
Definition: mute_control.h:80
bool muted_by_others_soloing() const
MuteMaster::MutePoint mute_points() const
double get_save_value() const
Definition: mute_control.h:41
double get_value() const
bool muted_by_masters() const
void actually_set_value(double, PBD::Controllable::GroupControlDisposition group_override)
bool handle_master_change(std::shared_ptr< AutomationControl >)
void set_mute_points(MuteMaster::MutePoint)
MuteControl(Session &session, std::string const &name, Muteable &, Temporal::TimeDomainProvider const &)
bool muted_by_self() const
void pre_remove_master(std::shared_ptr< AutomationControl >)
bool muted() const
void automation_run(samplepos_t start, pframes_t nframes)
bool muted_by_self_or_masters() const
Definition: mute_control.h:61
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API
void session(lua_State *L)
PBD::PropertyDescriptor< timepos_t > start
uint32_t pframes_t
Temporal::samplepos_t samplepos_t