diff options
author | Carl Hetherington <carl@carlh.net> | 2009-11-26 03:02:16 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-11-26 03:02:16 +0000 |
commit | 966e09677d74be7d54ac253a6c244882d6efaffd (patch) | |
tree | c13830de2f78c78c9e6abf1ead2efacba2464d48 /gtk2_ardour/route_ui.cc | |
parent | 7664d86dc548ced3cf6947320de0cd235353d78d (diff) |
Fix #2926 and #2927; presence and behaviour of solo/mute icons in the editor list.
git-svn-id: svn://localhost/ardour2/branches/3.0@6185 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_ui.cc')
-rw-r--r-- | gtk2_ardour/route_ui.cc | 99 |
1 files changed, 60 insertions, 39 deletions
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 2de7c6964e..9e682573ca 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -658,11 +658,36 @@ RouteUI::listen_changed(void* /*src*/) Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &RouteUI::update_solo_display)); } +int +RouteUI::solo_visual_state (boost::shared_ptr<Route> r) +{ + if (Config->get_solo_control_is_listen_control()) { + + if (r->listening()) { + return 1; + } else { + return 0; + } + + } else { + + if (r->solo_isolated()) { + return 2; + } else if (r->soloed()) { + return 1; + } else { + return 0; + } + } + + return 0; +} + void RouteUI::update_solo_display () { bool x; - + if (Config->get_solo_control_is_listen_control()) { if (solo_button->get_active() != (x = _route->listening())) { @@ -671,29 +696,17 @@ RouteUI::update_solo_display () ignore_toggle = false; } - if (x) { - solo_button->set_visual_state (1); - } else { - solo_button->set_visual_state (0); - } - - } else { - if (solo_button->get_active() != (x = _route->soloed())){ + if (solo_button->get_active() != (x = _route->soloed())) { ignore_toggle = true; solo_button->set_active (x); ignore_toggle = false; } - if (_route->solo_isolated()) { - solo_button->set_visual_state (2); - } else if (x) { - solo_button->set_visual_state (1); - } else { - solo_button->set_visual_state (0); - } } + + solo_button->set_visual_state (solo_visual_state (_route)); } void @@ -708,6 +721,36 @@ RouteUI::mute_changed(void* /*src*/) Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &RouteUI::update_mute_display)); } +int +RouteUI::mute_visual_state (Session& s, boost::shared_ptr<Route> r) +{ + if (Config->get_show_solo_mutes()) { + + if (r->muted ()) { + /* full mute */ + return 2; + } else if (s.soloing() && !r->soloed() && !r->solo_isolated()) { + /* mute-because-not-soloed */ + return 1; + } else { + /* no mute at all */ + return 0; + } + + } else { + + if (r->muted()) { + /* full mute */ + return 2; + } else { + /* no mute at all */ + return 0; + } + } + + return 0; +} + void RouteUI::update_mute_display () { @@ -724,29 +767,7 @@ RouteUI::update_mute_display () ignore_toggle = false; } - /* now attend to visual state */ - - if (Config->get_show_solo_mutes()) { - if (_route->muted()) { - /* full mute */ - mute_button->set_visual_state (2); - } else if (_session.soloing() && !_route->soloed() && !_route->solo_isolated()) { - /* mute-because-not-soloed */ - mute_button->set_visual_state (1); - } else { - /* no mute at all */ - mute_button->set_visual_state (0); - } - } else { - if (_route->muted()) { - /* full mute */ - mute_button->set_visual_state (2); - } else { - /* no mute at all */ - mute_button->set_visual_state (0); - } - } - + mute_button->set_visual_state (mute_visual_state (_session, _route)); } void |