diff options
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/audio_unit.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/ladspa_plugin.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/lv2_plugin.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/parameter_descriptor.h | 74 | ||||
-rw-r--r-- | libs/ardour/ardour/plugin.h | 42 | ||||
-rw-r--r-- | libs/ardour/ardour/variant.h | 1 |
6 files changed, 79 insertions, 44 deletions
diff --git a/libs/ardour/ardour/audio_unit.h b/libs/ardour/ardour/audio_unit.h index 8233e208d3..d840c258e7 100644 --- a/libs/ardour/ardour/audio_unit.h +++ b/libs/ardour/ardour/audio_unit.h @@ -48,7 +48,7 @@ namespace ARDOUR { class AudioEngine; class Session; -struct LIBARDOUR_API AUParameterDescriptor : public Plugin::ParameterDescriptor { +struct LIBARDOUR_API AUParameterDescriptor : public ParameterDescriptor { // additional fields to make operations more efficient AudioUnitParameterID id; AudioUnitScope scope; diff --git a/libs/ardour/ardour/ladspa_plugin.h b/libs/ardour/ardour/ladspa_plugin.h index 473953e221..cdcd9dbc6e 100644 --- a/libs/ardour/ardour/ladspa_plugin.h +++ b/libs/ardour/ardour/ladspa_plugin.h @@ -96,7 +96,7 @@ class LIBARDOUR_API LadspaPlugin : public ARDOUR::Plugin bool parameter_is_output(uint32_t) const; bool parameter_is_toggled(uint32_t) const; - boost::shared_ptr<Plugin::ScalePoints> + boost::shared_ptr<ScalePoints> get_scale_points(uint32_t port_index) const; int set_state (const XMLNode&, int version); diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h index 9e0bebad5a..82912a947d 100644 --- a/libs/ardour/ardour/lv2_plugin.h +++ b/libs/ardour/ardour/lv2_plugin.h @@ -116,7 +116,7 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee bool parameter_is_output (uint32_t) const; bool parameter_is_toggled (uint32_t) const; - boost::shared_ptr<Plugin::ScalePoints> + boost::shared_ptr<ScalePoints> get_scale_points(uint32_t port_index) const; void set_insert_info(const PluginInsert* insert); diff --git a/libs/ardour/ardour/parameter_descriptor.h b/libs/ardour/ardour/parameter_descriptor.h new file mode 100644 index 0000000000..a6315ae429 --- /dev/null +++ b/libs/ardour/ardour/parameter_descriptor.h @@ -0,0 +1,74 @@ +/* + Copyright (C) 2014 Paul Davis + Author: David Robillard + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef __ardour_parameter_descriptor_h__ +#define __ardour_parameter_descriptor_h__ + +#include "ardour/variant.h" + +namespace ARDOUR { + +typedef std::map<const std::string, const float> ScalePoints; + +/** Descriptor of a parameter or control. + * + * Essentially a union of LADSPA, VST and LV2 info. + */ +struct ParameterDescriptor +{ + ParameterDescriptor() + : key((uint32_t)-1) + , datatype(Variant::VOID) + , lower(0) + , upper(0) + , step(0) + , smallstep(0) + , largestep(0) + , integer_step(false) + , toggled(false) + , logarithmic(false) + , sr_dependent(false) + , min_unbound(0) + , max_unbound(0) + , enumeration(false) + , midinote(false) + {} + + std::string label; + boost::shared_ptr<ScalePoints> scale_points; + uint32_t key; ///< for properties + Variant::Type datatype; ///< for properties + float lower; ///< for frequencies, this is in Hz (not a fraction of the sample rate) + float upper; ///< for frequencies, this is in Hz (not a fraction of the sample rate) + float step; + float smallstep; + float largestep; + bool integer_step; + bool toggled; + bool logarithmic; + bool sr_dependent; + bool min_unbound; + bool max_unbound; + bool enumeration; + bool midinote; ///< only used if integer_step is also true +}; + +} // namespace ARDOUR + +#endif // __ardour_parameter_descriptor_h__ diff --git a/libs/ardour/ardour/plugin.h b/libs/ardour/ardour/plugin.h index f1a54b073a..dc7dbf68e1 100644 --- a/libs/ardour/ardour/plugin.h +++ b/libs/ardour/ardour/plugin.h @@ -32,6 +32,7 @@ #include "ardour/latent.h" #include "ardour/libardour_visibility.h" #include "ardour/midi_state_tracker.h" +#include "ardour/parameter_descriptor.h" #include "ardour/plugin_insert.h" #include "ardour/types.h" #include "ardour/variant.h" @@ -95,47 +96,6 @@ class LIBARDOUR_API Plugin : public PBD::StatefulDestructible, public Latent Plugin (const Plugin&); virtual ~Plugin (); - typedef std::map<const std::string, const float> ScalePoints; - - struct ParameterDescriptor { - - ParameterDescriptor () - : integer_step(false) - , toggled (false) - , logarithmic (false) - , sr_dependent (false) - , lower (0) - , upper (0) - , step (0) - , smallstep (0) - , largestep (0) - , min_unbound (0) - , max_unbound (0) - , enumeration (false) - , midinote(false) - {} - - /* essentially a union of LADSPA, VST and LV2 info */ - - bool integer_step; - bool toggled; - bool logarithmic; - bool sr_dependent; - std::string label; - float lower; ///< if this is a frequency, it will be in Hz (not a fraction of the sample rate) - float upper; ///< if this is a frequency, it will be in Hz (not a fraction of the sample rate) - float step; - float smallstep; - float largestep; - bool min_unbound; - bool max_unbound; - bool enumeration; - bool midinote; ///< only used if integer_step is also true - uint32_t key; ///< for properties - Variant::Type datatype; ///< for properties - boost::shared_ptr<ScalePoints> scale_points; - }; - XMLNode& get_state (); virtual int set_state (const XMLNode &, int version); diff --git a/libs/ardour/ardour/variant.h b/libs/ardour/ardour/variant.h index 00b9c3acf8..1e9dda179a 100644 --- a/libs/ardour/ardour/variant.h +++ b/libs/ardour/ardour/variant.h @@ -34,6 +34,7 @@ class LIBARDOUR_API Variant { public: enum Type { + VOID, ///< Nothing BOOL, ///< Boolean DOUBLE, ///< C double (64-bit IEEE-754) FLOAT, ///< C float (32-bit IEEE-754) |