Move ParameterDescriptor from Plugin to its own header.
[ardour.git] / libs / ardour / ardour / parameter_descriptor.h
1 /*
2     Copyright (C) 2014 Paul Davis
3     Author: David Robillard
4
5     This program is free software; you can redistribute it and/or modify it
6     under the terms of the GNU General Public License as published by the Free
7     Software Foundation; either version 2 of the License, or (at your option)
8     any later version.
9
10     This program is distributed in the hope that it will be useful, but WITHOUT
11     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13     for more details.
14
15     You should have received a copy of the GNU General Public License along
16     with this program; if not, write to the Free Software Foundation, Inc.,
17     675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #ifndef __ardour_parameter_descriptor_h__
21 #define __ardour_parameter_descriptor_h__
22
23 #include "ardour/variant.h"
24
25 namespace ARDOUR {
26
27 typedef std::map<const std::string, const float> ScalePoints;
28
29 /** Descriptor of a parameter or control.
30  *
31  * Essentially a union of LADSPA, VST and LV2 info.
32  */
33 struct ParameterDescriptor
34 {
35         ParameterDescriptor()
36                 : key((uint32_t)-1)
37                 , datatype(Variant::VOID)
38                 , lower(0)
39                 , upper(0)
40                 , step(0)
41                 , smallstep(0)
42                 , largestep(0)
43                 , integer_step(false)
44                 , toggled(false)
45                 , logarithmic(false)
46                 , sr_dependent(false)
47                 , min_unbound(0)
48                 , max_unbound(0)
49                 , enumeration(false)
50                 , midinote(false)
51         {}
52
53         std::string                    label;
54         boost::shared_ptr<ScalePoints> scale_points;
55         uint32_t                       key;  ///< for properties
56         Variant::Type                  datatype;  ///< for properties
57         float                          lower;  ///< for frequencies, this is in Hz (not a fraction of the sample rate)
58         float                          upper;  ///< for frequencies, this is in Hz (not a fraction of the sample rate)
59         float                          step;
60         float                          smallstep;
61         float                          largestep;
62         bool                           integer_step;
63         bool                           toggled;
64         bool                           logarithmic;
65         bool                           sr_dependent;
66         bool                           min_unbound;
67         bool                           max_unbound;
68         bool                           enumeration;
69         bool                           midinote;  ///< only used if integer_step is also true
70 };
71
72 } // namespace ARDOUR
73
74 #endif // __ardour_parameter_descriptor_h__