diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index fe1e5af62b..69c876ba99 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -1894,5 +1894,6 @@ int EditorRoutes::plugin_setup (boost::shared_ptr r, boost::shared_ptr pi, ARDOUR::Route::PluginSetupOptions flags) { PluginSetupDialog psd (r, pi, flags); - return psd.run (); + int rv = psd.run (); + return rv + (psd.fan_out() ? 4 : 0); } diff --git a/gtk2_ardour/plugin_setup_dialog.cc b/gtk2_ardour/plugin_setup_dialog.cc index 5feb76aefe..3df0fe6491 100644 --- a/gtk2_ardour/plugin_setup_dialog.cc +++ b/gtk2_ardour/plugin_setup_dialog.cc @@ -31,6 +31,7 @@ PluginSetupDialog::PluginSetupDialog (boost::shared_ptr r, boost: , _route (r) , _pi (pi) , _keep_mapping (_("Copy I/O Map"), ArdourButton::led_default_elements) + , _fan_out (_("Fan out"), ArdourButton::led_default_elements) { assert (flags != Route::None); @@ -71,7 +72,7 @@ PluginSetupDialog::PluginSetupDialog (boost::shared_ptr r, boost: f->add (*box); tbl->attach (*f, 0, 1, row, row + 1, EXPAND|FILL, SHRINK, 0, 8); - _keep_mapping.signal_clicked.connect (sigc::mem_fun (*this, &PluginSetupDialog::apply_mapping)); + _keep_mapping.signal_clicked.connect (sigc::mem_fun (*this, &PluginSetupDialog::apply_mapping)); add_button ("Replace", 2); } else { @@ -86,16 +87,19 @@ PluginSetupDialog::PluginSetupDialog (boost::shared_ptr r, boost: Box* box = manage (new HBox ()); box->set_border_width (2); box->pack_start (_out_presets, true, true); + box->pack_start (_fan_out, false, false); Frame* f = manage (new Frame ()); f->set_label (_("Output Configuration")); f->add (*box); tbl->attach (*f, 1, 2, row, row + 1, EXPAND|FILL, SHRINK, 0, 8); + _fan_out.signal_clicked.connect (sigc::mem_fun (*this, &PluginSetupDialog::toggle_fan_out)); } else { _pi->set_preset_out (_pi->natural_output_streams ()); update_sensitivity (_pi->natural_output_streams ().n_audio ()); } _keep_mapping.set_active (false); + _fan_out.set_active (false); apply_mapping (); add_button (Stock::ADD, 0); @@ -162,6 +166,7 @@ PluginSetupDialog::update_sensitivity (uint32_t n_audio) } else { _keep_mapping.set_sensitive (false); } + _fan_out.set_sensitive (n_audio > 2); } bool @@ -190,6 +195,12 @@ PluginSetupDialog::apply_mapping () } } +void +PluginSetupDialog::toggle_fan_out () +{ + _fan_out.set_active (!_fan_out.get_active ()); +} + std::string PluginSetupDialog::preset_label (uint32_t n_audio) const { diff --git a/gtk2_ardour/plugin_setup_dialog.h b/gtk2_ardour/plugin_setup_dialog.h index b2fc3e77f2..8d07b62539 100644 --- a/gtk2_ardour/plugin_setup_dialog.h +++ b/gtk2_ardour/plugin_setup_dialog.h @@ -30,6 +30,8 @@ class PluginSetupDialog : public ArdourDialog public: PluginSetupDialog (boost::shared_ptr, boost::shared_ptr, ARDOUR::Route::PluginSetupOptions); + bool fan_out () const { return _fan_out.get_active () && _fan_out.get_sensitive (); } + private: void setup_output_presets (); void update_sensitivity (uint32_t); @@ -37,6 +39,7 @@ private: void select_output_preset (uint32_t n_audio); void apply_mapping (); + void toggle_fan_out (); std::string preset_label (uint32_t) const; @@ -45,6 +48,7 @@ private: ArdourDropdown _out_presets; ArdourButton _keep_mapping; + ArdourButton _fan_out; ARDOUR::ChanCount _cur_inputs; ARDOUR::ChanCount _cur_outputs; }; diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 9c4ddeade8..1ce6114a3e 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -285,6 +285,7 @@ RouteUI::set_route (boost::shared_ptr rp) _route->solo_safe_control()->Changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::update_solo_display, this), gui_context()); _route->solo_isolate_control()->Changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::update_solo_display, this), gui_context()); _route->phase_control()->Changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::polarity_changed, this), gui_context()); + _route->fan_out.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::fan_out, this, true, true), gui_context()); if (is_track()) { track()->FreezeChange.connect (*this, invalidator (*this), boost::bind (&RouteUI::map_frozen, this), gui_context());