Ardour  9.0-pre0-582-g084a23a80d
Control.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2014 David Robillard <d@drobilla.net>
3  * Copyright (C) 2010-2012 Carl Hetherington <carl@carlh.net>
4  * Copyright (C) 2010-2013 Paul Davis <paul@linuxaudiosystems.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #ifndef EVORAL_CONTROL_HPP
22 #define EVORAL_CONTROL_HPP
23 
24 #include <set>
25 #include <map>
26 #include <memory>
27 
28 #include "pbd/signals.h"
29 
30 #include "temporal/timeline.h"
31 
32 #include "evoral/visibility.h"
33 #include "evoral/ControlList.h"
34 #include "evoral/Parameter.h"
36 
37 namespace Evoral {
38 
39 struct ParameterDescriptor;
40 class Transport;
41 class TypeMap;
42 
50 {
51 public:
52  Control (const Parameter& parameter,
53  const ParameterDescriptor& desc,
54  std::shared_ptr<ControlList> list);
55 
56  virtual ~Control() {}
57 
58  virtual void set_double (double val, Temporal::timepos_t const & when = Temporal::timepos_t (), bool to_list = false);
59  virtual double get_double () const { return _user_value; }
60 
61  void set_list(std::shared_ptr<ControlList>);
62 
63  std::shared_ptr<ControlList> list() { return _list; }
64  std::shared_ptr<const ControlList> list() const { return _list; }
65 
66  inline const Parameter& parameter() const { return _parameter; }
67 
70 
71 protected:
73  std::shared_ptr<ControlList> _list;
74  double _user_value;
76 
77 private:
79 };
80 
81 } // namespace Evoral
82 
83 #endif // EVORAL_CONTROL_HPP
virtual void set_double(double val, Temporal::timepos_t const &when=Temporal::timepos_t(), bool to_list=false)
PBD::ScopedConnection _list_marked_dirty_connection
Definition: Control.h:75
std::shared_ptr< ControlList > list()
Definition: Control.h:63
virtual ~Control()
Definition: Control.h:56
PBD::Signal< void()> ListMarkedDirty
Definition: Control.h:69
virtual double get_double() const
Definition: Control.h:59
void list_marked_dirty()
Control(const Parameter &parameter, const ParameterDescriptor &desc, std::shared_ptr< ControlList > list)
double _user_value
Definition: Control.h:74
std::shared_ptr< ControlList > _list
Definition: Control.h:73
std::shared_ptr< const ControlList > list() const
Definition: Control.h:64
void set_list(std::shared_ptr< ControlList >)
const Parameter & parameter() const
Definition: Control.h:66
Parameter _parameter
Definition: Control.h:72
#define LIBEVORAL_API
Definition: editor.h:86
DebugBits Transport