TuttleOFX  1
OfxhParamInteger.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_HOST_OFX_PARAM_PARAMINTEGER_HPP_
00002 #define _TUTTLE_HOST_OFX_PARAM_PARAMINTEGER_HPP_
00003 
00004 #include "OfxhParam.hpp"
00005 #include "OfxhParamDescriptor.hpp"
00006 #include "OfxhParamSet.hpp"
00007 #include "OfxhKeyframeParam.hpp"
00008 
00009 namespace tuttle {
00010 namespace host {
00011 namespace ofx {
00012 namespace attribute {
00013 
00014 class OfxhParamInteger
00015         : public OfxhParam
00016         , public OfxhKeyframeParam
00017 {
00018 protected:
00019         std::size_t _index;
00020 
00021 public:
00022         typedef int BaseType;
00023         OfxhParamInteger( const OfxhParamDescriptor& descriptor, const std::string& name, OfxhParamSet& setInstance, const std::size_t index = 0 )
00024                 : OfxhParam( descriptor, name, setInstance )
00025                 , _index( index )
00026         {
00027                 getEditableProperties().addNotifyHook( kOfxParamPropDisplayMin, this );
00028                 getEditableProperties().addNotifyHook( kOfxParamPropDisplayMax, this );
00029         }
00030 
00031         // Deriving implementatation needs to overide these
00032         virtual void getValue( int& ) const OFX_EXCEPTION_SPEC                                                 = 0;
00033         virtual void getValueAtTime( const OfxTime time, int& ) const OFX_EXCEPTION_SPEC                       = 0;
00034         virtual void setValue( const int&, const EChange change )         OFX_EXCEPTION_SPEC                   = 0;
00035         virtual void setValueAtTime( const OfxTime time, const int&, const EChange change ) OFX_EXCEPTION_SPEC = 0;
00036 
00037         virtual void setValue( const bool& v, const EChange change )         OFX_EXCEPTION_SPEC
00038         {
00039                 setValue( int(v), change );
00040         }
00041 
00042         virtual void setValueAtTime( const OfxTime time, const bool& v, const EChange change ) OFX_EXCEPTION_SPEC
00043         {
00044                 setValueAtTime( time, int(v), change );
00045         }
00046 
00047         // probably derived class does not need to implement, default is an approximation
00048         virtual void derive( const OfxTime time, int& ) const OFX_EXCEPTION_SPEC;
00049         virtual void integrate( const OfxTime time1, const OfxTime time2, int& ) const OFX_EXCEPTION_SPEC;
00050 
00051         /// implementation of var args function
00052         virtual void getV( va_list arg ) const OFX_EXCEPTION_SPEC;
00053 
00054         /// implementation of var args function
00055         virtual void getV( const OfxTime time, va_list arg ) const OFX_EXCEPTION_SPEC;
00056 
00057         /// implementation of var args function
00058         virtual void setV( va_list arg, const EChange change ) OFX_EXCEPTION_SPEC;
00059 
00060         /// implementation of var args function
00061         virtual void setV( const OfxTime time, va_list arg, const EChange change ) OFX_EXCEPTION_SPEC;
00062 
00063         /// implementation of var args function
00064         virtual void deriveV( const OfxTime time, va_list arg ) const OFX_EXCEPTION_SPEC;
00065 
00066         /// implementation of var args function
00067         virtual void integrateV( const OfxTime time1, const OfxTime time2, va_list arg ) const OFX_EXCEPTION_SPEC;
00068 
00069         std::ostream& displayValues( std::ostream& os ) const
00070         {
00071                 os << getIntValue();
00072                 return os;
00073         }
00074 };
00075 
00076 }
00077 }
00078 }
00079 }
00080 
00081 #endif
00082