2 Copyright (C) 2007 Paul Davis
3 Author: David Robillard
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __ardour_gtk_automation_controller_h__
22 #define __ardour_gtk_automation_controller_h__
31 #include <boost/shared_ptr.hpp>
33 #include <gtkmm/alignment.h>
35 #include "pbd/signals.h"
36 #include "evoral/Parameter.hpp"
37 #include "widgets/barcontroller.h"
42 class AutomationControl;
50 class AutomationBarController : public ArdourWidgets::BarController {
52 AutomationBarController(boost::shared_ptr<ARDOUR::AutomationControl> ac,
53 Gtk::Adjustment* adj);
54 ~AutomationBarController();
56 std::string get_label (double&);
57 boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
60 /** A BarController which displays the value and allows control of an AutomationControl */
61 class AutomationController : public Gtk::Alignment {
63 static boost::shared_ptr<AutomationController> create (
64 const Evoral::Parameter& param,
65 const ARDOUR::ParameterDescriptor& desc,
66 boost::shared_ptr<ARDOUR::AutomationControl> ac,
67 bool use_knob = false);
69 ~AutomationController();
71 boost::shared_ptr<ARDOUR::AutomationControl> controllable() { return _controllable; }
73 void disable_vertical_scroll();
75 Gtk::Adjustment* adjustment() { return _adjustment; }
76 Gtk::Widget* widget() { return _widget; }
78 void display_effective_value ();
79 void automation_state_changed ();
80 void value_adjusted();
82 void stop_updating ();
85 AutomationController (boost::shared_ptr<ARDOUR::AutomationControl> ac,
91 bool button_press(GdkEventButton*);
92 bool button_release(GdkEventButton*);
94 void run_note_select_dialog();
95 void set_ratio(double ratio);
96 void set_freq_beats(double beats);
97 bool on_button_release(GdkEventButton* ev);
100 boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
101 Gtk::Adjustment* _adjustment;
102 sigc::connection _screen_update_connection;
103 PBD::ScopedConnectionList _changed_connections;
108 #endif /* __ardour_gtk_automation_controller_h__ */