Remove use of i18n macros in headers. Prevents our gettext.h being included before...
[ardour.git] / gtk2_ardour / send_ui.cc
index 0e030db091aaf12d41ec733fa378daa751617188..3cc17faaea5c2e64087a7fbb9c562472109b6fe8 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, 250)
-       , _panners (se)
+       , _gpm (session, 250)
+       , _panners (session)
 {
        _panners.set_panner (s->panner());
        _gpm.set_controls (boost::shared_ptr<Route>(), s->meter(), s->amp());
@@ -52,7 +53,7 @@ SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session& se)
        _vbox.pack_start (_hbox, false, 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 +63,8 @@ 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->input()->changed.connect (connections, invalidator (*this), ui_bind (&SendUI::ins_changed, this, _1, _2), gui_context());
+       _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 +73,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 ()
@@ -90,7 +91,7 @@ SendUI::~SendUI ()
 void
 SendUI::ins_changed (IOChange change, void* ignored)
 {
-       ENSURE_GUI_THREAD(bind (mem_fun (*this, &SendUI::ins_changed), change, ignored));
+       ENSURE_GUI_THREAD (*this, &SendUI::ins_changed, change, ignored)
        if (change & ConfigurationChanged) {
                _panners.setup_pan ();
        }
@@ -99,7 +100,7 @@ SendUI::ins_changed (IOChange change, void* ignored)
 void
 SendUI::outs_changed (IOChange change, void* ignored)
 {
-       ENSURE_GUI_THREAD(bind (mem_fun (*this, &SendUI::outs_changed), change, ignored));
+       ENSURE_GUI_THREAD (*this, &SendUI::outs_changed, change, ignored)
        if (change & ConfigurationChanged) {
                _panners.setup_pan ();
                _gpm.setup_meters ();
@@ -119,10 +120,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 +132,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 +147,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);
 }