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/panner_manager.h"
24 #include "ardour/send.h"
25 #include "ardour/rc_configuration.h"
28 #include "io_selector.h"
30 #include "gui_thread.h"
35 using namespace ARDOUR;
38 SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session)
45 _vbox.pack_start (_hbox, false, false, false);
46 _vbox.pack_start (_panners, false, false);
48 io = Gtk::manage (new IOSelector (parent, session, s->output()));
50 pack_start (_vbox, false, false);
52 pack_start (*io, true, true);
60 _send->set_metering (true);
62 _send->output()->changed.connect (connections, invalidator (*this), boost::bind (&SendUI::outs_changed, this, _1, _2), gui_context());
64 uint32_t const in = _send->pans_required();
65 uint32_t const out = _send->pan_outs();
67 _panners.set_width (Wide);
68 _panners.set_available_panners(PannerManager::instance().PannerManager::get_available_panners(in, out));
69 _panners.setup_pan ();
72 _gpm.set_fader_name (X_("SendUIFader"));
74 // screen_update_connection = Timers::rapid_connect (
75 // sigc::mem_fun (*this, &SendUI::update));
76 fast_screen_update_connection = Timers::super_rapid_connect (
77 sigc::mem_fun (*this, &SendUI::fast_update));
82 _send->set_metering (false);
84 /* XXX not clear that we need to do this */
86 screen_update_connection.disconnect();
87 fast_screen_update_connection.disconnect();
91 SendUI::outs_changed (IOChange change, void* /*ignored*/)
93 ENSURE_GUI_THREAD (*this, &SendUI::outs_changed, change, ignored)
94 if (change.type & IOChange::ConfigurationChanged) {
95 uint32_t const in = _send->pans_required();
96 uint32_t const out = _send->pan_outs();
97 if (_panners._panner == 0) {
98 _panners.set_panner (_send->panner_shell(), _send->panner());
100 _panners.set_available_panners(PannerManager::instance().PannerManager::get_available_panners(in, out));
101 _panners.setup_pan ();
102 _panners.show_all ();
103 _gpm.setup_meters ();
113 SendUI::fast_update ()
119 if (Config->get_meter_falloff() > 0.0f) {
120 _gpm.update_meters ();
124 SendUIWindow::SendUIWindow (boost::shared_ptr<Send> s, Session* session)
125 : ArdourWindow (string (_("Send ")) + s->name())
127 ui = new SendUI (this, s, session);
129 hpacker.pack_start (*ui, true, true);
133 set_name ("SendUIWindow");
140 SendUIWindow::~SendUIWindow ()