Ardour  9.0-pre0-582-g084a23a80d
mute_master.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009-2010 Carl Hetherington <carl@carlh.net>
3  * Copyright (C) 2009-2011 David Robillard <d@drobilla.net>
4  * Copyright (C) 2009-2016 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2015-2017 Robin Gareus <robin@gareus.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #pragma once
23 
24 #include <string>
25 
26 #include "pbd/signals.h"
27 #include "pbd/stateful.h"
28 
29 #include "evoral/Parameter.h"
30 
31 #include "ardour/session_handle.h"
32 #include "ardour/types.h"
33 
34 namespace ARDOUR {
35 
36 class Session;
37 class Muteable;
38 
40 {
41 public:
43  enum MutePoint {
44  PreFader = 0x1,
45  PostFader = 0x2,
46  Listen = 0x4,
47  Main = 0x8,
48  SurroundSend = 0x10
49  };
50 
51  static const MutePoint AllPoints;
52 
53  MuteMaster (Session& s, Muteable&, const std::string& name);
55 
56  bool muted_by_self () const { return _muted_by_self && (_mute_point != MutePoint (0)); }
57  bool muted_by_self_at (MutePoint mp) const { return _muted_by_self && (_mute_point & mp); }
59  bool muted_by_masters () const { return _muted_by_masters && (_mute_point != MutePoint (0)); }
60  bool muted_by_masters_at (MutePoint mp) const { return _muted_by_masters && (_mute_point & mp); }
61 
63 
64  void set_muted_by_self (bool yn) { _muted_by_self = yn; }
65 
68 
69  void set_mute_points (const std::string& mute_point);
71  MutePoint mute_points() const { return _mute_point; }
72 
73  void set_soloed_by_self (bool yn) { _soloed_by_self = yn; }
74  void set_soloed_by_others (bool yn) { _soloed_by_others = yn; }
75 
76  void set_muted_by_masters (bool);
77 
79 
80  XMLNode& get_state() const;
81  int set_state(const XMLNode&, int version);
82  static const std::string xml_node_name;
83 
84 private:
91 };
92 
93 } // namespace ARDOUR
94 
Muteable * _muteable
Definition: mute_master.h:85
void unmute_at(MutePoint)
void set_muted_by_masters(bool)
gain_t mute_gain_at(MutePoint) const
void set_muted_by_self(bool yn)
Definition: mute_master.h:64
void set_soloed_by_others(bool yn)
Definition: mute_master.h:74
void set_mute_points(MutePoint)
static const MutePoint AllPoints
Definition: mute_master.h:51
void set_soloed_by_self(bool yn)
Definition: mute_master.h:73
bool muted_by_masters_at(MutePoint mp) const
Definition: mute_master.h:60
void mute_at(MutePoint)
PBD::Signal< void()> MutePointChanged
Definition: mute_master.h:78
MutePoint mute_points() const
Definition: mute_master.h:71
bool muted_by_self() const
Definition: mute_master.h:56
int set_state(const XMLNode &, int version)
void set_mute_points(const std::string &mute_point)
XMLNode & get_state() const
static const std::string xml_node_name
Definition: mute_master.h:82
bool muted_by_others_soloing_at(MutePoint mp) const
MuteMaster(Session &s, Muteable &, const std::string &name)
MutePoint _mute_point
Definition: mute_master.h:86
bool muted_by_masters() const
Definition: mute_master.h:59
bool muted_by_self_at(MutePoint mp) const
Definition: mute_master.h:57
Definition: xml++.h:114
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API