2005-09-25 18:42:24 +00:00
|
|
|
/*
|
2009-10-14 16:10:01 +00:00
|
|
|
Copyright (C) 2002 Paul Davis
|
2005-09-25 18:42:24 +00:00
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
2005-09-25 20:33:00 +00:00
|
|
|
#include <gtkmm2ext/doi.h>
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2009-02-25 18:26:51 +00:00
|
|
|
#include "ardour/io.h"
|
|
|
|
|
#include "ardour/send.h"
|
2009-10-30 15:30:22 +00:00
|
|
|
#include "ardour/rc_configuration.h"
|
2009-01-30 20:18:31 +00:00
|
|
|
|
2005-09-25 18:42:24 +00:00
|
|
|
#include "utils.h"
|
|
|
|
|
#include "send_ui.h"
|
|
|
|
|
#include "io_selector.h"
|
|
|
|
|
#include "ardour_ui.h"
|
|
|
|
|
#include "gui_thread.h"
|
|
|
|
|
|
2010-05-08 01:20:33 +00:00
|
|
|
#include "i18n.h"
|
|
|
|
|
|
2009-05-12 17:03:42 +00:00
|
|
|
using namespace std;
|
2005-09-25 18:42:24 +00:00
|
|
|
using namespace ARDOUR;
|
2006-06-21 23:01:03 +00:00
|
|
|
using namespace PBD;
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2009-12-17 18:24:23 +00:00
|
|
|
SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session)
|
2008-12-08 16:07:28 +00:00
|
|
|
: _send (s)
|
2009-12-17 18:24:23 +00:00
|
|
|
, _gpm (session, 250)
|
|
|
|
|
, _panners (session)
|
2005-09-25 18:42:24 +00:00
|
|
|
{
|
2011-01-10 19:36:00 +00:00
|
|
|
assert (_send);
|
|
|
|
|
|
2011-02-22 18:44:22 +00:00
|
|
|
_panners.set_panner (s->panner_shell(), s->panner());
|
2009-07-21 14:39:21 +00:00
|
|
|
_gpm.set_controls (boost::shared_ptr<Route>(), s->meter(), s->amp());
|
2008-12-08 16:07:28 +00:00
|
|
|
|
2009-05-07 17:31:18 +00:00
|
|
|
_hbox.pack_start (_gpm, true, true);
|
2014-01-05 13:07:31 +01:00
|
|
|
set_name (X_("SendUIFrame"));
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2009-05-07 17:31:18 +00:00
|
|
|
_vbox.set_spacing (5);
|
|
|
|
|
_vbox.set_border_width (5);
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2009-05-07 17:31:18 +00:00
|
|
|
_vbox.pack_start (_hbox, false, false, false);
|
2014-01-13 10:50:49 +01:00
|
|
|
_vbox.pack_start (_panners, false, false);
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2009-12-17 18:24:23 +00:00
|
|
|
io = manage (new IOSelector (parent, session, s->output()));
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2009-05-07 17:31:18 +00:00
|
|
|
pack_start (_vbox, false, false);
|
2005-09-25 18:42:24 +00:00
|
|
|
|
|
|
|
|
pack_start (*io, true, true);
|
|
|
|
|
|
2011-01-11 02:47:53 +00:00
|
|
|
io->show ();
|
|
|
|
|
_gpm.show_all ();
|
|
|
|
|
_panners.show_all ();
|
|
|
|
|
_vbox.show ();
|
|
|
|
|
_hbox.show ();
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2006-07-27 16:52:14 +00:00
|
|
|
_send->set_metering (true);
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2012-04-25 12:58:19 +00:00
|
|
|
_send->output()->changed.connect (connections, invalidator (*this), boost::bind (&SendUI::outs_changed, this, _1, _2), gui_context());
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2009-05-07 17:31:18 +00:00
|
|
|
_panners.set_width (Wide);
|
|
|
|
|
_panners.setup_pan ();
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2009-05-07 17:31:18 +00:00
|
|
|
_gpm.setup_meters ();
|
2014-01-05 13:07:31 +01:00
|
|
|
_gpm.set_fader_name (X_("SendUIFader"));
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2009-05-07 17:31:18 +00:00
|
|
|
// screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect (
|
2009-12-11 23:29:48 +00:00
|
|
|
// sigc::mem_fun (*this, &SendUI::update));
|
2009-05-07 17:31:18 +00:00
|
|
|
fast_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (
|
2009-12-11 23:29:48 +00:00
|
|
|
sigc::mem_fun (*this, &SendUI::fast_update));
|
2005-09-25 18:42:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SendUI::~SendUI ()
|
|
|
|
|
{
|
2006-07-27 16:52:14 +00:00
|
|
|
_send->set_metering (false);
|
2008-09-10 15:03:30 +00:00
|
|
|
|
2005-09-25 18:42:24 +00:00
|
|
|
/* XXX not clear that we need to do this */
|
|
|
|
|
|
|
|
|
|
screen_update_connection.disconnect();
|
|
|
|
|
fast_screen_update_connection.disconnect();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2010-09-02 17:01:36 +00:00
|
|
|
SendUI::outs_changed (IOChange change, void* /*ignored*/)
|
2005-09-25 18:42:24 +00:00
|
|
|
{
|
2009-12-11 23:29:48 +00:00
|
|
|
ENSURE_GUI_THREAD (*this, &SendUI::outs_changed, change, ignored)
|
2010-08-30 22:34:21 +00:00
|
|
|
if (change.type & IOChange::ConfigurationChanged) {
|
2009-05-07 17:31:18 +00:00
|
|
|
_panners.setup_pan ();
|
|
|
|
|
_gpm.setup_meters ();
|
2005-09-25 18:42:24 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
SendUI::update ()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
SendUI::fast_update ()
|
|
|
|
|
{
|
2013-08-23 21:26:02 +02:00
|
|
|
if (!is_mapped()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2006-09-25 21:24:00 +00:00
|
|
|
if (Config->get_meter_falloff() > 0.0f) {
|
2009-05-07 17:31:18 +00:00
|
|
|
_gpm.update_meters ();
|
2005-09-25 18:42:24 +00:00
|
|
|
}
|
|
|
|
|
}
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2009-12-17 18:24:23 +00:00
|
|
|
SendUIWindow::SendUIWindow (boost::shared_ptr<Send> s, Session* session)
|
2011-11-19 00:56:35 +00:00
|
|
|
: ArdourWindow (string (_("Send ")) + s->name())
|
2005-09-25 18:42:24 +00:00
|
|
|
{
|
2009-12-17 18:24:23 +00:00
|
|
|
ui = new SendUI (this, s, session);
|
2005-09-25 18:42:24 +00:00
|
|
|
|
|
|
|
|
hpacker.pack_start (*ui, true, true);
|
|
|
|
|
|
2011-11-19 00:56:35 +00:00
|
|
|
add (hpacker);
|
2005-09-25 18:42:24 +00:00
|
|
|
|
|
|
|
|
set_name ("SendUIWindow");
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2011-01-11 02:47:53 +00:00
|
|
|
ui->show ();
|
|
|
|
|
hpacker.show ();
|
|
|
|
|
|
2005-09-25 18:42:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SendUIWindow::~SendUIWindow ()
|
|
|
|
|
{
|
|
|
|
|
delete ui;
|
|
|
|
|
}
|