TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/ofx/OfxhImageEffectHost.cpp
Go to the documentation of this file.
00001 #include "OfxhImageEffectHost.hpp"
00002 
00003 #include "OfxhImageEffectSuite.hpp"
00004 #include "OfxhParameterSuite.hpp"
00005 #include "OfxhMessageSuite.hpp"
00006 #include "OfxhInteractSuite.hpp"
00007 #include "OfxhProgressSuite.hpp"
00008 #include "OfxhTimelineSuite.hpp"
00009 #include "OfxhMultiThreadSuite.hpp"
00010 
00011 namespace tuttle {
00012 namespace host {
00013 namespace ofx {
00014 namespace imageEffect {
00015 
00016 /// properties for the image effect host
00017 static property::OfxhPropSpec hostStuffs[] = {
00018         { kOfxImageEffectHostPropIsBackground, property::ePropTypeInt, 1, true, "0" },
00019         { kOfxImageEffectPropSupportsOverlays, property::ePropTypeInt, 1, true, "1" },
00020         { kOfxImageEffectPropSupportsMultiResolution, property::ePropTypeInt, 1, true, "1" },
00021         { kOfxImageEffectPropSupportsTiles, property::ePropTypeInt, 1, true, "1" },
00022         { kOfxImageEffectPropTemporalClipAccess, property::ePropTypeInt, 1, true, "1" },
00023 
00024         /// xxx this needs defaulting manually
00025         { kOfxImageEffectPropSupportedComponents, property::ePropTypeString, 0, true, "" },
00026         /// xxx this needs defaulting manually
00027 
00028         { kOfxImageEffectPropSupportedPixelDepths, property::ePropTypeString, 0, true, "" },
00029 
00030         /// xxx this needs defaulting manually
00031 
00032         { kOfxImageEffectPropSupportedContexts, property::ePropTypeString, 0, true, "" },
00033         /// xxx this needs defaulting manually
00034 
00035         { kOfxImageEffectPropSupportsMultipleClipDepths, property::ePropTypeInt, 1, true, "1" },
00036         { kOfxImageEffectPropSupportsMultipleClipPARs, property::ePropTypeInt, 1, true, "0" },
00037         { kOfxImageEffectPropSetableFrameRate, property::ePropTypeInt, 1, true, "0" },
00038         { kOfxImageEffectPropSetableFielding, property::ePropTypeInt, 1, true, "0" },
00039         { kOfxParamHostPropSupportsCustomInteract, property::ePropTypeInt, 1, true, "0" },
00040         { kOfxParamHostPropSupportsStringAnimation, property::ePropTypeInt, 1, true, "0" },
00041         { kOfxParamHostPropSupportsChoiceAnimation, property::ePropTypeInt, 1, true, "0" },
00042         { kOfxParamHostPropSupportsBooleanAnimation, property::ePropTypeInt, 1, true, "0" },
00043         { kOfxParamHostPropSupportsCustomAnimation, property::ePropTypeInt, 1, true, "0" },
00044         { kOfxParamHostPropMaxParameters, property::ePropTypeInt, 1, true, "-1" },
00045         { kOfxParamHostPropMaxPages, property::ePropTypeInt, 1, true, "0" },
00046         { kOfxParamHostPropPageRowColumnCount, property::ePropTypeInt, 2, true, "0" },
00047         { 0 },
00048 };
00049 
00050 /// ctor
00051 
00052 OfxhImageEffectHost::OfxhImageEffectHost()
00053 {
00054         /// add the properties for an image effect host, derived classs to set most of them
00055         _properties.addProperties( hostStuffs );
00056 }
00057 
00058 OfxhImageEffectHost::~OfxhImageEffectHost()
00059 {}
00060 
00061 /**
00062  * optionally over-ridden function to register the creation of a new descriptor in the host app
00063  */
00064 void OfxhImageEffectHost::initDescriptor( OfxhImageEffectNodeDescriptor& desc ) const {}
00065 
00066 /**
00067  * Use this in any dialogue etc... showing progress
00068  */
00069 void OfxhImageEffectHost::loadingStatus( const std::string& ) {}
00070 
00071 bool OfxhImageEffectHost::pluginSupported( const OfxhImageEffectPlugin& plugin, std::string& reason ) const
00072 {
00073         return true;
00074 }
00075 
00076 /**
00077  * our suite fetcher
00078  */
00079 void* OfxhImageEffectHost::fetchSuite( const char* suiteName, const int suiteVersion )
00080 {
00081         if( strcmp( suiteName, kOfxImageEffectSuite ) == 0 )
00082         {
00083                 return getImageEffectSuite( suiteVersion );
00084         }
00085         else if( strcmp( suiteName, kOfxParameterSuite ) == 0 )
00086         {
00087                 return attribute::getParameterSuite( suiteVersion );
00088         }
00089         else if( strcmp( suiteName, kOfxMessageSuite ) == 0 )
00090         {
00091                 return getMessageSuite( suiteVersion );
00092         }
00093         else if( strcmp( suiteName, kOfxInteractSuite ) == 0 )
00094         {
00095                 return interact::getInteractSuite( suiteVersion );
00096         }
00097         else if( strcmp( suiteName, kOfxProgressSuite ) == 0 )
00098         {
00099                 return getProgressSuite( suiteVersion );
00100         }
00101         else if( strcmp( suiteName, kOfxTimeLineSuite ) == 0 )
00102         {
00103                 return getTimelineSuite( suiteVersion );
00104         }
00105         else if( strcmp( suiteName, kOfxMultiThreadSuite ) == 0 )
00106         {
00107                 return getMultithreadSuite( suiteVersion );
00108         }
00109         else /// otherwise just grab the base class one, which is props and memory
00110                 return tuttle::host::ofx::OfxhHost::fetchSuite( suiteName, suiteVersion );
00111 }
00112 
00113 }
00114 }
00115 }
00116 }
00117