Rename get_param_vocab to get_children_vocab and use a wrapper for the pure virtual...
[synfig.git] / synfig-core / src / synfig / valuenode_linear.cpp
index 583612e..2fabe01 100644 (file)
@@ -84,8 +84,6 @@ ValueNode_Linear::ValueNode_Linear(const ValueBase &value):
        default:
                throw Exception::BadType(ValueBase::type_local_name(get_type()));
        }
-
-       DCAST_HACK_ENABLE();
 }
 
 LinkableValueNode*
@@ -227,3 +225,37 @@ ValueNode_Linear::get_link_index_from_name(const String &name)const
 
        throw Exception::BadLinkName(name);
 }
+
+
+LinkableValueNode::Vocab
+ValueNode_Linear::get_children_vocab_vfunc()const
+{
+       LinkableValueNode::Vocab ret;
+
+       switch(get_type())
+       {
+       case ValueBase::TYPE_ANGLE:
+       case ValueBase::TYPE_COLOR:
+       case ValueBase::TYPE_INTEGER:
+       case ValueBase::TYPE_REAL:
+       case ValueBase::TYPE_TIME:
+               ret.push_back(ParamDesc(ValueBase(),"slope")
+                       .set_local_name(_("Rate"))
+                       .set_description(_("Value that is multiplied by the current time (in seconds)"))
+               );
+       break;
+       case ValueBase::TYPE_VECTOR:
+       default:
+               ret.push_back(ParamDesc(ValueBase(),"slope")
+                       .set_local_name(_("Slope"))
+                       .set_description(_("Value that is multiplied by the current time (in seconds)"))
+               );
+       }
+
+       ret.push_back(ParamDesc(ValueBase(),"offset")
+               .set_local_name(_("Offset"))
+               .set_description(_("Returned value when the current time is zero"))
+       );
+
+       return ret;
+}