diff options
author | Robin Gareus <robin@gareus.org> | 2019-03-01 16:51:08 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-03-01 16:51:08 +0100 |
commit | 94d3da7e09a70e4384dce7e92b27f3dd3abb385b (patch) | |
tree | 8ea0f603bbeda12fa3de1eca13d55016f5c05e7b /gtk2_ardour/mixer_strip.cc | |
parent | 9836304e3eb60bbe20e326c0323beee7e9252e65 (diff) |
GUI updates to handle monitor-section changes
This fixes various MS related action sensitivity issues, as well
as action-states.
Also manually adding a monitor-section to a session now always
immediately shows it, regardless of prior ToggleMonitorSection
visibility.
Diffstat (limited to 'gtk2_ardour/mixer_strip.cc')
-rw-r--r-- | gtk2_ardour/mixer_strip.cc | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 1e7c94f906..68e4ab8e5c 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -583,6 +583,7 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt) if (monitor_section_button == 0) { Glib::RefPtr<Action> act = ActionManager::get_action ("Mixer", "ToggleMonitorSection"); _session->MonitorChanged.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::monitor_changed, this), gui_context()); + _session->MonitorBusAddedOrRemoved.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::monitor_section_added_or_removed, this), gui_context()); monitor_section_button = manage (new ArdourButton); monitor_changed (); @@ -591,8 +592,8 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt) mute_solo_table.attach (*monitor_section_button, 1, 2, 0, 1); monitor_section_button->show(); monitor_section_button->unset_flags (Gtk::CAN_FOCUS); + monitor_section_added_or_removed (); } - parameter_changed ("use-monitor-bus"); } else { bottom_button_table.attach (group_button, 1, 2, 0, 1); mute_solo_table.attach (*mute_button, 0, 1, 0, 1); @@ -2115,6 +2116,27 @@ MixerStrip::monitor_changed () } } +void +MixerStrip::monitor_section_added_or_removed () +{ + assert (monitor_section_button); + if (mute_button->get_parent()) { + mute_button->get_parent()->remove(*mute_button); + } + if (monitor_section_button->get_parent()) { + monitor_section_button->get_parent()->remove(*monitor_section_button); + } + if (_session && _session->monitor_out ()) { + mute_solo_table.attach (*mute_button, 0, 1, 0, 1); + mute_solo_table.attach (*monitor_section_button, 1, 2, 0, 1); + mute_button->show(); + monitor_section_button->show(); + } else { + mute_solo_table.attach (*mute_button, 0, 2, 0, 1); + mute_button->show(); + } +} + /** Called when the metering point has changed */ void MixerStrip::meter_changed () @@ -2394,24 +2416,6 @@ MixerStrip::parameter_changed (string p) } else if (p == "track-name-number") { name_changed (); update_track_number_visibility(); - } else if (p == "use-monitor-bus") { - if (monitor_section_button) { - if (mute_button->get_parent()) { - mute_button->get_parent()->remove(*mute_button); - } - if (monitor_section_button->get_parent()) { - monitor_section_button->get_parent()->remove(*monitor_section_button); - } - if (Config->get_use_monitor_bus ()) { - mute_solo_table.attach (*mute_button, 0, 1, 0, 1); - mute_solo_table.attach (*monitor_section_button, 1, 2, 0, 1); - mute_button->show(); - monitor_section_button->show(); - } else { - mute_solo_table.attach (*mute_button, 0, 2, 0, 1); - mute_button->show(); - } - } } } |