From 5b5e64d860f40c949cf58d75de81fc86914f1baa Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 21 Apr 2016 02:02:13 -0400 Subject: [PATCH] remove Route::listening_via_monitor() This is better tested with direct use of the solo_control and Config->get_solo_controls_are_listen_controls() --- gtk2_ardour/editor_routes.cc | 10 +--------- gtk2_ardour/route_ui.cc | 20 ++++---------------- libs/ardour/ardour/route.h | 2 -- libs/ardour/ardour/solo_control.h | 12 +++++++++--- libs/ardour/route.cc | 10 ---------- libs/ardour/session.cc | 4 +++- libs/surfaces/faderport/faderport.cc | 2 +- libs/surfaces/faderport/operations.cc | 10 +--------- libs/surfaces/mackie/strip.cc | 2 +- 9 files changed, 20 insertions(+), 52 deletions(-) diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index 9a2153f99f..7daeea3d7c 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -468,15 +468,7 @@ EditorRoutes::on_tv_solo_enable_toggled (std::string const & path_string) RouteTimeAxisView* rtv = dynamic_cast (tv); if (rtv != 0) { - bool newval; - - if (Config->get_solo_control_is_listen_control()) { - newval = !rtv->route()->listening_via_monitor(); - } else { - newval = !rtv->route()->self_soloed(); - } - - rtv->route()->solo_control()->set_value (newval ? 1.0 : 0.0, Controllable::UseGroup); + rtv->route()->solo_control()->set_value (rtv->route()->soloed() ? 0.0 : 1.0, Controllable::UseGroup); } } diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index bfd3ed1006..126e3af996 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -1120,22 +1120,10 @@ RouteUI::solo_active_state (boost::shared_ptr r) return Gtkmm2ext::Off; } - if (Config->get_solo_control_is_listen_control()) { - - if (r->listening_via_monitor()) { - return Gtkmm2ext::ExplicitActive; - } else { - return Gtkmm2ext::Off; - } - - } - - if (r->soloed()) { - if (!r->self_soloed()) { - return Gtkmm2ext::ImplicitActive; - } else { - return Gtkmm2ext::ExplicitActive; - } + if (r->self_soloed()) { + return Gtkmm2ext::ExplicitActive; + } else if (r->soloed_by_others()) { + return Gtkmm2ext::ImplicitActive; } else { return Gtkmm2ext::Off; } diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index d93883b600..46c5b1f3c7 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -181,8 +181,6 @@ public: bool is_safe () const { return _solo_safe_control->get_value(); } - - bool listening_via_monitor () const; void enable_monitor_send (); void set_denormal_protection (bool yn); diff --git a/libs/ardour/ardour/solo_control.h b/libs/ardour/ardour/solo_control.h index bcb01344a4..24b8353dc1 100644 --- a/libs/ardour/ardour/solo_control.h +++ b/libs/ardour/ardour/solo_control.h @@ -60,6 +60,15 @@ class LIBARDOUR_API SoloControl : public SlavableAutomationControl /* API to check different aspects of solo substate */ + bool self_soloed () const { + return _self_solo; + } + bool soloed_by_masters () const { + return get_masters_value(); + } + bool soloed_by_self_or_masters () const { + return self_soloed() || get_masters_value (); + } bool soloed_by_others () const { return _soloed_by_others_downstream || _soloed_by_others_downstream || get_masters_value (); } @@ -69,9 +78,6 @@ class LIBARDOUR_API SoloControl : public SlavableAutomationControl uint32_t soloed_by_others_downstream () const { return _soloed_by_others_downstream; } - bool self_soloed () const { - return _self_solo; - } bool soloed() const { return self_soloed() || soloed_by_others(); } /* The session object needs to respond to solo diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index fef9fb507b..64f8764303 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -759,16 +759,6 @@ Route::solo_control_changed (bool, Controllable::GroupControlDisposition) } } -bool -Route::listening_via_monitor () const -{ - if (_monitor_send) { - return _monitor_send->active (); - } else { - return false; - } -} - void Route::push_solo_isolate_upstream (int32_t delta) { diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index c207934534..f706dd00ee 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -3701,7 +3701,9 @@ Session::route_listen_changed (Controllable::GroupControlDisposition group_overr return; } - if (route->listening_via_monitor ()) { + assert (Config->get_solo_control_is_listen_control()); + + if (route->solo_control()->soloed_by_self_or_masters()) { if (Config->get_exclusive_solo()) { diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc index 1cc47b52e1..3d549348f4 100644 --- a/libs/surfaces/faderport/faderport.cc +++ b/libs/surfaces/faderport/faderport.cc @@ -1241,7 +1241,7 @@ void FaderPort::map_solo () { if (_current_route) { - get_button (Solo).set_led_state (_output_port, _current_route->soloed() || _current_route->listening_via_monitor()); + get_button (Solo).set_led_state (_output_port, _current_route->soloed()); } else { get_button (Solo).set_led_state (_output_port, false); } diff --git a/libs/surfaces/faderport/operations.cc b/libs/surfaces/faderport/operations.cc index 592b26da23..ec60727392 100644 --- a/libs/surfaces/faderport/operations.cc +++ b/libs/surfaces/faderport/operations.cc @@ -141,15 +141,7 @@ FaderPort::solo () return; } - bool yn; - - if (Config->get_solo_control_is_listen_control()) { - yn = !_current_route->listening_via_monitor(); - } else { - yn = !_current_route->soloed(); - } - - _current_route->solo_control()->set_value (yn ? 1.0 : 0.0, PBD::Controllable::UseGroup); + _current_route->solo_control()->set_value (_current_route->soloed() ? 0.0 : 1.0, PBD::Controllable::UseGroup); } void diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc index 0062c3b4fb..9c3fc21bda 100644 --- a/libs/surfaces/mackie/strip.cc +++ b/libs/surfaces/mackie/strip.cc @@ -285,7 +285,7 @@ void Strip::notify_solo_changed () { if (_route && _solo) { - _surface->write (_solo->set_state ((_route->soloed() || _route->listening_via_monitor()) ? on : off)); + _surface->write (_solo->set_state (_route->soloed() ? on : off)); } } -- 2.30.2