change VCA number to signed.
[ardour.git] / libs / ardour / ardour / gain_control.h
1 /*
2     Copyright (C) 2006-2016 Paul Davis
3
4     This program is free software; you can redistribute it and/or modify it
5     under the terms of the GNU General Public License as published by the Free
6     Software Foundation; either version 2 of the License, or (at your option)
7     any later version.
8
9     This program is distributed in the hope that it will be useful, but WITHOUT
10     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12     for more details.
13
14     You should have received a copy of the GNU General Public License along
15     with this program; if not, write to the Free Software Foundation, Inc.,
16     675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19 #ifndef __ardour_gain_control_h__
20 #define __ardour_gain_control_h__
21
22 #include <string>
23
24 #include <boost/shared_ptr.hpp>
25
26 #include "pbd/controllable.h"
27
28 #include "evoral/Parameter.hpp"
29
30 #include "ardour/slavable_automation_control.h"
31 #include "ardour/libardour_visibility.h"
32
33 namespace ARDOUR {
34
35 class Session;
36
37 class LIBARDOUR_API GainControl : public SlavableAutomationControl {
38   public:
39         GainControl (Session& session, const Evoral::Parameter &param,
40                      boost::shared_ptr<AutomationList> al = boost::shared_ptr<AutomationList>());
41
42         double internal_to_interface (double) const;
43         double interface_to_internal (double) const;
44         double internal_to_user (double) const;
45         double user_to_internal (double) const;
46         std::string get_user_string () const;
47
48         double lower_db;
49         double range_db;
50
51         int set_state (XMLNode const&, int);
52         XMLNode& get_state();
53
54         void inc_gain (gain_t);
55
56   private:
57         void recompute_masters_ratios (double val);
58 };
59
60 } /* namespace */
61
62 #endif /* __ardour_gain_control_h__ */