projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use LinkableValueNode members functions when possible in the derived valuenodes.
[synfig.git]
/
synfig-core
/
src
/
synfig
/
valuenode_sine.cpp
diff --git
a/synfig-core/src/synfig/valuenode_sine.cpp
b/synfig-core/src/synfig/valuenode_sine.cpp
index
9aaaee2
..
65552fa
100644
(file)
--- a/
synfig-core/src/synfig/valuenode_sine.cpp
+++ b/
synfig-core/src/synfig/valuenode_sine.cpp
@@
-53,6
+53,8
@@
using namespace synfig;
ValueNode_Sine::ValueNode_Sine(const ValueBase &value):
LinkableValueNode(value.get_type())
{
ValueNode_Sine::ValueNode_Sine(const ValueBase &value):
LinkableValueNode(value.get_type())
{
+ Vocab ret(get_children_vocab());
+ set_children_vocab(ret);
switch(value.get_type())
{
case ValueBase::TYPE_REAL:
switch(value.get_type())
{
case ValueBase::TYPE_REAL:
@@
-139,43
+141,23
@@
ValueNode_Sine::get_link_vfunc(int i)const
return 0;
}
return 0;
}
-int
-ValueNode_Sine::
link_count
()const
+LinkableValueNode::Vocab
+ValueNode_Sine::
get_children_vocab_vfunc
()const
{
{
- return 2;
-}
-
-String
-ValueNode_Sine::link_name(int i)const
-{
- assert(i>=0 && i<link_count());
-
- if(i==0)
- return "angle";
- if(i==1)
- return "amp";
- return String();
-}
+ if(children_vocab.size())
+ return children_vocab;
-String
-ValueNode_Sine::link_local_name(int i)const
-{
- assert(i>=0 && i<link_count());
+ LinkableValueNode::Vocab ret;
- if(i==0)
- return _("Angle");
- if(i==1)
- return _("Amplitude");
- return String();
-}
+ ret.push_back(ParamDesc(ValueBase(),"angle")
+ .set_local_name(_("Angle"))
+ .set_description(_("The angle where the sine is calculated from"))
+ );
-int
-ValueNode_Sine::get_link_index_from_name(const String &name)const
-{
- if(name=="angle")
- return 0;
- if(name=="amp")
- return 1;
+ ret.push_back(ParamDesc(ValueBase(),"amp")
+ .set_local_name(_("Amplitude"))
+ .set_description(_("The value that multiplies the resulting sine"))
+ );
-
throw Exception::BadLinkName(name)
;
+
return ret
;
}
}