ParameterDescriptor(const Evoral::Parameter& parameter)
: key((uint32_t)-1)
- , datatype(Variant::VOID)
+ , datatype(Variant::NOTHING)
, unit(NONE)
, normal(parameter.normal())
, lower(parameter.min())
ParameterDescriptor()
: key((uint32_t)-1)
- , datatype(Variant::VOID)
+ , datatype(Variant::NOTHING)
, unit(NONE)
, normal(0)
, lower(0)
#include "ardour/libardour_visibility.h"
#include "pbd/compose.h"
-#ifdef PLATFORM_WINDOWS
-#undef VOID
-#endif
-
namespace ARDOUR {
/** A value with dynamic type (tagged union). */
{
public:
enum Type {
- VOID, ///< Nothing
+ NOTHING, ///< Nothing (void)
BOOL, ///< Boolean
DOUBLE, ///< C double (64-bit IEEE-754)
FLOAT, ///< C float (32-bit IEEE-754)
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)
/** 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)
std::min(value, (double)INT64_MAX)));
break;
default:
- _type = VOID;
+ _type = NOTHING;
_long = 0;
}
}
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
}
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());
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;
}
} 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));
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;
}