summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-05-19 14:32:49 +0000
committerCarl Hetherington <carl@carlh.net>2010-05-19 14:32:49 +0000
commit6ad69a206ca325e9e50eff4f8f2088170b468f00 (patch)
tree24c716755fa2f36ccc68100cabf53a5ae4be4b7d /libs/ardour
parente258b2622a4386b405c2216d79b34887c3ed55bf (diff)
When muting a route because another is soloed, take
into account the muting options (pre-fader/post-fader etc.) for the muted route. git-svn-id: svn://localhost/ardour2/branches/3.0@7119 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/mute_master.h14
-rw-r--r--libs/ardour/mute_master.cc23
-rw-r--r--libs/ardour/route.cc6
3 files changed, 23 insertions, 20 deletions
diff --git a/libs/ardour/ardour/mute_master.h b/libs/ardour/ardour/mute_master.h
index c219ce3ec3..228126b582 100644
--- a/libs/ardour/ardour/mute_master.h
+++ b/libs/ardour/ardour/mute_master.h
@@ -47,17 +47,13 @@ class MuteMaster : public SessionHandleRef, public PBD::Stateful
MuteMaster (Session& s, const std::string& name);
~MuteMaster() {}
- bool muted() const { return _muted && (_mute_point != MutePoint (0)); }
- bool muted_at (MutePoint mp) const { return _muted && (_mute_point & mp); }
-
- bool muted_pre_fader() const { return muted_at (PreFader); }
- bool muted_post_fader() const { return muted_at (PostFader); }
- bool muted_listen() const { return muted_at (Listen); }
- bool muted_main () const { return muted_at (Main); }
+ bool muted_by_self () const { return _muted_by_self && (_mute_point != MutePoint (0)); }
+ bool muted_by_self_at (MutePoint mp) const { return _muted_by_self && (_mute_point & mp); }
+ bool muted_by_others_at (MutePoint mp) const;
gain_t mute_gain_at (MutePoint) const;
- void set_muted (bool yn) { _muted = yn; }
+ void set_muted_by_self (bool yn) { _muted_by_self = yn; }
void mute_at (MutePoint);
void unmute_at (MutePoint);
@@ -76,7 +72,7 @@ class MuteMaster : public SessionHandleRef, public PBD::Stateful
private:
volatile MutePoint _mute_point;
- volatile bool _muted;
+ volatile bool _muted_by_self;
volatile bool _soloed;
volatile bool _solo_ignore;
};
diff --git a/libs/ardour/mute_master.cc b/libs/ardour/mute_master.cc
index bc3cca787a..9a95e70a11 100644
--- a/libs/ardour/mute_master.cc
+++ b/libs/ardour/mute_master.cc
@@ -38,7 +38,7 @@ const MuteMaster::MutePoint MuteMaster::AllPoints = MutePoint (MuteMaster::PreFa
MuteMaster::MuteMaster (Session& s, const std::string&)
: SessionHandleRef (s)
, _mute_point (AllPoints)
- , _muted (false)
+ , _muted_by_self (false)
, _soloed (false)
, _solo_ignore (false)
{
@@ -76,22 +76,22 @@ MuteMaster::mute_gain_at (MutePoint mp) const
if (Config->get_solo_mute_override()) {
if (_soloed) {
gain = 1.0;
- } else if (muted_at (mp)) { // self-muted
+ } else if (muted_by_self_at (mp)) {
gain = Config->get_solo_mute_gain ();
} else {
- if (!_solo_ignore && _session.soloing()) {
+ if (muted_by_others_at (mp)) {
gain = 0.0;
} else {
gain = 1.0;
}
}
} else {
- if (muted_at (mp)) { // self-muted
+ if (muted_by_self_at (mp)) {
gain = Config->get_solo_mute_gain ();
} else if (_soloed) {
gain = 1.0;
} else {
- if (!_solo_ignore && _session.soloing()) {
+ if (muted_by_others_at (mp)) {
gain = 0.0;
} else {
gain = 1.0;
@@ -133,9 +133,9 @@ MuteMaster::set_state (const XMLNode& node, int /*version*/)
}
if ((prop = node.property ("muted")) != 0) {
- _muted = string_is_affirmative (prop->value());
+ _muted_by_self = string_is_affirmative (prop->value());
} else {
- _muted = (_mute_point != MutePoint (0));
+ _muted_by_self = (_mute_point != MutePoint (0));
}
return 0;
@@ -146,6 +146,13 @@ MuteMaster::get_state()
{
XMLNode* node = new XMLNode (X_("MuteMaster"));
node->add_property ("mute-point", enum_2_string (_mute_point));
- node->add_property ("muted", (_muted ? X_("yes") : X_("no")));
+ node->add_property ("muted", (_muted_by_self ? X_("yes") : X_("no")));
return *node;
}
+
+bool
+MuteMaster::muted_by_others_at (MutePoint mp) const
+{
+ return (!_solo_ignore && _session.soloing() && (_mute_point & mp));
+}
+
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 86b4b89d16..1dfa66a7b1 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -748,7 +748,7 @@ Route::set_mute_points (MuteMaster::MutePoint mp)
_mute_master->set_mute_points (mp);
mute_points_changed (); /* EMIT SIGNAL */
- if (_mute_master->muted()) {
+ if (_mute_master->muted_by_self()) {
mute_changed (this); /* EMIT SIGNAL */
}
}
@@ -762,7 +762,7 @@ Route::set_mute (bool yn, void *src)
}
if (muted() != yn) {
- _mute_master->set_muted (yn);
+ _mute_master->set_muted_by_self (yn);
mute_changed (src); /* EMIT SIGNAL */
}
}
@@ -770,7 +770,7 @@ Route::set_mute (bool yn, void *src)
bool
Route::muted () const
{
- return _mute_master->muted();
+ return _mute_master->muted_by_self();
}
#if 0