diff options
author | David Robillard <d@drobilla.net> | 2014-11-07 17:21:43 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-11-07 17:21:43 -0500 |
commit | bb12c750bba6d4ce9424a36e472c701e98ac89f6 (patch) | |
tree | 2ff81cca92e5e042c25396f076b5281b30ea93aa | |
parent | 4260d0ca0e476011e7f2f1df9bf30c4bc20e1434 (diff) |
Just rename problematic Variant::VOID type.
-rw-r--r-- | libs/ardour/ardour/parameter_descriptor.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/variant.h | 22 | ||||
-rw-r--r-- | libs/ardour/automatable.cc | 2 | ||||
-rw-r--r-- | libs/ardour/lv2_plugin.cc | 4 | ||||
-rw-r--r-- | libs/ardour/plugin_insert.cc | 4 |
5 files changed, 16 insertions, 20 deletions
diff --git a/libs/ardour/ardour/parameter_descriptor.h b/libs/ardour/ardour/parameter_descriptor.h index f4dc3c819c..659304fb60 100644 --- a/libs/ardour/ardour/parameter_descriptor.h +++ b/libs/ardour/ardour/parameter_descriptor.h @@ -42,7 +42,7 @@ struct ParameterDescriptor ParameterDescriptor(const Evoral::Parameter& parameter) : key((uint32_t)-1) - , datatype(Variant::VOID) + , datatype(Variant::NOTHING) , unit(NONE) , normal(parameter.normal()) , lower(parameter.min()) @@ -66,7 +66,7 @@ struct ParameterDescriptor ParameterDescriptor() : key((uint32_t)-1) - , datatype(Variant::VOID) + , datatype(Variant::NOTHING) , unit(NONE) , normal(0) , lower(0) diff --git a/libs/ardour/ardour/variant.h b/libs/ardour/ardour/variant.h index 7eccab251f..8fd9c829f7 100644 --- a/libs/ardour/ardour/variant.h +++ b/libs/ardour/ardour/variant.h @@ -29,10 +29,6 @@ #include "ardour/libardour_visibility.h" #include "pbd/compose.h" -#ifdef PLATFORM_WINDOWS -#undef VOID -#endif - namespace ARDOUR { /** A value with dynamic type (tagged union). */ @@ -40,7 +36,7 @@ class LIBARDOUR_API Variant { public: enum Type { - VOID, ///< Nothing + NOTHING, ///< Nothing (void) BOOL, ///< Boolean DOUBLE, ///< C double (64-bit IEEE-754) FLOAT, ///< C float (32-bit IEEE-754) @@ -51,12 +47,12 @@ public: URI ///< URI string }; - explicit Variant() : _type(VOID) { _long = 0; } - explicit Variant(bool value) : _type(BOOL) { _bool = value; } - explicit Variant(double value) : _type(DOUBLE) { _double = value; } - explicit Variant(float value) : _type(FLOAT) { _float = value; } - explicit Variant(int32_t value) : _type(INT) { _int = value; } - explicit Variant(int64_t value) : _type(LONG) { _long = value; } + explicit Variant() : _type(NOTHING) { _long = 0; } + explicit Variant(bool value) : _type(BOOL) { _bool = value; } + explicit Variant(double value) : _type(DOUBLE) { _double = value; } + explicit Variant(float value) : _type(FLOAT) { _float = value; } + explicit Variant(int32_t value) : _type(INT) { _int = value; } + explicit Variant(int64_t value) : _type(LONG) { _long = value; } /** Make a variant of a specific string type (string types only) */ Variant(Type type, const std::string& value) @@ -66,7 +62,7 @@ public: /** Make a numeric variant from a double (numeric types only). * - * If conversion is impossible, the variant will have type VOID. + * If conversion is impossible, the variant will have type NOTHING. */ Variant(Type type, double value) : _type(type) @@ -90,7 +86,7 @@ public: std::min(value, (double)INT64_MAX))); break; default: - _type = VOID; + _type = NOTHING; _long = 0; } } diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc index b4d957c8b6..ef99fc70d3 100644 --- a/libs/ardour/automatable.cc +++ b/libs/ardour/automatable.cc @@ -420,7 +420,7 @@ Automatable::control_factory(const Evoral::Parameter& param) PluginInsert* pi = dynamic_cast<PluginInsert*>(this); if (pi) { desc = pi->plugin(0)->get_property_descriptor(param.id()); - if (desc.datatype != Variant::VOID) { + if (desc.datatype != Variant::NOTHING) { if (!Variant::type_is_numeric(desc.datatype)) { list.reset(); // Can't automate non-numeric data yet } diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index d7a68fe3e7..abd3a55a1b 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -1222,7 +1222,7 @@ static void forge_variant(LV2_Atom_Forge* forge, const Variant& value) { switch (value.type()) { - case Variant::VOID: + case Variant::NOTHING: break; case Variant::BOOL: lv2_atom_forge_bool(forge, value.get_bool()); @@ -1286,7 +1286,7 @@ LV2Plugin::set_property(uint32_t key, const Variant& value) if (_patch_port_in_index == (uint32_t)-1) { error << "LV2: set_property called with unset patch_port_in_index" << endmsg; return; - } else if (value.type() == Variant::VOID) { + } else if (value.type() == Variant::NOTHING) { error << "LV2: set_property called with void value" << endmsg; return; } diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 1537be6ded..26b6aacd2a 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -259,7 +259,7 @@ PluginInsert::create_automatable_parameters () } else if (i->type() == PluginPropertyAutomation) { Evoral::Parameter param(*i); const ParameterDescriptor& desc = _plugins.front()->get_property_descriptor(param.id()); - if (desc.datatype != Variant::VOID) { + if (desc.datatype != Variant::NOTHING) { boost::shared_ptr<AutomationList> list; if (Variant::type_is_numeric(desc.datatype)) { list = boost::shared_ptr<AutomationList>(new AutomationList(param)); @@ -1313,7 +1313,7 @@ PluginInsert::PluginPropertyControl::set_value (double user_val) This is lossy, but better than nothing until Ardour's automation system can handle various datatypes all the way down. */ const Variant value(_desc.datatype, user_val); - if (value.type() == Variant::VOID) { + if (value.type() == Variant::NOTHING) { error << "set_value(double) called for non-numeric property" << endmsg; return; } |