TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/ofx/attribute/OfxhClip.cpp
Go to the documentation of this file.
00001 #include "OfxhClip.hpp"
00002 #include "OfxhClipDescriptor.hpp"
00003 
00004 namespace tuttle {
00005 namespace host {
00006 namespace ofx {
00007 namespace attribute {
00008 
00009 OfxhClip::OfxhClip( const OfxhClipDescriptor& desc )
00010         : attribute::OfxhAttribute( desc )
00011 {
00012         /// extra properties for the instance, these are fetched from the host
00013         /// via a get hook and some virtuals
00014         static const property::OfxhPropSpec clipInstanceStuffs[] = {
00015                 { kOfxImageClipPropConnected, property::ePropTypeInt, 1, true, "0" },
00016                 { 0 },
00017         };
00018 
00019         // properties that are needed in an Instance but not a Descriptor
00020         getEditableProperties().addProperties( clipInstanceStuffs );
00021         initHook( clipInstanceStuffs );
00022 
00023         /// we are an instance, we need to reset the props to read only
00024         for( property::PropertyMap::iterator i = getEditableProperties().getMap().begin(), iEnd = getEditableProperties().getMap().end();
00025              i != iEnd;
00026              ++i )
00027         {
00028                 i->second->setPluginReadOnly( false );
00029         }
00030 }
00031 
00032 OfxhClip::~OfxhClip()
00033 {}
00034 
00035 void OfxhClip::initHook( const property::OfxhPropSpec* propSpec )
00036 {
00037         // no more GetHook on clip for the moment...
00038         /*
00039            int i = 0;
00040            while( propSpec[i].name )
00041            {
00042             const Property::PropSpec& spec = propSpec[i];
00043             switch( spec.type )
00044             {
00045                 case Property::eDouble :
00046                 case Property::eString :
00047                 case Property::eInt :
00048                     getProperties().setGetHook( spec.name, this );
00049                     break;
00050                 default:
00051                     break;
00052             }
00053          ++i;
00054            }
00055          */
00056 }
00057 
00058 }
00059 }
00060 }
00061 }