#include "pbd/enumwriter.h"
#include "pbd/xml++.h"
+#include "pbd/convert.h"
#include "ardour/types.h"
#include "ardour/mute_master.h"
using namespace ARDOUR;
using namespace std;
+const MuteMaster::MutePoint MuteMaster::AllPoints = MuteMaster::MutePoint(
+ PreFader|PostFader|Listen|Main);
+
MuteMaster::MuteMaster (Session& s, const std::string&)
: SessionHandleRef (s)
, _mute_point (MutePoint (0))
, _muted_by_self (false)
- , _soloed (false)
+ , _soloed_by_self (false)
+ , _soloed_by_others (false)
, _solo_ignore (false)
{
-
+
if (Config->get_mute_affects_pre_fader ()) {
_mute_point = MutePoint (_mute_point | PreFader);
}
}
}
-void
-MuteMaster::set_soloed (bool yn)
-{
- _soloed = yn;
-}
-
gain_t
MuteMaster::mute_gain_at (MutePoint mp) const
{
gain_t gain;
if (Config->get_solo_mute_override()) {
- if (_soloed) {
- gain = 1.0;
+ if (_soloed_by_self) {
+ gain = GAIN_COEFF_UNITY;
} else if (muted_by_self_at (mp)) {
- gain = Config->get_solo_mute_gain ();
+ gain = GAIN_COEFF_ZERO;
} else {
- if (muted_by_others_at (mp)) {
- gain = 0.0;
+ if (muted_by_others_at (mp) && !_soloed_by_others) {
+ gain = Config->get_solo_mute_gain ();
} else {
- gain = 1.0;
+ gain = GAIN_COEFF_UNITY;
}
}
} else {
if (muted_by_self_at (mp)) {
- gain = Config->get_solo_mute_gain ();
- } else if (_soloed) {
- gain = 1.0;
+ gain = GAIN_COEFF_ZERO;
+ } else if (_soloed_by_self || _soloed_by_others) {
+ gain = GAIN_COEFF_UNITY;
} else {
if (muted_by_others_at (mp)) {
- gain = 0.0;
+ gain = Config->get_solo_mute_gain ();
} else {
- gain = 1.0;
+ gain = GAIN_COEFF_UNITY;
}
}
}
-
+
return gain;
}
MutePoint old = _mute_point;
_mute_point = (MutePoint) string_2_enum (mute_point, _mute_point);
-
+
if (old != _mute_point) {
MutePointChanged(); /* EMIT SIGNAL */
}
}
void
-MuteMaster::set_mute_points (MutePoint mp)
+MuteMaster::set_mute_points (MutePoint mp)
{
if (_mute_point != mp) {
_mute_point = mp;
}
if ((prop = node.property ("muted")) != 0) {
- _muted_by_self = string_is_affirmative (prop->value());
+ _muted_by_self = PBD::string_is_affirmative (prop->value());
} else {
_muted_by_self = (_mute_point != MutePoint (0));
}
{
return (!_solo_ignore && _session.soloing() && (_mute_point & mp));
}
-
+