ardour
latency_gui.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2012 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 #ifndef __gtk2_ardour_latency_gui_h__
21 #define __gtk2_ardour_latency_gui_h__
22 
23 #include <vector>
24 #include <string>
25 
26 #include <gtkmm/dialog.h>
27 #include <gtkmm/box.h>
28 #include <gtkmm/button.h>
29 #include <gtkmm/adjustment.h>
30 
32 #include "pbd/controllable.h"
33 
34 #include "ardour/types.h"
35 
36 #include "ardour_dialog.h"
37 
38 namespace ARDOUR {
39  class Latent;
40 }
41 
42 class LatencyGUI;
43 
45 {
46 public:
47  LatencyBarController (Gtk::Adjustment& adj, LatencyGUI* g)
48  : BarController (adj, boost::shared_ptr<PBD::IgnorableControllable> (new PBD::IgnorableControllable ())),
49  _latency_gui (g) {}
50 
51 private:
53 
54  std::string get_label (double&);
55 };
56 
57 class LatencyGUI : public Gtk::VBox
58 {
59  public:
62 
63  void finish ();
64  void reset ();
65  void refresh ();
66 
67  private:
73 
74  Gtk::Adjustment adjustment;
76  Gtk::HBox hbox1;
77  Gtk::HBox hbox2;
78  Gtk::HButtonBox hbbox;
79  Gtk::Button minus_button;
80  Gtk::Button plus_button;
81  Gtk::Button reset_button;
82  Gtk::ComboBoxText units_combo;
83 
84  void change_latency_from_button (int dir);
85 
86  friend class LatencyBarController;
87 
88  static std::vector<std::string> unit_strings;
89 };
90 
92 {
93  public:
94  LatencyDialog (const std::string& title, ARDOUR::Latent&, framepos_t sample_rate, framepos_t period_size);
96 
97  private:
99 };
100 
101 #endif /* __gtk2_ardour_latency_gui_h__ */
Gtk::HButtonBox hbbox
Definition: latency_gui.h:78
Gtk::Button plus_button
Definition: latency_gui.h:80
LatencyGUI(ARDOUR::Latent &, framepos_t sample_rate, framepos_t period_size)
Definition: latency_gui.cc:63
BarController(Gtk::Adjustment &adj, boost::shared_ptr< PBD::Controllable >)
LatencyGUI lwidget
Definition: latency_gui.h:98
LatencyBarController(Gtk::Adjustment &adj, LatencyGUI *g)
Definition: latency_gui.h:47
Gtk::HBox hbox1
Definition: latency_gui.h:76
std::string get_label(double &)
Definition: latency_gui.cc:48
framepos_t period_size
Definition: latency_gui.h:71
Definition: amp.h:29
Gtk::Button reset_button
Definition: latency_gui.h:81
Gtk::ComboBoxText units_combo
Definition: latency_gui.h:82
framepos_t sample_rate
Definition: latency_gui.h:70
ARDOUR::Latent & _latent
Definition: latency_gui.h:68
void finish()
Definition: latency_gui.cc:114
Gtk::Button minus_button
Definition: latency_gui.h:79
LatencyBarController bc
Definition: latency_gui.h:75
void change_latency_from_button(int dir)
Definition: latency_gui.cc:137
Definition: debug.h:30
static std::vector< std::string > unit_strings
Definition: latency_gui.h:88
Gtk::Adjustment adjustment
Definition: latency_gui.h:74
void refresh()
Definition: latency_gui.cc:130
Gtk::HBox hbox2
Definition: latency_gui.h:77
void reset()
Definition: latency_gui.cc:123
int64_t framepos_t
framepos_t initial_value
Definition: latency_gui.h:69
LatencyDialog(const std::string &title, ARDOUR::Latent &, framepos_t sample_rate, framepos_t period_size)
Definition: latency_gui.cc:161
boost::shared_ptr< PBD::IgnorableControllable > ignored
Definition: latency_gui.h:72
LatencyGUI * _latency_gui
Definition: latency_gui.h:52