ardour
return_ui.cc
Go to the documentation of this file.
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/io.h"
24 #include "ardour/return.h"
25 
26 #include "return_ui.h"
27 #include "io_selector.h"
28 #include "gui_thread.h"
29 #include "timers.h"
30 
31 #include "i18n.h"
32 
33 using namespace std;
34 using namespace ARDOUR;
35 using namespace PBD;
36 
37 ReturnUI::ReturnUI (Gtk::Window* parent, boost::shared_ptr<Return> r, Session* session)
38  :_return (r)
39  , _gpm (session, 250)
40 {
42 
43  _hbox.pack_start (_gpm, true, true);
44  set_name (X_("ReturnUIFrame"));
45 
46  _vbox.set_spacing (5);
47  _vbox.set_border_width (5);
48 
49  _vbox.pack_start (_hbox, false, false, false);
50 
51  io = Gtk::manage (new IOSelector (parent, session, r->output()));
52 
53  pack_start (_vbox, false, false);
54 
55  pack_start (*io, true, true);
56 
57  show_all ();
58 
59  _return->set_metering (true);
60  _return->input()->changed.connect (input_change_connection, invalidator (*this), boost::bind (&ReturnUI::ins_changed, this, _1, _2), gui_context());
61 
62  _gpm.setup_meters ();
63  _gpm.set_fader_name (X_("ReturnUIFader"));
64 
65  // screen_update_connection = Timers::rapid_connect (sigc::mem_fun (*this, &ReturnUI::update));
67 }
68 
70 {
71  _return->set_metering (false);
72 
73  /* XXX not clear that we need to do this */
74 
75  screen_update_connection.disconnect();
76  fast_screen_update_connection.disconnect();
77 }
78 
79 void
80 ReturnUI::ins_changed (IOChange change, void* /*ignored*/)
81 {
82  ENSURE_GUI_THREAD (*this, &ReturnUI::ins_changed, change, ignored)
83  if (change.type & IOChange::ConfigurationChanged) {
84  _gpm.setup_meters ();
85  }
86 }
87 
88 void
90 {
91 }
92 
93 void
95 {
96  if (Config->get_meter_falloff() > 0.0f) {
98  }
99 }
100 
102  : ArdourWindow (string(_("Return ")) + r->name())
103 {
104  ui = new ReturnUI (this, r, s);
105 
106  hpacker.pack_start (*ui, true, true);
107 
108  add (hpacker);
109 
110  set_name ("ReturnUIWindow");
111 
112 }
113 
115 {
116  delete ui;
117 }
void update()
Definition: return_ui.cc:89
ReturnUI * ui
Definition: return_ui.h:66
ReturnUI(Gtk::Window *, boost::shared_ptr< ARDOUR::Return >, ARDOUR::Session *)
Definition: return_ui.cc:37
sigc::connection super_rapid_connect(const sigc::slot< void > &slot)
Definition: timers.cc:189
ReturnUIWindow(boost::shared_ptr< ARDOUR::Return >, ARDOUR::Session *)
Definition: return_ui.cc:101
boost::shared_ptr< ARDOUR::Return > _return
Definition: return_ui.h:48
void set_fader_name(const char *name)
Definition: gain_meter.cc:583
~ReturnUI()
Definition: return_ui.cc:69
Definition: Beats.hpp:239
#define ENSURE_GUI_THREAD(obj, method,...)
Definition: gui_thread.h:34
#define invalidator(x)
Definition: gui_thread.h:40
#define _(Text)
Definition: i18n.h:11
#define X_(Text)
Definition: i18n.h:13
LIBARDOUR_API RCConfiguration * Config
Definition: globals.cc:119
enum ARDOUR::IOChange::Type type
Definition: amp.h:29
GainMeter _gpm
Definition: return_ui.h:49
virtual void set_controls(boost::shared_ptr< ARDOUR::Route > route, boost::shared_ptr< ARDOUR::PeakMeter > meter, boost::shared_ptr< ARDOUR::Amp > amp)
Definition: gain_meter.cc:1009
void fast_update()
Definition: return_ui.cc:94
#define gui_context()
Definition: gui_thread.h:36
IOSelector * io
Definition: return_ui.h:43
boost::shared_ptr< IO > input()
Definition: io_processor.h:60
sigc::connection fast_screen_update_connection
Definition: return_ui.h:54
Gtk::VBox _hbox
Definition: return_ui.h:51
const char * name
Gtk::VBox _vbox
Definition: return_ui.h:50
void setup_meters(int len=0)
Definition: gain_meter.cc:340
boost::shared_ptr< PeakMeter > meter() const
Definition: return.h:48
boost::shared_ptr< IO > output()
Definition: io_processor.h:62
void update_meters()
Definition: gain_meter.cc:890
Definition: debug.h:30
Gtk::HBox hpacker
Definition: return_ui.h:69
void ins_changed(ARDOUR::IOChange, void *)
Definition: return_ui.cc:80
PBD::ScopedConnection input_change_connection
Definition: return_ui.h:55
boost::shared_ptr< Amp > amp() const
Definition: return.h:47
void set_metering(bool yn)
Definition: return.h:51
sigc::connection screen_update_connection
Definition: return_ui.h:53