Add option to disable track record disarm when the transport is rolling (mantis ...
[ardour.git] / gtk2_ardour / latency_gui.h
1 #ifndef __gtk2_ardour_latency_gui_h__
2 #define __gtk2_ardour_latency_gui_h__
3
4 #include <vector>
5 #include <string>
6
7 #include <gtkmm/dialog.h>
8 #include <gtkmm/box.h>
9 #include <gtkmm/button.h>
10 #include <gtkmm/adjustment.h>
11
12 #include <gtkmm2ext/barcontroller.h>
13 #include "pbd/controllable.h"
14
15 #include "ardour/types.h"
16
17 #include "ardour_dialog.h"
18
19 namespace ARDOUR {
20         class Latent;
21 }
22
23 class LatencyGUI : public Gtk::VBox
24 {
25   public:
26         LatencyGUI (ARDOUR::Latent&, nframes64_t sample_rate, nframes64_t period_size);
27         ~LatencyGUI() { }
28
29         void finish ();
30         void reset ();
31         void refresh ();
32
33   private:
34         std::string get_label (int&);
35
36         ARDOUR::Latent& _latent;
37         nframes64_t initial_value;
38         nframes64_t sample_rate;
39         nframes64_t period_size;
40         boost::shared_ptr<PBD::IgnorableControllable> ignored;
41
42         Gtk::Adjustment adjustment;
43         Gtkmm2ext::BarController bc;
44         Gtk::HBox hbox1;
45         Gtk::HBox hbox2;
46         Gtk::HButtonBox hbbox;
47         Gtk::Button minus_button;
48         Gtk::Button plus_button;
49         Gtk::Button reset_button;
50         Gtk::ComboBoxText units_combo;
51
52         void change_latency_from_button (int dir);
53
54         static std::vector<std::string> unit_strings;
55 };
56
57 class LatencyDialog : public ArdourDialog
58 {
59   public:
60         LatencyDialog (const Glib::ustring& title, ARDOUR::Latent&, nframes64_t sample_rate, nframes64_t period_size);
61         ~LatencyDialog() {}
62
63   private:
64         LatencyGUI lwidget;
65 };
66
67 #endif /* __gtk2_ardour_latency_gui_h__ */