2 Copyright (C) 2002 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <gtkmm2ext/doi.h>
22 #include "ardour/io.h"
23 #include "ardour/send.h"
24 #include "ardour/rc_configuration.h"
28 #include "io_selector.h"
29 #include "ardour_ui.h"
30 #include "gui_thread.h"
35 using namespace ARDOUR;
38 SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session)
45 _panners.set_panner (s->panner_shell(), s->panner());
46 _gpm.set_controls (boost::shared_ptr<Route>(), s->meter(), s->amp());
48 _hbox.pack_start (_gpm, true, true);
49 set_name ("SendUIFrame");
51 _vbox.set_spacing (5);
52 _vbox.set_border_width (5);
54 _vbox.pack_start (_hbox, false, false, false);
55 // until sends have their own Pannable, don't show this
56 // because it controls the Route Pannable which confuses
57 // users (among others)
58 // _vbox.pack_start (_panners, false, false);
60 io = manage (new IOSelector (parent, session, s->output()));
62 pack_start (_vbox, false, false);
64 pack_start (*io, true, true);
72 _send->set_metering (true);
74 _send->output()->changed.connect (connections, invalidator (*this), boost::bind (&SendUI::outs_changed, this, _1, _2), gui_context());
76 _panners.set_width (Wide);
77 _panners.setup_pan ();
80 _gpm.set_fader_name ("SendUIFrame");
82 // screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect (
83 // sigc::mem_fun (*this, &SendUI::update));
84 fast_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (
85 sigc::mem_fun (*this, &SendUI::fast_update));
90 _send->set_metering (false);
92 /* XXX not clear that we need to do this */
94 screen_update_connection.disconnect();
95 fast_screen_update_connection.disconnect();
99 SendUI::outs_changed (IOChange change, void* /*ignored*/)
101 ENSURE_GUI_THREAD (*this, &SendUI::outs_changed, change, ignored)
102 if (change.type & IOChange::ConfigurationChanged) {
103 _panners.setup_pan ();
104 _gpm.setup_meters ();
114 SendUI::fast_update ()
116 if (Config->get_meter_falloff() > 0.0f) {
117 _gpm.update_meters ();
121 SendUIWindow::SendUIWindow (boost::shared_ptr<Send> s, Session* session)
122 : ArdourWindow (string (_("Send ")) + s->name())
124 ui = new SendUI (this, s, session);
126 hpacker.pack_start (*ui, true, true);
130 set_name ("SendUIWindow");
135 s->DropReferences.connect (going_away_connection, invalidator (*this), boost::bind (&SendUIWindow::send_going_away, this), gui_context());
137 signal_delete_event().connect (sigc::bind (
138 sigc::ptr_fun (just_hide_it),
139 reinterpret_cast<Window *> (this)));
142 SendUIWindow::~SendUIWindow ()
148 SendUIWindow::send_going_away ()
150 ENSURE_GUI_THREAD (*this, &SendUIWindow::send_going_away)
151 going_away_connection.disconnect ();
152 delete_when_idle (this);