Just rename problematic Variant::VOID type.
authorDavid Robillard <d@drobilla.net>
Fri, 7 Nov 2014 22:21:43 +0000 (17:21 -0500)
committerDavid Robillard <d@drobilla.net>
Fri, 7 Nov 2014 22:21:43 +0000 (17:21 -0500)
libs/ardour/ardour/parameter_descriptor.h
libs/ardour/ardour/variant.h
libs/ardour/automatable.cc
libs/ardour/lv2_plugin.cc
libs/ardour/plugin_insert.cc

index f4dc3c819cc6480d1156981097f60fcdd52d12c0..659304fb604ad0273a05dff1f4d7bd374090a902 100644 (file)
@@ -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)
index 7eccab251f6e4ee83104b1c5a3119acc1a6548d3..8fd9c829f7d024230ff9ec59b6e019d247410643 100644 (file)
 #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;
                }
        }
index b4d957c8b6862a173d92f9d3f38cb1aba0f22d38..ef99fc70d3e91ebf6ba00add7c2c3d141f0ea9f3 100644 (file)
@@ -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
                                }
index d7a68fe3e7b330be8b1192d747e0caa12b084837..abd3a55a1b6fd1af9ba5bbcc950ee69150bcb106 100644 (file)
@@ -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;
        }
index 1537be6ded89fea37ac003d4b08f75275bbbc3cd..26b6aacd2a0ba68b5d4ed0f4dcc2bd456b153692 100644 (file)
@@ -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;
        }