TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/attribute/ParamCustom.cpp
Go to the documentation of this file.
00001 #include "ParamCustom.hpp"
00002 #include "expression.hpp"
00003 
00004 #include <tuttle/host/INode.hpp>
00005 
00006 namespace tuttle {
00007 namespace host {
00008 namespace attribute {
00009 
00010 ParamCustom::ParamCustom( INode&                           effect,
00011                           const std::string&                         name,
00012                           const ofx::attribute::OfxhParamDescriptor& descriptor )
00013         : Param( effect )
00014         , ofx::attribute::OfxhParamCustom( descriptor, name, effect.getParamSet() )
00015 {
00016         _value = getDefault();
00017 }
00018 
00019 const std::string& ParamCustom::getDefault() const
00020 {
00021         return getProperties().getStringProperty( kOfxParamPropDefault );
00022 }
00023 
00024 void ParamCustom::getValue( std::string& v ) const OFX_EXCEPTION_SPEC
00025 {
00026         v = _value;
00027 }
00028 
00029 void ParamCustom::getValueAtTime( const OfxTime time, std::string& v ) const OFX_EXCEPTION_SPEC
00030 {
00031         v = _value; ///< @todo: in time !
00032 }
00033 
00034 void ParamCustom::setValue( const std::string& v, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC
00035 {
00036         _value = v;
00037         this->paramChanged( change );
00038 }
00039 
00040 void ParamCustom::setValueAtTime( const OfxTime time, const std::string& v, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC
00041 {
00042         _value = v; ///< @todo: in time !
00043         this->paramChanged( change );
00044 }
00045 
00046 void ParamCustom::setValueFromExpression( const std::string& value, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC
00047 {
00048         _value = extractValueFromExpression<std::string>( value );
00049         this->paramChanged( change );
00050 }
00051 
00052 void ParamCustom::copy( const ParamCustom& p ) OFX_EXCEPTION_SPEC
00053 {
00054         _value = p._value;
00055         //      paramChanged( ofx::attribute::eChangeUserEdited );
00056 }
00057 
00058 void ParamCustom::copy( const OfxhParam& p ) OFX_EXCEPTION_SPEC
00059 {
00060         const ParamCustom& param = dynamic_cast<const ParamCustom&>( p );
00061 
00062         copy( param );
00063 }
00064 
00065 }
00066 }
00067 }
00068