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/return.h"
26 #include "return_ui.h"
27 #include "io_selector.h"
28 #include "ardour_ui.h"
29 #include "gui_thread.h"
31 using namespace ARDOUR;
34 ReturnUI::ReturnUI (boost::shared_ptr<Return> r, Session& se)
39 _gpm.set_io (r->io());
41 _hbox.pack_start (_gpm, true, true);
42 set_name ("ReturnUIFrame");
44 _vbox.set_spacing (5);
45 _vbox.set_border_width (5);
47 _vbox.pack_start (_hbox, false, false, false);
49 io = manage (new IOSelector (se, r->io(), true));
51 pack_start (_vbox, false, false);
53 pack_start (*io, true, true);
57 //_return->set_metering (true);
59 _return->io()->input_changed.connect (mem_fun (*this, &ReturnUI::ins_changed));
60 //_return->io()->output_changed.connect (mem_fun (*this, &ReturnUI::outs_changed));
63 _gpm.set_fader_name ("ReturnUIFrame");
65 // screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect (mem_fun (*this, &ReturnUI::update));
66 fast_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (mem_fun (*this, &ReturnUI::fast_update));
69 ReturnUI::~ReturnUI ()
71 //_return->set_metering (false);
73 /* XXX not clear that we need to do this */
75 screen_update_connection.disconnect();
76 fast_screen_update_connection.disconnect();
80 ReturnUI::ins_changed (IOChange change, void* ignored)
82 ENSURE_GUI_THREAD(bind (mem_fun (*this, &ReturnUI::ins_changed), change, ignored));
83 if (change & ConfigurationChanged) {
94 ReturnUI::fast_update ()
96 if (Config->get_meter_falloff() > 0.0f) {
97 _gpm.update_meters ();
101 ReturnUIWindow::ReturnUIWindow (boost::shared_ptr<Return> s, Session& ss)
102 : ArdourDialog (string("Ardour: return ") + s->name())
104 ui = new ReturnUI (s, ss);
106 hpacker.pack_start (*ui, true, true);
108 get_vbox()->set_border_width (5);
109 get_vbox()->pack_start (hpacker);
111 set_name ("ReturnUIWindow");
113 going_away_connection = s->GoingAway.connect (
114 mem_fun (*this, &ReturnUIWindow::return_going_away));
116 signal_delete_event().connect (bind (
117 ptr_fun (just_hide_it),
118 reinterpret_cast<Window *> (this)));
121 ReturnUIWindow::~ReturnUIWindow ()
127 ReturnUIWindow::return_going_away ()
129 ENSURE_GUI_THREAD (mem_fun (*this, &ReturnUIWindow::return_going_away));
130 delete_when_idle (this);
131 going_away_connection.disconnect ();