2 Copyright (C) 2007 Paul Davis
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_h__
21 #define __ardour_parameter_h__
24 #include <pbd/compose.h>
25 #include <pbd/error.h>
26 #include <ardour/types.h>
27 #include <evoral/Parameter.hpp>
28 #include <evoral/MIDIParameters.hpp>
32 /** ID of an automatable parameter.
34 * A given automatable object has a number of automatable parameters. This is
35 * the unique ID for those parameters. Anything automatable (AutomationList,
36 * Curve) must have unique Parameter ID with respect to it's Automatable parent.
38 * These are fast to compare, but passing a (const) reference around is
39 * probably more efficient than copying because the Parameter contains
40 * metadata not used for comparison.
42 * See evoral/Parameter.hpp for precise definition.
44 class Parameter : public Evoral::Parameter
47 Parameter(AutomationType type = NullAutomation, uint32_t id=0, uint8_t channel=0)
48 : Evoral::Parameter((uint32_t)type, id, channel)
53 Parameter(const Evoral::Parameter& copy)
54 : Evoral::Parameter(copy)
58 static void init_metadata(AutomationType type) {
71 case PluginAutomation:
74 case FadeInAutomation:
75 case FadeOutAutomation:
76 case EnvelopeAutomation:
80 case MidiCCAutomation:
81 case MidiPgmChangeAutomation:
82 case MidiChannelPressureAutomation:
83 Evoral::MIDI::controller_range(min, max, normal); break;
84 case MidiPitchBenderAutomation:
85 Evoral::MIDI::bender_range(min, max, normal); break;
87 set_range(type, min, max, normal);
90 Parameter(const std::string& str);
92 inline AutomationType type() const { return (AutomationType)_type; }
94 std::string symbol() const;
96 inline bool is_integer() const {
97 return (_type >= MidiCCAutomation && _type <= MidiChannelPressureAutomation);
100 inline operator Parameter() { return (Parameter)*this; }
104 } // namespace ARDOUR
106 #endif // __ardour_parameter_h__