Ardour  9.0-pre0-582-g084a23a80d
timectl_gui.h
Go to the documentation of this file.
1 /*
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-2024 Robin Gareus <robin@gareus.org>
6  *
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.
11  *
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.
16  *
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.
20  */
21 
22 #ifndef __gtk2_ardour_timectl_gui_h__
23 #define __gtk2_ardour_timectl_gui_h__
24 
25 #include <vector>
26 #include <string>
27 
28 #include <gtkmm/adjustment.h>
29 #include <gtkmm/box.h>
30 #include <gtkmm/button.h>
31 #include <gtkmm/comboboxtext.h>
32 
33 #include "pbd/controllable.h"
34 #include "ardour/types.h"
35 #include "widgets/barcontroller.h"
36 
37 #include "ardour_dialog.h"
38 
39 namespace ARDOUR {
40  class Latent;
41  class TailTime;
42 }
43 
44 class TimeCtlGUI;
45 
47 {
48 public:
50  : PBD::Controllable ("ignoreMe")
51  , _timectl_gui (g)
52  {}
53 
54  void set_value (double v, PBD::Controllable::GroupControlDisposition group_override);
55  double get_value () const;
56  double lower() const;
57  double upper() const;
58  double internal_to_interface (double i, bool rotary = false) const {
59  return i;
60  }
61  double interface_to_internal (double i, bool rotary = false) const {
62  return i;
63  }
64 
65 private:
67 };
68 
70 {
71 public:
73  : BarController (adj, std::shared_ptr<PBD::Controllable> (new TimeCtlGUIControllable (g)))
74  , _timectl_gui (g)
75  {
76  set_digits (0);
77  }
78 
79 private:
81 
82  std::string get_label (double&);
83 };
84 
85 class TimeCtlGUI : public Gtk::VBox
86 {
87 public:
91 
92  void refresh ();
93 
94 private:
95  void init ();
96  void reset ();
97  void finish ();
98 
101 
104 
115 
116  void change_from_button (int dir);
117 
118  friend class TimeCtlBarController;
120 
121  static std::vector<std::string> unit_strings;
122 };
123 
124 #endif /* __gtk2_ardour_timectl_gui_h__ */
BarController(Gtk::Adjustment &adj, std::shared_ptr< PBD::Controllable >)
Controllable(const std::string &name, Flag f=Flag(0))
std::string get_label(double &)
TimeCtlGUI * _timectl_gui
Definition: timectl_gui.h:80
TimeCtlBarController(Gtk::Adjustment &adj, TimeCtlGUI *g)
Definition: timectl_gui.h:72
double upper() const
double lower() const
double interface_to_internal(double i, bool rotary=false) const
Definition: timectl_gui.h:61
double internal_to_interface(double i, bool rotary=false) const
Definition: timectl_gui.h:58
TimeCtlGUIControllable(TimeCtlGUI *g)
Definition: timectl_gui.h:49
void set_value(double v, PBD::Controllable::GroupControlDisposition group_override)
TimeCtlGUI * _timectl_gui
Definition: timectl_gui.h:66
double get_value() const
Gtk::Button plus_button
Definition: timectl_gui.h:112
samplepos_t sample_rate
Definition: timectl_gui.h:102
void finish()
Gtk::ComboBoxText units_combo
Definition: timectl_gui.h:114
TimeCtlGUI(ARDOUR::Latent &, samplepos_t sample_rate, samplepos_t period_size)
Gtk::HBox hbox2
Definition: timectl_gui.h:109
ARDOUR::TailTime * _tailtime
Definition: timectl_gui.h:100
ARDOUR::Latent * _latent
Definition: timectl_gui.h:99
TimeCtlGUI(ARDOUR::TailTime &, samplepos_t sample_rate, samplepos_t period_size)
void refresh()
Gtk::Button reset_button
Definition: timectl_gui.h:113
bool _ignore_change
Definition: timectl_gui.h:105
TimeCtlBarController bc
Definition: timectl_gui.h:107
Gtk::HButtonBox hbbox
Definition: timectl_gui.h:110
static std::vector< std::string > unit_strings
Definition: timectl_gui.h:121
Gtk::HBox hbox1
Definition: timectl_gui.h:108
Gtk::Button minus_button
Definition: timectl_gui.h:111
void change_from_button(int dir)
void reset()
samplepos_t period_size
Definition: timectl_gui.h:103
void init()
Gtk::Adjustment adjustment
Definition: timectl_gui.h:106
Temporal::samplepos_t samplepos_t
std::shared_ptr< PBD::Controllable > Controllable
Definition: console1.h:80
Definition: axis_view.h:42