TuttleOFX
1
|
00001 #ifndef _TUTTLE_HOST_CORE_ATTRIBUTE_PARAMDOUBLE_HPP_ 00002 #define _TUTTLE_HOST_CORE_ATTRIBUTE_PARAMDOUBLE_HPP_ 00003 00004 /* Most of the implementation is in the AnimatedParam template */ 00005 #include "AnimatedParamType.hpp" 00006 00007 namespace tuttle { 00008 namespace host { 00009 namespace attribute { 00010 00011 class ParamDouble : public AnimatedParamDouble 00012 { 00013 public: 00014 ParamDouble( INode& effect, const std::string& name, const ofx::attribute::OfxhParamDescriptor& descriptor, const std::size_t index = 0 ); 00015 00016 double getDefault( ) const; 00017 00018 /// @brief We reimplement some functions of AnimatedParamDouble, because without them, 00019 /// the integer version takes the priority. 00020 /// @{ 00021 inline void setValue( const double& v, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC 00022 { 00023 AnimatedParamDouble::setValue( v, change ); 00024 } 00025 00026 inline void setValueAtTime( const OfxTime time, const double& v, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC 00027 { 00028 AnimatedParamDouble::setValueAtTime( time, v, change ); 00029 } 00030 00031 inline void setValueAtIndex( const std::size_t index, const double& v, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC 00032 { 00033 AnimatedParamDouble::setValueAtIndex( index, v, change ); 00034 } 00035 00036 inline void setValueAtTimeAndIndex( const OfxTime time, const std::size_t index, const double& v, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC 00037 { 00038 AnimatedParamDouble::setValueAtTimeAndIndex( time, index, v, change ); 00039 } 00040 /// @} 00041 00042 00043 /// @brief Re-implementation for Int, to allows an implicit conversion from Int to Double. 00044 /// @{ 00045 inline void setValue( const int& v, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC 00046 { 00047 AnimatedParamDouble::setValue( (double) v, change ); 00048 } 00049 00050 inline void setValueAtTime( const OfxTime time, const int& v, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC 00051 { 00052 AnimatedParamDouble::setValueAtTime( time, (double) v, change ); 00053 } 00054 00055 inline void setValueAtIndex( const std::size_t index, const int& v, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC 00056 { 00057 AnimatedParamDouble::setValueAtIndex( index, (double) v, change ); 00058 } 00059 00060 inline void setValueAtTimeAndIndex( const OfxTime time, const std::size_t index, const int& v, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC 00061 { 00062 AnimatedParamDouble::setValueAtTimeAndIndex( time, index, (double) v, change ); 00063 } 00064 /// @} 00065 }; 00066 00067 } 00068 } 00069 } 00070 00071 #endif