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>
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 __ardour_gtk_automation_controller_h__
23 #define __ardour_gtk_automation_controller_h__
32 #include <boost/shared_ptr.hpp>
34 #include <gtkmm/alignment.h>
36 #include "pbd/signals.h"
37 #include "ardour/parameter_descriptor.h"
39 #include "widgets/barcontroller.h"
44 class AutomationControl;
52 class AutomationBarController : public ArdourWidgets::BarController {
54 AutomationBarController(boost::shared_ptr<ARDOUR::AutomationControl> ac,
55 Gtk::Adjustment* adj);
56 ~AutomationBarController();
58 std::string get_label (double&);
59 boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
62 /** A BarController which displays the value and allows control of an AutomationControl */
63 class AutomationController : public Gtk::Alignment {
65 static boost::shared_ptr<AutomationController> create (
66 const Evoral::Parameter& param,
67 const ARDOUR::ParameterDescriptor& desc,
68 boost::shared_ptr<ARDOUR::AutomationControl> ac,
69 bool use_knob = false);
71 ~AutomationController();
73 boost::shared_ptr<ARDOUR::AutomationControl> controllable() { return _controllable; }
75 void disable_vertical_scroll();
77 Gtk::Adjustment* adjustment() { return _adjustment; }
78 Gtk::Widget* widget() { return _widget; }
80 void display_effective_value ();
81 void automation_state_changed ();
82 void value_adjusted();
84 void stop_updating ();
87 AutomationController (boost::shared_ptr<ARDOUR::AutomationControl> ac,
93 bool button_press(GdkEventButton*);
94 bool button_release(GdkEventButton*);
96 void run_note_select_dialog();
97 void set_ratio(double ratio);
98 void set_freq_beats(double beats);
99 bool on_button_release(GdkEventButton* ev);
101 Gtk::Widget* _widget;
102 boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
103 Gtk::Adjustment* _adjustment;
104 sigc::connection _screen_update_connection;
105 PBD::ScopedConnectionList _changed_connections;
111 #endif /* __ardour_gtk_automation_controller_h__ */