rollback to 3428, before the mysterious removal of libs/* at 3431/3432
[ardour.git] / libs / ardour / ardour / automation_control.h
1 /*
2     Copyright (C) 2007 Paul Davis
3     Author: Dave 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_automation_control_h__
22 #define __ardour_automation_control_h__
23
24 #include <boost/shared_ptr.hpp>
25 #include <pbd/controllable.h>
26 #include <ardour/parameter.h>
27
28 namespace ARDOUR {
29
30 class AutomationList;
31 class Session;
32 class Automatable;
33
34
35 /** A PBD:Controllable with associated automation data (AutomationList)
36  */
37 class AutomationControl : public PBD::Controllable
38 {
39 public:
40         AutomationControl(ARDOUR::Session&,
41                         boost::shared_ptr<ARDOUR::AutomationList>,
42                         std::string name="unnamed controllable");
43
44         void set_value(float val);
45         float get_value() const;
46         float user_value() const;
47
48         void set_list(boost::shared_ptr<ARDOUR::AutomationList>);
49
50         boost::shared_ptr<ARDOUR::AutomationList>       list()       { return _list; }
51         boost::shared_ptr<const ARDOUR::AutomationList> list() const { return _list; }
52
53         Parameter parameter() const;
54
55 protected:
56         ARDOUR::Session&                          _session;
57         boost::shared_ptr<ARDOUR::AutomationList> _list;
58         float                                     _user_value;
59 };
60
61
62 } // namespace ARDOUR
63
64 #endif /* __ardour_automation_control_h__ */