2 Copyright (C) 2012 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 #ifndef __gtk2_ardour_latency_gui_h__
21 #define __gtk2_ardour_latency_gui_h__
26 #include <gtkmm/dialog.h>
27 #include <gtkmm/box.h>
28 #include <gtkmm/button.h>
29 #include <gtkmm/adjustment.h>
31 #include <gtkmm2ext/barcontroller.h>
32 #include "pbd/controllable.h"
34 #include "ardour/types.h"
36 #include "ardour_dialog.h"
44 class LatencyBarController : public Gtkmm2ext::BarController
47 LatencyBarController (Gtk::Adjustment& adj, LatencyGUI* g)
48 : BarController (adj, boost::shared_ptr<PBD::IgnorableControllable> (new PBD::IgnorableControllable ())),
52 LatencyGUI* _latency_gui;
54 std::string get_label (double&);
57 class LatencyGUI : public Gtk::VBox
60 LatencyGUI (ARDOUR::Latent&, framepos_t sample_rate, framepos_t period_size);
68 ARDOUR::Latent& _latent;
69 framepos_t initial_value;
70 framepos_t sample_rate;
71 framepos_t period_size;
72 boost::shared_ptr<PBD::IgnorableControllable> ignored;
74 Gtk::Adjustment adjustment;
75 LatencyBarController bc;
78 Gtk::HButtonBox hbbox;
79 Gtk::Button minus_button;
80 Gtk::Button plus_button;
81 Gtk::Button reset_button;
82 Gtk::ComboBoxText units_combo;
84 void change_latency_from_button (int dir);
86 friend class LatencyBarController;
88 static std::vector<std::string> unit_strings;
91 class LatencyDialog : public ArdourDialog
94 LatencyDialog (const std::string& title, ARDOUR::Latent&, framepos_t sample_rate, framepos_t period_size);
101 #endif /* __gtk2_ardour_latency_gui_h__ */