X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fvaluenode_timedswap.cpp;h=378535a83e4269eed9ca5fbfc5bdddf9dec05023;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=bb564c63403a198b788a7f11f21cf4b3ed54bc37;hpb=c6b0c050710376d3cf99b7c083a7c47f1a0516c9;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/valuenode_timedswap.cpp b/synfig-core/trunk/src/synfig/valuenode_timedswap.cpp index bb564c6..378535a 100644 --- a/synfig-core/trunk/src/synfig/valuenode_timedswap.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_timedswap.cpp @@ -6,7 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley -** Copyright (c) 2007 Chris Moore +** Copyright (c) 2007, 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -83,7 +83,7 @@ ValueNode_TimedSwap::ValueNode_TimedSwap(const ValueBase &value): set_link("after",ValueNode_Const::create(value.get(Vector()))); break; default: - throw Exception::BadType(ValueBase::type_name(get_type())); + throw Exception::BadType(ValueBase::type_local_name(get_type())); } set_link("time",ValueNode_Const::create(Time(2))); @@ -98,98 +98,23 @@ ValueNode_TimedSwap::create(const ValueBase& x) return new ValueNode_TimedSwap(x); } - LinkableValueNode* ValueNode_TimedSwap::create_new()const { return new ValueNode_TimedSwap(get_type()); } - synfig::ValueNode_TimedSwap::~ValueNode_TimedSwap() { unlink_all(); } - - -bool -ValueNode_TimedSwap::set_before(const ValueNode::Handle &x) -{ - if(!x || x->get_type()!=get_type() - && !PlaceholderValueNode::Handle::cast_dynamic(x)) - return false; - - before=x; - - return true; -} - -ValueNode::Handle -ValueNode_TimedSwap::get_before()const -{ - return before; -} - - -bool -ValueNode_TimedSwap::set_after(const ValueNode::Handle &x) -{ - if(!x || x->get_type()!=get_type() - && !PlaceholderValueNode::Handle::cast_dynamic(x)) - return false; - - after=x; - - return true; -} - -ValueNode::Handle -ValueNode_TimedSwap::get_after()const -{ - return after; -} - - -bool -ValueNode_TimedSwap::set_swap_time(const ValueNode::Handle &x) -{ - if(!x || (!ValueBase(x->get_type()).same_type_as(ValueBase::TYPE_TIME) && - !PlaceholderValueNode::Handle::cast_dynamic(x))) - return false; - - swap_time=x; - return true; -} - -ValueNode::Handle -ValueNode_TimedSwap::get_swap_time()const -{ - return swap_time; -} - -bool -ValueNode_TimedSwap::set_swap_length(const ValueNode::Handle &x) -{ - if(!x || (!ValueBase(x->get_type()).same_type_as(ValueBase::TYPE_TIME) && - !PlaceholderValueNode::Handle::cast_dynamic(x))) - return false; - - swap_length=x; - return true; -} - -ValueNode::Handle -ValueNode_TimedSwap::get_swap_length()const -{ - return swap_length; -} - - - synfig::ValueBase synfig::ValueNode_TimedSwap::operator()(Time t)const { + if (getenv("SYNFIG_DEBUG_VALUENODE_OPERATORS")) + printf("%s:%d operator()\n", __FILE__, __LINE__); + Time swptime=(*swap_time)(t).get(Time()); Time swplength=(*swap_length)(t).get(Time()); @@ -246,7 +171,6 @@ synfig::ValueNode_TimedSwap::operator()(Time t)const } } - /*! \todo this should interpolate from ** before to after over the period defined ** by swap_length */ @@ -254,18 +178,17 @@ synfig::ValueNode_TimedSwap::operator()(Time t)const return (*before)(t); } - bool -ValueNode_TimedSwap::set_link_vfunc(int i,ValueNode::Handle x) +ValueNode_TimedSwap::set_link_vfunc(int i,ValueNode::Handle value) { assert(i>=0 && i