independent panning for external sends
[ardour.git] / gtk2_ardour / send_ui.cc
index 677abebf8d1326185189866f8503d293715cc507..54663dbe0a0cabddae00c65bd2fd4db5e0fb3e94 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <gtkmm2ext/doi.h>
 
-#include "ardour/amp.h"
 #include "ardour/io.h"
 #include "ardour/send.h"
 #include "ardour/rc_configuration.h"
@@ -30,6 +29,8 @@
 #include "ardour_ui.h"
 #include "gui_thread.h"
 
+#include "i18n.h"
+
 using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
@@ -39,11 +40,13 @@ SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session
        , _gpm (session, 250)
        , _panners (session)
 {
-       _panners.set_panner (s->panner());
+       assert (_send);
+
+       _panners.set_panner (s->panner_shell(), s->panner());
        _gpm.set_controls (boost::shared_ptr<Route>(), s->meter(), s->amp());
 
        _hbox.pack_start (_gpm, true, true);
-       set_name ("SendUIFrame");
+       set_name (X_("SendUIFrame"));
 
        _vbox.set_spacing (5);
        _vbox.set_border_width (5);
@@ -57,18 +60,21 @@ SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session
 
        pack_start (*io, true, true);
 
-       show_all ();
+       io->show ();
+       _gpm.show_all ();
+       _panners.show_all ();
+       _vbox.show ();
+       _hbox.show ();
 
        _send->set_metering (true);
 
-       _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());
+       _send->output()->changed.connect (connections, invalidator (*this), boost::bind (&SendUI::outs_changed, this, _1, _2), gui_context());
 
        _panners.set_width (Wide);
        _panners.setup_pan ();
 
        _gpm.setup_meters ();
-       _gpm.set_fader_name ("SendUIFrame");
+       _gpm.set_fader_name (X_("SendUIFader"));
 
        // screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect (
        //              sigc::mem_fun (*this, &SendUI::update));
@@ -87,19 +93,10 @@ SendUI::~SendUI ()
 }
 
 void
-SendUI::ins_changed (IOChange change, void* ignored)
-{
-       ENSURE_GUI_THREAD (*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 (*this, &SendUI::outs_changed, change, ignored)
-       if (change & ConfigurationChanged) {
+       if (change.type & IOChange::ConfigurationChanged) {
                _panners.setup_pan ();
                _gpm.setup_meters ();
        }
@@ -113,28 +110,30 @@ SendUI::update ()
 void
 SendUI::fast_update ()
 {
+       if (!is_mapped()) {
+               return;
+       }
+
        if (Config->get_meter_falloff() > 0.0f) {
                _gpm.update_meters ();
        }
 }
 
 SendUIWindow::SendUIWindow (boost::shared_ptr<Send> s, Session* session)
-       : ArdourDialog (string("Ardour: send ") + s->name())
+       : ArdourWindow (string (_("Send ")) + s->name())
 {
        ui = new SendUI (this, s, session);
 
        hpacker.pack_start (*ui, true, true);
 
-       get_vbox()->set_border_width (5);
-       get_vbox()->pack_start (hpacker);
+       add (hpacker);
 
        set_name ("SendUIWindow");
 
-       s->DropReferences.connect (going_away_connection, invalidator (*this), boost::bind (&SendUIWindow::send_going_away, this), gui_context());
+       ui->show ();
+       hpacker.show ();
 
-       signal_delete_event().connect (sigc::bind (
-                                              sigc::ptr_fun (just_hide_it),
-                                              reinterpret_cast<Window *> (this)));
+       s->DropReferences.connect (going_away_connection, invalidator (*this), boost::bind (&SendUIWindow::send_going_away, this), gui_context());
 }
 
 SendUIWindow::~SendUIWindow ()