3 Copyright (C) 2009 Paul Davis
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.
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.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "pbd/enumwriter.h"
22 #include "pbd/xml++.h"
24 #include "ardour/types.h"
25 #include "ardour/mute_master.h"
26 #include "ardour/rc_configuration.h"
30 using namespace ARDOUR;
32 const MuteMaster::MutePoint MuteMaster::AllPoints = MutePoint (MuteMaster::PreFader|
33 MuteMaster::PostFader|
37 MuteMaster::MuteMaster (Session&, const std::string&)
38 : _mute_point (MutePoint (0))
43 MuteMaster::clear_mute ()
45 if (_mute_point != MutePoint (0)) {
46 _mute_point = MutePoint (0);
47 MutePointChanged (); // EMIT SIGNAL
52 MuteMaster::mute_at (MutePoint mp)
54 if ((_mute_point & mp) != mp) {
55 _mute_point = MutePoint (_mute_point | mp);
56 MutePointChanged (); // EMIT SIGNAL
61 MuteMaster::unmute_at (MutePoint mp)
63 if ((_mute_point & mp) == mp) {
64 _mute_point = MutePoint (_mute_point & ~mp);
65 MutePointChanged (); // EMIT SIGNAL
70 MuteMaster::mute_gain_at (MutePoint mp) const
72 if (_mute_point & mp) {
73 return Config->get_solo_mute_gain ();
80 MuteMaster::set_state (std::string mute_point)
82 _mute_point = (MutePoint) string_2_enum (mute_point, _mute_point);
88 MuteMaster::set_state (const XMLNode& node, int /*version*/)
90 const XMLProperty* prop;
92 if ((prop = node.property ("mute-point")) != 0) {
93 _mute_point = (MutePoint) string_2_enum (prop->value(), _mute_point);
100 MuteMaster::get_state()
102 XMLNode* node = new XMLNode (X_("MuteMaster"));
103 node->add_property ("mute-point", enum_2_string (_mute_point));