ardour
automation_control.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_automation_control_h__
22 #define __ardour_automation_control_h__
23 
24 #include <boost/shared_ptr.hpp>
25 #include <boost/enable_shared_from_this.hpp>
26 
27 #include "evoral/types.hpp"
28 #include "pbd/controllable.h"
29 #include "evoral/Control.hpp"
30 
32 #include "ardour/automation_list.h"
34 
35 namespace ARDOUR {
36 
37 class Session;
38 class Automatable;
39 
40 
44  : public PBD::Controllable
45  , public Evoral::Control
46  , public boost::enable_shared_from_this<AutomationControl>
47 {
48 public:
50  const Evoral::Parameter& parameter,
51  const ParameterDescriptor& desc,
53  const std::string& name="");
54 
56 
59  }
60 
62 
63  inline bool automation_playback() const {
64  return alist() ? alist()->automation_playback() : false;
65  }
66 
67  inline bool automation_write() const {
68  return alist() ? alist()->automation_write() : false;
69  }
70 
71  inline AutoState automation_state() const {
72  return alist() ? alist()->automation_state() : Off;
73  }
74 
75  inline AutoStyle automation_style() const {
76  return alist() ? alist()->automation_style() : Absolute;
77  }
78 
79  void set_automation_state(AutoState as);
80  void set_automation_style(AutoStyle as);
81  void start_touch(double when);
82  void stop_touch(bool mark, double when);
83 
84  void set_value (double);
85  double get_value () const;
86 
87  double lower() const { return _desc.lower; }
88  double upper() const { return _desc.upper; }
89  double normal() const { return _desc.normal; }
90  bool toggled() const { return _desc.toggled; }
91 
92  const ParameterDescriptor& desc() const { return _desc; }
93 
94  const ARDOUR::Session& session() const { return _session; }
95 
96 protected:
97 
99 
101 };
102 
103 
104 } // namespace ARDOUR
105 
106 #endif /* __ardour_automation_control_h__ */
AutoState automation_state() const
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
Definition: shared_ptr.hpp:396
const ParameterDescriptor _desc
AutoStyle
Definition: types.h:155
AutoStyle automation_style() const
const ParameterDescriptor & desc() const
const ARDOUR::Session & session() const
Definition: amp.h:29
#define LIBARDOUR_API
const char * name
boost::shared_ptr< AutomationList > alist() const
static LilvNode * get_value(LilvWorld *world, const LilvNode *subject, const LilvNode *predicate)
Definition: lv2_plugin.cc:971
AutoState
Definition: types.h:145