Ardour  8.12
automation_controller.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2014 David Robillard <d@drobilla.net>
3  * Copyright (C) 2009-2012 Carl Hetherington <carl@carlh.net>
4  * Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2014-2019 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 __ardour_gtk_automation_controller_h__
23 #define __ardour_gtk_automation_controller_h__
24 
25 #ifdef YES
26 #undef YES
27 #endif
28 #ifdef NO
29 #undef NO
30 #endif
31 
32 #include <memory>
33 
34 #include <gtkmm/alignment.h>
35 
36 #include "pbd/signals.h"
38 
39 #include "widgets/barcontroller.h"
40 
41 namespace ARDOUR {
42  class Session;
43  class AutomationList;
44  class AutomationControl;
45 }
46 
47 namespace Gtk {
48  class Adjustment;
49  class Widget;
50 }
51 
53 public:
54  AutomationBarController(std::shared_ptr<ARDOUR::AutomationControl> ac,
55  Gtk::Adjustment* adj);
57 private:
58  std::string get_label (double&);
59  std::shared_ptr<ARDOUR::AutomationControl> _controllable;
60 };
61 
64 public:
65  static std::shared_ptr<AutomationController> create (
66  const Evoral::Parameter& param,
67  const ARDOUR::ParameterDescriptor& desc,
68  std::shared_ptr<ARDOUR::AutomationControl> ac,
69  bool use_knob = false);
70 
72 
73  std::shared_ptr<ARDOUR::AutomationControl> controllable() { return _controllable; }
74 
76 
78  Gtk::Widget* widget() { return _widget; }
79 
83 
84  void stop_updating ();
85 
86 private:
87  AutomationController (std::shared_ptr<ARDOUR::AutomationControl> ac,
88  Gtk::Adjustment* adj,
89  bool use_knob);
90 
91  void start_touch(int);
92  void end_touch(int);
95 
97  void set_ratio(double ratio);
98  void set_freq_beats(double beats);
100 
102  std::shared_ptr<ARDOUR::AutomationControl> _controllable;
104  sigc::connection _screen_update_connection;
107  bool _grabbed;
108 };
109 
110 
111 #endif /* __ardour_gtk_automation_controller_h__ */
std::string get_label(double &)
AutomationBarController(std::shared_ptr< ARDOUR::AutomationControl > ac, Gtk::Adjustment *adj)
std::shared_ptr< ARDOUR::AutomationControl > _controllable
sigc::connection _screen_update_connection
AutomationController(std::shared_ptr< ARDOUR::AutomationControl > ac, Gtk::Adjustment *adj, bool use_knob)
bool button_press(GdkEventButton *)
Gtk::Adjustment * _adjustment
bool on_button_release(GdkEventButton *ev)
std::shared_ptr< ARDOUR::AutomationControl > controllable()
Gtk::Adjustment * adjustment()
void set_ratio(double ratio)
void display_effective_value()
void disable_vertical_scroll()
static std::shared_ptr< AutomationController > create(const Evoral::Parameter &param, const ARDOUR::ParameterDescriptor &desc, std::shared_ptr< ARDOUR::AutomationControl > ac, bool use_knob=false)
std::shared_ptr< ARDOUR::AutomationControl > _controllable
void set_freq_beats(double beats)
void automation_state_changed()
PBD::ScopedConnectionList _changed_connections
bool button_release(GdkEventButton *)
Definition: ardour_ui.h:188