2 Copyright (C) 2014 Paul Davis
3 Author: David Robillard
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)
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
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.
20 #ifndef __ardour_parameter_descriptor_h__
21 #define __ardour_parameter_descriptor_h__
23 #include "ardour/types.h"
24 #include "ardour/variant.h"
26 #include "evoral/Parameter.hpp"
27 #include "evoral/ParameterDescriptor.hpp"
31 typedef std::map<const std::string, const float> ScalePoints;
33 /** Descriptor of a parameter or control.
35 * Essentially a union of LADSPA, VST and LV2 info.
37 struct LIBARDOUR_API ParameterDescriptor : public Evoral::ParameterDescriptor
42 MIDI_NOTE, ///< MIDI note number
43 HZ, ///< Frequency in Hertz
46 static std::string midi_note_name (uint8_t, bool translate=true);
48 /** Dual of midi_note_name, convert a note name into its midi note number. */
49 typedef std::map<std::string, uint8_t> NameNumMap;
50 static std::string normalize_note_name(const std::string& name);
51 static NameNumMap build_midi_name2num();
52 static uint8_t midi_note_num (const std::string& name);
54 ParameterDescriptor(const Evoral::Parameter& parameter);
56 ParameterDescriptor();
58 /** Set step, smallstep, and largestep, based on current description. */
62 std::string print_fmt; ///< format string for pretty printing
63 boost::shared_ptr<ScalePoints> scale_points;
64 uint32_t key; ///< for properties
65 Variant::Type datatype; ///< for properties
80 #endif // __ardour_parameter_descriptor_h__