Make 'ARDOUR::ParameterDescriptor' exportable, so that it can get used outside of...
[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 #include "evoral/Parameter.hpp"
26 #include "evoral/ParameterDescriptor.hpp"
27
28 namespace ARDOUR {
29
30 typedef std::map<const std::string, const float> ScalePoints;
31
32 /** Descriptor of a parameter or control.
33  *
34  * Essentially a union of LADSPA, VST and LV2 info.
35  */
36 struct LIBARDOUR_API ParameterDescriptor : public Evoral::ParameterDescriptor
37 {
38         enum Unit {
39                 NONE,       ///< No unit
40                 DB,         ///< Decibels
41                 MIDI_NOTE,  ///< MIDI note number
42                 HZ,         ///< Frequency in Hertz
43         };
44
45         ParameterDescriptor(const Evoral::Parameter& parameter);
46
47         ParameterDescriptor();
48
49         /** Set step, smallstep, and largestep, based on current description. */
50         void update_steps();
51
52         std::string                    label;
53         std::string                    print_fmt;  ///< format string for pretty printing
54         boost::shared_ptr<ScalePoints> scale_points;
55         uint32_t                       key;  ///< for properties
56         Variant::Type                  datatype;  ///< for properties
57         Unit                           unit;
58         float                          step;
59         float                          smallstep;
60         float                          largestep;
61         bool                           integer_step;
62         bool                           logarithmic;
63         bool                           sr_dependent;
64         bool                           min_unbound;
65         bool                           max_unbound;
66         bool                           enumeration;
67 };
68
69 } // namespace ARDOUR
70
71 #endif // __ardour_parameter_descriptor_h__