ardour
automation_controller.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2007 Paul Davis
3  Author: David Robillard
4 
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.
9 
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.
14 
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.
18 
19 */
20 
21 #ifndef __ardour_gtk_automation_controller_h__
22 #define __ardour_gtk_automation_controller_h__
23 
24 #ifdef YES
25 #undef YES
26 #endif
27 #ifdef NO
28 #undef NO
29 #endif
30 
31 #include <boost/shared_ptr.hpp>
32 #include <gtkmm.h>
33 
35 #include "pbd/signals.h"
36 #include "evoral/Parameter.hpp"
37 
38 namespace ARDOUR {
39  class Session;
40  class AutomationList;
41  class AutomationControl;
42  class Automatable;
43 }
44 
46 public:
49  Gtk::Adjustment* adj);
51 private:
52  std::string get_label (double&);
55 };
56 
58 class AutomationController : public Gtk::Alignment {
59 public:
62  const Evoral::Parameter& param,
63  const ARDOUR::ParameterDescriptor& desc,
65 
67 
69 
71 
72  Gtk::Adjustment* adjustment() { return _adjustment; }
73  Gtk::Widget* widget() { return _widget; }
74 
76  void value_adjusted();
77 
78  void stop_updating ();
79 
80  sigc::signal<void> StartGesture;
81  sigc::signal<void> StopGesture;
82 
83 private:
86  Gtk::Adjustment* adj);
87 
88  void start_touch();
89  void end_touch();
90  void toggled();
91 
93  void set_ratio(double ratio);
94  void set_freq_beats(double beats);
95  bool on_button_release(GdkEventButton* ev);
96 
97  void value_changed();
98 
99  Gtk::Widget* _widget;
102  Gtk::Adjustment* _adjustment;
103  sigc::connection _screen_update_connection;
106 };
107 
108 
109 #endif /* __ardour_gtk_automation_controller_h__ */
std::string get_label(double &)
sigc::connection _screen_update_connection
Gtk::Adjustment * adjustment()
bool on_button_release(GdkEventButton *ev)
PBD::ScopedConnection _changed_connection
boost::shared_ptr< ARDOUR::Automatable > _printer
sigc::signal< void > StartGesture
void set_freq_beats(double beats)
void set_ratio(double ratio)
static boost::shared_ptr< AutomationController > create(boost::shared_ptr< ARDOUR::Automatable > parent, const Evoral::Parameter &param, const ARDOUR::ParameterDescriptor &desc, boost::shared_ptr< ARDOUR::AutomationControl > ac)
sigc::signal< void > StopGesture
Definition: amp.h:29
boost::shared_ptr< ARDOUR::AutomationControl > _controllable
AutomationBarController(boost::shared_ptr< ARDOUR::Automatable > printer, boost::shared_ptr< ARDOUR::AutomationControl > ac, Gtk::Adjustment *adj)
boost::shared_ptr< ARDOUR::AutomationControl > controllable()
boost::shared_ptr< ARDOUR::Automatable > _printer
AutomationController(boost::shared_ptr< ARDOUR::Automatable > printer, boost::shared_ptr< ARDOUR::AutomationControl > ac, Gtk::Adjustment *adj)
boost::shared_ptr< ARDOUR::AutomationControl > _controllable
Gtk::Adjustment * _adjustment