Remove erroneous handling of input IO for sends, which don't have them. Fixes #3694.
[ardour.git] / gtk2_ardour / send_ui.cc
index 9f30616cf876b429cf608234aab0fe739c232d29..1c668bd2ada28480f7aab5d6d1842084f7c117b0 100644 (file)
 #include "ardour_ui.h"
 #include "gui_thread.h"
 
+#include "i18n.h"
+
 using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
-SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session& se)
+SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session)
        : _send (s)
-       , _session (se)
-       , _gpm (se)
-       , _panners (se)
+       , _gpm (session, 250)
+       , _panners (session)
 {
+       assert (_send);
+
        _panners.set_panner (s->panner());
        _gpm.set_controls (boost::shared_ptr<Route>(), s->meter(), s->amp());
 
@@ -50,9 +53,9 @@ SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session& se)
        _vbox.set_border_width (5);
 
        _vbox.pack_start (_hbox, false, false, false);
-       _vbox.pack_start (_panners, false,false);
+       _vbox.pack_start (_panners, false, false);
 
-       io = manage (new IOSelector (parent, se, s->output()));
+       io = manage (new IOSelector (parent, session, s->output()));
 
        pack_start (_vbox, false, false);
 
@@ -62,8 +65,7 @@ SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session& se)
 
        _send->set_metering (true);
 
-       _send->input()->changed.connect (mem_fun (*this, &SendUI::ins_changed));
-       _send->output()->changed.connect (mem_fun (*this, &SendUI::outs_changed));
+       _send->output()->changed.connect (connections, invalidator (*this), ui_bind (&SendUI::outs_changed, this, _1, _2), gui_context());
 
        _panners.set_width (Wide);
        _panners.setup_pan ();
@@ -72,9 +74,9 @@ SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session& se)
        _gpm.set_fader_name ("SendUIFrame");
 
        // screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect (
-       //              mem_fun (*this, &SendUI::update));
+       //              sigc::mem_fun (*this, &SendUI::update));
        fast_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (
-                       mem_fun (*this, &SendUI::fast_update));
+                       sigc::mem_fun (*this, &SendUI::fast_update));
 }
 
 SendUI::~SendUI ()
@@ -88,19 +90,10 @@ SendUI::~SendUI ()
 }
 
 void
-SendUI::ins_changed (IOChange change, void* ignored)
-{
-       ENSURE_GUI_THREAD(bind (mem_fun (*this, &SendUI::ins_changed), change, ignored));
-       if (change & ConfigurationChanged) {
-               _panners.setup_pan ();
-       }
-}
-
-void
-SendUI::outs_changed (IOChange change, void* ignored)
+SendUI::outs_changed (IOChange change, void* /*ignored*/)
 {
-       ENSURE_GUI_THREAD(bind (mem_fun (*this, &SendUI::outs_changed), change, ignored));
-       if (change & ConfigurationChanged) {
+       ENSURE_GUI_THREAD (*this, &SendUI::outs_changed, change, ignored)
+       if (change.type & IOChange::ConfigurationChanged) {
                _panners.setup_pan ();
                _gpm.setup_meters ();
        }
@@ -119,10 +112,10 @@ SendUI::fast_update ()
        }
 }
 
-SendUIWindow::SendUIWindow (boost::shared_ptr<Send> s, Session& ss)
-       : ArdourDialog (string("Ardour: send ") + s->name())
+SendUIWindow::SendUIWindow (boost::shared_ptr<Send> s, Session* session)
+       : ArdourDialog (string (_("Send ")) + s->name())
 {
-       ui = new SendUI (this, s, ss);
+       ui = new SendUI (this, s, session);
 
        hpacker.pack_start (*ui, true, true);
 
@@ -131,10 +124,9 @@ SendUIWindow::SendUIWindow (boost::shared_ptr<Send> s, Session& ss)
 
        set_name ("SendUIWindow");
 
-       going_away_connection = s->GoingAway.connect (
-                       mem_fun (*this, &SendUIWindow::send_going_away));
+       s->DropReferences.connect (going_away_connection, invalidator (*this), boost::bind (&SendUIWindow::send_going_away, this), gui_context());
 
-       signal_delete_event().connect (bind (
+       signal_delete_event().connect (sigc::bind (
                                               sigc::ptr_fun (just_hide_it),
                                               reinterpret_cast<Window *> (this)));
 }
@@ -147,8 +139,8 @@ SendUIWindow::~SendUIWindow ()
 void
 SendUIWindow::send_going_away ()
 {
-       ENSURE_GUI_THREAD (mem_fun (*this, &SendUIWindow::send_going_away));
-       delete_when_idle (this);
+       ENSURE_GUI_THREAD (*this, &SendUIWindow::send_going_away)
        going_away_connection.disconnect ();
+       delete_when_idle (this);
 }