2 * Copyright (C) 2007-2017 Paul Davis <paul@linuxaudiosystems.com>
3 * Copyright (C) 2009 Carl Hetherington <carl@carlh.net>
4 * Copyright (C) 2009 David Robillard <d@drobilla.net>
5 * Copyright (C) 2017-2019 Robin Gareus <robin@gareus.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef __gtk2_ardour_latency_gui_h__
23 #define __gtk2_ardour_latency_gui_h__
28 #include <gtkmm/adjustment.h>
29 #include <gtkmm/box.h>
30 #include <gtkmm/button.h>
31 #include <gtkmm/comboboxtext.h>
33 #include "pbd/controllable.h"
34 #include "ardour/types.h"
35 #include "widgets/barcontroller.h"
37 #include "ardour_dialog.h"
45 class LatencyBarController : public ArdourWidgets::BarController
48 LatencyBarController (Gtk::Adjustment& adj, LatencyGUI* g)
49 : BarController (adj, boost::shared_ptr<PBD::IgnorableControllable> (new PBD::IgnorableControllable ())),
54 LatencyGUI* _latency_gui;
56 std::string get_label (double&);
59 class LatencyGUI : public Gtk::VBox
62 LatencyGUI (ARDOUR::Latent&, samplepos_t sample_rate, samplepos_t period_size);
71 ARDOUR::Latent& _latent;
72 samplepos_t sample_rate;
73 samplepos_t period_size;
75 boost::shared_ptr<PBD::IgnorableControllable> ignored;
78 Gtk::Adjustment adjustment;
79 LatencyBarController bc;
82 Gtk::HButtonBox hbbox;
83 Gtk::Button minus_button;
84 Gtk::Button plus_button;
85 Gtk::Button reset_button;
86 Gtk::ComboBoxText units_combo;
88 void change_latency_from_button (int dir);
90 friend class LatencyBarController;
92 static std::vector<std::string> unit_strings;
95 #endif /* __gtk2_ardour_latency_gui_h__ */