+ gain_t gain;
+ const SoloLevel l = _solo_level;
+
+ // cerr << "solo level = " << _solo_level << " selfmuted " << self_muted_at (mp) << " omute " << muted_by_others_at (mp) << endl;
+
+ if (Config->get_solo_mute_override()) {
+ if ((l == SelfSoloed) || (l == DownstreamSoloed)) {
+ gain = 1.0;
+ } else if (self_muted_at (mp)) { // self-muted
+ gain = Config->get_solo_mute_gain ();
+ } else if (l == UpstreamSoloed) {
+ gain = 1.0;
+ } else if (muted_by_others_at (mp)) { // muted by others
+ gain = Config->get_solo_mute_gain ();
+ } else {
+ if (!_solo_ignore && _session.soloing()) {
+ gain = 0.0;
+ } else {
+ gain = 1.0;
+ }
+ }
+ } else {
+ if (self_muted_at (mp)) { // self-muted
+ gain = Config->get_solo_mute_gain ();
+ } else if ((l == SelfSoloed) || (l == DownstreamSoloed)) {
+ gain = 1.0;
+ } else if (muted_by_others_at (mp)) { // muted by others
+ gain = Config->get_solo_mute_gain ();
+ } else if (l == UpstreamSoloed) { // soloed by others
+ gain = 1.0;
+ } else {
+ if (!_solo_ignore && _session.soloing()) {
+ gain = 0.0;
+ } else {
+ gain = 1.0;
+ }
+ }
+ }
+
+ // cerr << "\tgain = " << gain << endl;
+
+ return gain;