fix a variety of unused argument errors noted by gcc 4.3.2 on x86
[ardour.git] / gtk2_ardour / send_ui.cc
1 /*
2     Copyright (C) 2002 Paul Davis
3
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.
8
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.
13
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.
17
18 */
19
20 #include <gtkmm2ext/doi.h>
21
22 #include "ardour/amp.h"
23 #include "ardour/io.h"
24 #include "ardour/send.h"
25 #include "ardour/rc_configuration.h"
26
27 #include "utils.h"
28 #include "send_ui.h"
29 #include "io_selector.h"
30 #include "ardour_ui.h"
31 #include "gui_thread.h"
32
33 #include "i18n.h"
34
35 using namespace std;
36 using namespace ARDOUR;
37 using namespace PBD;
38
39 SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session)
40         : _send (s)
41         , _gpm (session, 250)
42         , _panners (session)
43 {
44         _panners.set_panner (s->panner());
45         _gpm.set_controls (boost::shared_ptr<Route>(), s->meter(), s->amp());
46
47         _hbox.pack_start (_gpm, true, true);
48         set_name ("SendUIFrame");
49
50         _vbox.set_spacing (5);
51         _vbox.set_border_width (5);
52
53         _vbox.pack_start (_hbox, false, false, false);
54         _vbox.pack_start (_panners, false, false);
55
56         io = manage (new IOSelector (parent, session, s->output()));
57
58         pack_start (_vbox, false, false);
59
60         pack_start (*io, true, true);
61
62         show_all ();
63
64         _send->set_metering (true);
65
66         _send->input()->changed.connect (connections, invalidator (*this), ui_bind (&SendUI::ins_changed, this, _1, _2), gui_context());
67         _send->output()->changed.connect (connections, invalidator (*this), ui_bind (&SendUI::outs_changed, this, _1, _2), gui_context());
68
69         _panners.set_width (Wide);
70         _panners.setup_pan ();
71
72         _gpm.setup_meters ();
73         _gpm.set_fader_name ("SendUIFrame");
74
75         // screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect (
76         //              sigc::mem_fun (*this, &SendUI::update));
77         fast_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (
78                         sigc::mem_fun (*this, &SendUI::fast_update));
79 }
80
81 SendUI::~SendUI ()
82 {
83         _send->set_metering (false);
84
85         /* XXX not clear that we need to do this */
86
87         screen_update_connection.disconnect();
88         fast_screen_update_connection.disconnect();
89 }
90
91 void
92 SendUI::ins_changed (IOChange change, void* /*ignored*/)
93 {
94         ENSURE_GUI_THREAD (*this, &SendUI::ins_changed, change, ignored)
95         if (change.type & IOChange::ConfigurationChanged) {
96                 _panners.setup_pan ();
97         }
98 }
99
100 void
101 SendUI::outs_changed (IOChange change, void* /*ignored*/)
102 {
103         ENSURE_GUI_THREAD (*this, &SendUI::outs_changed, change, ignored)
104         if (change.type & IOChange::ConfigurationChanged) {
105                 _panners.setup_pan ();
106                 _gpm.setup_meters ();
107         }
108 }
109
110 void
111 SendUI::update ()
112 {
113 }
114
115 void
116 SendUI::fast_update ()
117 {
118         if (Config->get_meter_falloff() > 0.0f) {
119                 _gpm.update_meters ();
120         }
121 }
122
123 SendUIWindow::SendUIWindow (boost::shared_ptr<Send> s, Session* session)
124         : ArdourDialog (string (_("Send ")) + s->name())
125 {
126         ui = new SendUI (this, s, session);
127
128         hpacker.pack_start (*ui, true, true);
129
130         get_vbox()->set_border_width (5);
131         get_vbox()->pack_start (hpacker);
132
133         set_name ("SendUIWindow");
134
135         s->DropReferences.connect (going_away_connection, invalidator (*this), boost::bind (&SendUIWindow::send_going_away, this), gui_context());
136
137         signal_delete_event().connect (sigc::bind (
138                                                sigc::ptr_fun (just_hide_it),
139                                                reinterpret_cast<Window *> (this)));
140 }
141
142 SendUIWindow::~SendUIWindow ()
143 {
144         delete ui;
145 }
146
147 void
148 SendUIWindow::send_going_away ()
149 {
150         ENSURE_GUI_THREAD (*this, &SendUIWindow::send_going_away)
151         going_away_connection.disconnect ();
152         delete_when_idle (this);
153 }
154