extend strict-i/o to include route outputs.
[ardour.git] / gtk2_ardour / mixer_strip.cc
index 99bd730b9f00bbf23227141efa5f60455011dbd8..72ed56698254b9a438d9890fb5bbc1a2d9619ded 100644 (file)
@@ -501,8 +501,10 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
                }
                if (monitor_section_button == 0) {
                        Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMonitorSection");
+                       _session->MonitorChanged.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::monitor_changed, this), gui_context());
+
                        monitor_section_button = manage (new ArdourButton);
-                       monitor_section_button->set_name ("monitor section button");
+                       monitor_changed ();
                        monitor_section_button->set_related_action (act);
                        set_tooltip (monitor_section_button, _("Show/Hide Monitoring Section"));
                        mute_solo_table.attach (*monitor_section_button, 1, 2, 0, 1);
@@ -635,7 +637,7 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
        update_mute_display ();
        update_solo_display ();
        name_changed ();
-       comment_changed (0);
+       comment_changed ();
        route_group_changed ();
 
        connect_to_pan ();
@@ -1265,7 +1267,7 @@ MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width widt
                                                << Gtkmm2ext::markup_escape_text ( pn.empty() ? connection_name : pn );
                                }
 
-                               if (connection_name.find("ardour:") == 0) {
+                               if (connection_name.find(RouteUI::program_port_prefix) == 0) {
                                        if (ardour_track_name.empty()) {
                                                // "ardour:Master/in 1" -> "ardour:Master/"
                                                string::size_type slash = connection_name.find("/");
@@ -1353,6 +1355,8 @@ MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width widt
                set_tooltip (&output_button, tooltip_cstr);
        }
 
+       delete [] tooltip_cstr;
+
        if (each_io_has_one_connection) {
                if (total_connection_count == ardour_connection_count) {
                        // all connections are to the same track in ardour
@@ -1585,6 +1589,12 @@ MixerStrip::build_route_ops_menu ()
        i->set_sensitive(! _session->transport_rolling());
        i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::set_route_active), !_route->active(), false));
 
+       items.push_back (SeparatorElem());
+       items.push_back (CheckMenuElem (_("Strict I/O")));
+       i = dynamic_cast<Gtk::CheckMenuItem *> (&items.back());
+       i->set_active (_route->strict_io());
+       i->signal_activate().connect (sigc::hide_return (sigc::bind (sigc::mem_fun (*_route, &Route::set_strict_io), !_route->strict_io())));
+
        items.push_back (SeparatorElem());
 
        items.push_back (MenuElem (_("Adjust Latency..."), sigc::mem_fun (*this, &RouteUI::adjust_latency)));
@@ -1594,10 +1604,8 @@ MixerStrip::build_route_ops_menu ()
        denormal_menu_item = dynamic_cast<Gtk::CheckMenuItem *> (&items.back());
        denormal_menu_item->set_active (_route->denormal_protection());
 
-       if (!Profile->get_sae()) {
-               items.push_back (SeparatorElem());
-               items.push_back (MenuElem (_("Remote Control ID..."), sigc::mem_fun (*this, &RouteUI::open_remote_control_id_dialog)));
-       }
+       items.push_back (SeparatorElem());
+       items.push_back (MenuElem (_("Remote Control ID..."), sigc::mem_fun (*this, &RouteUI::open_remote_control_id_dialog)));
 
        if (_route) {
                /* note that this relies on selection being shared across editor and
@@ -1948,6 +1956,18 @@ MixerStrip::meter_point_string (MeterPoint mp)
        return string();
 }
 
+/** Called when the monitor-section state */
+void
+MixerStrip::monitor_changed ()
+{
+       assert (monitor_section_button);
+       if (_session->monitor_active()) {
+               monitor_section_button->set_name ("master monitor section button active");
+       } else {
+               monitor_section_button->set_name ("master monitor section button normal");
+       }
+}
+
 /** Called when the metering point has changed */
 void
 MixerStrip::meter_changed ()
@@ -2024,7 +2044,7 @@ MixerStrip::show_send (boost::shared_ptr<Send> send)
        send->set_metering (true);
        _current_delivery->DropReferences.connect (send_gone_connection, invalidator (*this), boost::bind (&MixerStrip::revert_to_default_display, this), gui_context());
 
-       gain_meter().set_controls (_route, send->meter(), send->amp());
+       gain_meter().set_controls (_route, send->meter(), send->amp(), send->gain_control());
        gain_meter().setup_meters ();
 
        uint32_t const in = _current_delivery->pans_required();
@@ -2063,7 +2083,7 @@ MixerStrip::revert_to_default_display ()
 
        set_current_delivery (_route->main_outs ());
 
-       gain_meter().set_controls (_route, _route->shared_peak_meter(), _route->amp());
+       gain_meter().set_controls (_route, _route->shared_peak_meter(), _route->amp(), _route->gain_control());
        gain_meter().setup_meters ();
 
        panner_ui().set_panner (_route->main_outs()->panner_shell(), _route->main_outs()->panner());
@@ -2225,7 +2245,7 @@ MixerStrip::parameter_changed (string p)
                        if (monitor_section_button->get_parent()) {
                                monitor_section_button->get_parent()->remove(*monitor_section_button);
                        }
-                       if (_session->monitor_out()) {
+                       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();