ardour
automatable.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2000-2007 Paul Davis
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 
18 */
19 
20 #ifndef __ardour_automatable_h__
21 #define __ardour_automatable_h__
22 
23 #include <map>
24 #include <set>
25 #include <string>
26 #include <boost/shared_ptr.hpp>
27 #include "pbd/signals.h"
28 #include "evoral/ControlSet.hpp"
30 #include "ardour/types.h"
31 
32 class XMLNode;
33 
34 namespace ARDOUR {
35 
36 class Session;
37 class AutomationControl;
38 
39 /* The inherited ControlSet is virtual because AutomatableSequence inherits
40  * from this AND EvoralSequence, which is also a ControlSet
41  */
43 {
44 public:
46  Automatable (const Automatable& other);
47 
48  virtual ~Automatable();
49 
51  control_factory(const Evoral::Parameter& id);
52 
54  automation_control (const Evoral::Parameter& id, bool create_if_missing=false);
55 
57  automation_control (const Evoral::Parameter& id) const;
58 
59  virtual void add_control(boost::shared_ptr<Evoral::Control>);
60  void clear_controls ();
61 
62  virtual void transport_located (framepos_t now);
63  virtual void transport_stopped (framepos_t now);
64 
65  virtual std::string describe_parameter(Evoral::Parameter param);
66  virtual std::string value_as_string (boost::shared_ptr<AutomationControl>) const;
67 
68  AutoState get_parameter_automation_state (Evoral::Parameter param);
69  virtual void set_parameter_automation_state (Evoral::Parameter param, AutoState);
70 
71  AutoStyle get_parameter_automation_style (Evoral::Parameter param);
72  void set_parameter_automation_style (Evoral::Parameter param, AutoStyle);
73 
74  void protect_automation ();
75 
76  const std::set<Evoral::Parameter>& what_can_be_automated() const { return _can_automate_list; }
77  void what_has_existing_automation (std::set<Evoral::Parameter>&) const;
78 
79  static const std::string xml_node_name;
80 
81  int set_automation_xml_state (const XMLNode&, Evoral::Parameter default_param);
82  XMLNode& get_automation_xml_state();
83 
84  PBD::Signal0<void> AutomationStateChanged;
85 
86  protected:
88 
89  void can_automate(Evoral::Parameter);
90 
92 
93  int load_automation (const std::string& path);
94  int old_set_automation_state(const XMLNode&);
95 
96  std::set<Evoral::Parameter> _can_automate_list;
97 
99 
100 private:
102 };
103 
104 
105 } // namespace ARDOUR
106 
107 #endif /* __ardour_automatable_h__ */
std::set< Evoral::Parameter > _can_automate_list
Definition: automatable.h:96
std::string value_as_string(const ARDOUR::ParameterDescriptor &desc, double v)
AutoStyle
Definition: types.h:155
virtual void automation_list_automation_state_changed(Evoral::Parameter, AutoState)
Definition: automatable.h:91
Definition: amp.h:29
const std::set< Evoral::Parameter > & what_can_be_automated() const
Definition: automatable.h:76
PBD::ScopedConnectionList _control_connections
connections to our controls' signals
Definition: automatable.h:101
PBD::Signal0< void > AutomationStateChanged
Definition: automatable.h:84
int64_t framepos_t
Definition: types.h:66
Session & _a_session
Definition: automatable.h:87
#define LIBARDOUR_API
Definition: xml++.h:95
framepos_t _last_automation_snapshot
Definition: automatable.h:98
static const std::string xml_node_name
Definition: automatable.h:79
AutoState
Definition: types.h:145