TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/attribute/AnimatedParamType.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_HOST_CORE_ATTRIBUTE_ANIMATED_PARAMTYPE_HPP_
00002 #define _TUTTLE_HOST_CORE_ATTRIBUTE_ANIMATED_PARAMTYPE_HPP_
00003 
00004 /* Template class for an animated parameter.
00005 
00006 Used for ParamDouble and ParamInteger */
00007 
00008 #include "AnimatedParam.hpp"
00009 
00010 namespace tuttle {
00011 namespace host {
00012 namespace attribute {
00013 
00014 
00015 /**
00016  * @brief This class is just a re-implementation dedicated to Double Param.
00017  *        It allows implicit conversion from Int to Double.
00018  */
00019 class AnimatedParamDouble : public AnimatedParam<double, ofx::attribute::OfxhParamDouble>
00020 {
00021         typedef AnimatedParam<double, ofx::attribute::OfxhParamDouble> Parent;
00022         
00023 public:
00024         
00025         AnimatedParamDouble(
00026                 INode& effect,
00027                 const std::string& name,
00028                 const ofx::attribute::OfxhParamDescriptor& descriptor,
00029                 const std::size_t index,
00030                 const double value )
00031         : Parent( effect, name, descriptor, index, value )
00032         {}
00033         
00034         inline void setValue( const double& v, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC
00035         {
00036                 Parent::setValue( v, change );
00037         }
00038 
00039         inline void setValueAtTime( const OfxTime time, const double& v, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC
00040         {
00041                 Parent::setValueAtTime( time, v, change );
00042         }
00043         
00044         inline void setValue( const int& v, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC
00045         {
00046                 Parent::setValue( (double)v, change );
00047         }
00048 
00049         inline void setValueAtTime( const OfxTime time, const int& v, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC
00050         {
00051                 Parent::setValueAtTime( time, (double)v, change );
00052         }
00053 
00054 };
00055 
00056 typedef AnimatedParam<int, ofx::attribute::OfxhParamInteger> AnimatedParamInteger;
00057 }
00058 }
00059 }
00060 
00061 #endif