diff --git a/gtk2_ardour/foldback_strip.cc b/gtk2_ardour/foldback_strip.cc index de3834d13c..8cb8f82d80 100644 --- a/gtk2_ardour/foldback_strip.cc +++ b/gtk2_ardour/foldback_strip.cc @@ -538,6 +538,10 @@ FoldbackStrip::init () *this, invalidator (*this), boost::bind (&FoldbackStrip::port_connected_or_disconnected, this, _1, _3), gui_context () ); + AudioEngine::instance()->PortPrettyNameChanged.connect ( + *this, invalidator (*this), boost::bind (&FoldbackStrip::port_pretty_name_changed, this, _1), gui_context () + ); + //watch for mouse enter/exit so we can do some stuff signal_enter_notify_event().connect (sigc::mem_fun(*this, &FoldbackStrip::mixer_strip_enter_event )); signal_leave_notify_event().connect (sigc::mem_fun(*this, &FoldbackStrip::mixer_strip_leave_event )); @@ -1174,6 +1178,14 @@ FoldbackStrip::port_connected_or_disconnected (boost::weak_ptr wa, boost:: } } +void +FoldbackStrip::port_pretty_name_changed (std::string pn) +{ + if (_route->output()->connected_to (pn)) { + update_output_display (); + } +} + void FoldbackStrip::setup_comment_button () { diff --git a/gtk2_ardour/foldback_strip.h b/gtk2_ardour/foldback_strip.h index 5de7338542..0819195872 100644 --- a/gtk2_ardour/foldback_strip.h +++ b/gtk2_ardour/foldback_strip.h @@ -275,6 +275,7 @@ private: void update_io_button (); void port_connected_or_disconnected (boost::weak_ptr, boost::weak_ptr); + void port_pretty_name_changed (std::string); bool mixer_strip_enter_event ( GdkEventCrossing * ); bool mixer_strip_leave_event ( GdkEventCrossing * ); diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 84ec964af6..cc49b7987e 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -415,6 +415,10 @@ MixerStrip::init () *this, invalidator (*this), boost::bind (&MixerStrip::port_connected_or_disconnected, this, _1, _3), gui_context () ); + AudioEngine::instance()->PortPrettyNameChanged.connect ( + *this, invalidator (*this), boost::bind (&MixerStrip::port_pretty_name_changed, this, _1), gui_context () + ); + /* Add the widgets under visibility control to the VisibilityGroup; the names used here must be the same as those used in RCOptionEditor so that the configuration changes are recognised when they occur. @@ -1611,6 +1615,19 @@ MixerStrip::port_connected_or_disconnected (boost::weak_ptr wa, boost::wea } } +void +MixerStrip::port_pretty_name_changed (std::string pn) +{ + if (_route->input()->connected_to (pn)) { + update_input_display (); + set_width_enum (_width, this); + } + if (_route->output()->connected_to (pn)) { + update_output_display (); + set_width_enum (_width, this); + } +} + void MixerStrip::setup_comment_button () { diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h index 1b45ca41ad..bb6c30be02 100644 --- a/gtk2_ardour/mixer_strip.h +++ b/gtk2_ardour/mixer_strip.h @@ -320,6 +320,7 @@ private: void update_io_button (bool input_button); void port_connected_or_disconnected (boost::weak_ptr, boost::weak_ptr); + void port_pretty_name_changed (std::string); bool mixer_strip_enter_event ( GdkEventCrossing * ); bool mixer_strip_leave_event ( GdkEventCrossing * ); diff --git a/gtk2_ardour/monitor_section.cc b/gtk2_ardour/monitor_section.cc index ffa757c2b7..2e25854dfd 100644 --- a/gtk2_ardour/monitor_section.cc +++ b/gtk2_ardour/monitor_section.cc @@ -507,6 +507,9 @@ MonitorSection::MonitorSection () AudioEngine::instance()->PortConnectedOrDisconnected.connect ( *this, invalidator (*this), boost::bind (&MonitorSection::port_connected_or_disconnected, this, _1, _3), gui_context () ); + AudioEngine::instance()->PortPrettyNameChanged.connect ( + *this, invalidator (*this), boost::bind (&MonitorSection::port_pretty_name_changed, this, _1), gui_context () + ); Config->ParameterChanged.connect (config_connection, invalidator (*this), boost::bind (&MonitorSection::parameter_changed, this, _1), gui_context()); } @@ -1590,6 +1593,18 @@ MonitorSection::port_connected_or_disconnected (boost::weak_ptr wa, boost: } } +void +MonitorSection::port_pretty_name_changed (std::string pn) +{ + if (!_route) { + return; + } + if (_route->output()->connected_to (pn)) { + update_output_display (); + } +} + + void MonitorSection::load_bindings () { diff --git a/gtk2_ardour/monitor_section.h b/gtk2_ardour/monitor_section.h index e42063b38f..969c2f9649 100644 --- a/gtk2_ardour/monitor_section.h +++ b/gtk2_ardour/monitor_section.h @@ -174,6 +174,7 @@ private: void unassign_controllables (); void port_connected_or_disconnected (boost::weak_ptr, boost::weak_ptr); + void port_pretty_name_changed (std::string); void update_processor_box (); diff --git a/gtk2_ardour/plugin_pin_dialog.cc b/gtk2_ardour/plugin_pin_dialog.cc index 9d937648d6..3d4b84acfd 100644 --- a/gtk2_ardour/plugin_pin_dialog.cc +++ b/gtk2_ardour/plugin_pin_dialog.cc @@ -260,6 +260,9 @@ PluginPinWidget::PluginPinWidget (boost::shared_ptr pi) AudioEngine::instance ()->PortConnectedOrDisconnected.connect ( _io_connection, invalidator (*this), boost::bind (&PluginPinWidget::port_connected_or_disconnected, this, _1, _3), gui_context () ); + AudioEngine::instance ()->PortPrettyNameChanged.connect ( + _io_connection, invalidator (*this), boost::bind (&PluginPinWidget::port_pretty_name_changed, this, _1), gui_context () + ); } PluginPinWidget::~PluginPinWidget () @@ -1906,6 +1909,15 @@ PluginPinWidget::port_connected_or_disconnected (boost::weak_ptr w } } +void +PluginPinWidget::port_pretty_name_changed (std::string pn) +{ + boost::shared_ptr io = _pi->sidechain_input (); + if (io && io->connected_to (pn)) { + queue_idle_update (); + } +} + /* lifted from ProcessorEntry::Control */ PluginPinWidget::Control::Control (boost::shared_ptr c, string const & n) : _control (c) diff --git a/gtk2_ardour/plugin_pin_dialog.h b/gtk2_ardour/plugin_pin_dialog.h index 050d9380aa..9ae152c046 100644 --- a/gtk2_ardour/plugin_pin_dialog.h +++ b/gtk2_ardour/plugin_pin_dialog.h @@ -171,12 +171,13 @@ private: uint32_t add_port_to_table (boost::shared_ptr, uint32_t, bool); uint32_t maybe_add_route_to_input_menu (boost::shared_ptr, ARDOUR::DataType, boost::weak_ptr); void port_connected_or_disconnected (boost::weak_ptr, boost::weak_ptr); + void port_pretty_name_changed (std::string); bool sc_input_press (GdkEventButton *, boost::weak_ptr); bool sc_input_release (GdkEventButton *); PBD::ScopedConnectionList _plugin_connections; - PBD::ScopedConnection _io_connection; + PBD::ScopedConnectionList _io_connection; boost::shared_ptr _pi; void queue_idle_update (); diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index 5c5e3caa37..353c510b55 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -170,6 +170,8 @@ PortMatrix::init () /* and also ports */ _session->engine().PortRegisteredOrUnregistered.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_global_ports, this), gui_context()); + _session->engine().PortPrettyNameChanged.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_all_ports, this), gui_context()); + /* watch for route order keys changing, which changes the order of things in our global ports list(s) */ PresentationInfo::Change.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_global_ports_proxy, this), gui_context()); diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 10efac724d..5a8eac0a9d 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -628,6 +628,8 @@ ProcessorEntry::name (Width w) const std::string send_name; bool pretty_ok = true; + // TODO, subscribe to PortPrettyNameChanged + if (send->remove_on_disconnect ()) { // assume it's a sidechain, find pretty name of connected port(s) PortSet& ps (send->output ()->ports ()); diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 4760ea7f71..9fe41d7a73 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -1365,7 +1365,7 @@ private: PortColumns _port_columns; Glib::RefPtr _store; - PBD::ScopedConnection _engine_connection; + PBD::ScopedConnectionList _engine_connection; void on_map () { @@ -1374,11 +1374,17 @@ private: invalidator (*this), boost::bind (<CPortSelectOption::update_port_combo, this), gui_context()); + + AudioEngine::instance()->PortPrettyNameChanged.connect ( + _engine_connection, + invalidator (*this), + boost::bind (<CPortSelectOption::update_port_combo, this), + gui_context()); } void on_unmap () { - _engine_connection.disconnect (); + _engine_connection.drop_connections (); } void port_changed () diff --git a/gtk2_ardour/transport_masters_dialog.cc b/gtk2_ardour/transport_masters_dialog.cc index af7a08432d..7e71d05b3f 100644 --- a/gtk2_ardour/transport_masters_dialog.cc +++ b/gtk2_ardour/transport_masters_dialog.cc @@ -58,6 +58,7 @@ TransportMastersWidget::TransportMastersWidget () audio_port_store = ListStore::create (port_columns); AudioEngine::instance()->PortRegisteredOrUnregistered.connect (port_reg_connection, invalidator (*this), boost::bind (&TransportMastersWidget::update_ports, this), gui_context()); + AudioEngine::instance()->PortPrettyNameChanged.connect (port_reg_connection, invalidator (*this), boost::bind (&TransportMastersWidget::update_ports, this), gui_context()); update_ports (); Gtk::Table *add_table = manage(new Gtk::Table(1,2)); diff --git a/gtk2_ardour/transport_masters_dialog.h b/gtk2_ardour/transport_masters_dialog.h index 4441646e87..d5704a8837 100644 --- a/gtk2_ardour/transport_masters_dialog.h +++ b/gtk2_ardour/transport_masters_dialog.h @@ -158,7 +158,7 @@ class TransportMastersWidget : public Gtk::VBox, public ARDOUR::SessionHandlePtr Glib::RefPtr midi_port_store; Glib::RefPtr audio_port_store; - PBD::ScopedConnection port_reg_connection; + PBD::ScopedConnectionList port_reg_connection; void update_ports (); bool ignore_active_change; void build_port_model (Glib::RefPtr, std::vector const &);