TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/plugin/context/WriterPluginFactory.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_PLUGIN_WRITERPLUGINFACTORY_HPP_
00002 #define _TUTTLE_PLUGIN_WRITERPLUGINFACTORY_HPP_
00003 
00004 #include "WriterDefinition.hpp"
00005 
00006 #include <tuttle/plugin/exceptions.hpp>
00007 
00008 #include <ofxsImageEffect.h>
00009 #include <ofxsMultiThread.h>
00010 
00011 namespace tuttle {
00012 namespace plugin {
00013 
00014 void describeWriterParamsInContext( OFX::ImageEffectDescriptor& desc,
00015                                     OFX::EContext               context )
00016 {
00017         OFX::StringParamDescriptor* filename = desc.defineStringParam( kTuttlePluginFilename );
00018         filename->setLabel( kTuttlePluginFilenameLabel );
00019         filename->setStringType( OFX::eStringTypeFilePath );
00020         filename->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
00021         // the file doesn't need to exist, the writer will create it!
00022         filename->setFilePathExists(false);
00023         desc.addClipPreferencesSlaveParam( *filename );
00024 
00025         OFX::ChoiceParamDescriptor* channel = desc.defineChoiceParam( kTuttlePluginChannel );
00026         channel->setLabel( kTuttlePluginChannelLabel );
00027         channel->appendOption( kTuttlePluginChannelAuto );
00028         channel->appendOption( kTuttlePluginChannelGray );
00029         channel->appendOption( kTuttlePluginChannelRGB );
00030         channel->appendOption( kTuttlePluginChannelRGBA );
00031         channel->setDefault( 0 );
00032 
00033         OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam( kTuttlePluginBitDepth );
00034         bitDepth->setLabel( kTuttlePluginBitDepthLabel );
00035         bitDepth->appendOption( kTuttlePluginBitDepth8 );
00036         bitDepth->appendOption( kTuttlePluginBitDepth16 );
00037         bitDepth->setDefault( 0 );
00038         
00039         OFX::BooleanParamDescriptor* premult = desc.defineBooleanParam( kParamPremultiplied );
00040         premult->setLabel( "Premultiplied" );
00041         premult->setDefault( false );
00042         
00043         OFX::ChoiceParamDescriptor* existingFile = desc.defineChoiceParam( kParamWriterExistingFile );
00044         existingFile->setLabel( "Existing File" );
00045         existingFile->appendOption( kParamWriterExistingFile_overwrite );
00046         existingFile->appendOption( kParamWriterExistingFile_error );
00047         if( OFX::getImageEffectHostDescription()->hostName == "TuttleOfx" )
00048         {
00049                 // Only Tuttle is able to do that, because we disable the computation
00050                 // using the IsIdentity Action. This is not in the OpenFX standard.
00051                 existingFile->appendOption( kParamWriterExistingFile_skip );
00052         }
00053         //existingFile->appendOption( kParamWriterExistingFile_reader ); // TODO: not implemented yet.
00054         existingFile->setDefault( eParamWriterExistingFile_overwrite );
00055 
00056         OFX::BooleanParamDescriptor* copyToOutput = desc.defineBooleanParam( kParamWriterCopyToOutput );
00057         copyToOutput->setLabel( "Copy buffer to output" );
00058         copyToOutput->setHint( "This is only useful if you connect nodes to the output clip of the writer." );
00059         copyToOutput->setDefault( false );
00060 
00061         OFX::PushButtonParamDescriptor* render = desc.definePushButtonParam( kParamWriterRender );
00062         render->setLabels( "Render", "Render", "Render step" );
00063         render->setHint("Force render (writing)");
00064 
00065         OFX::BooleanParamDescriptor* renderAlways = desc.defineBooleanParam( kParamWriterRenderAlways );
00066         renderAlways->setLabel( "Render always" );
00067         renderAlways->setHint( "This is only useful as a workaround for GUI applications." );
00068         renderAlways->setDefault( true ); // because tuttle is not declared as a background renderer
00069 
00070         OFX::IntParamDescriptor* forceNewRender = desc.defineIntParam( kParamWriterForceNewRender );
00071         forceNewRender->setLabel( "Force new render" );
00072         forceNewRender->setHint( "This is only useful as a workaround for GUI applications." );
00073         forceNewRender->setEnabled( false );
00074         forceNewRender->setIsSecret( true );
00075         forceNewRender->setIsPersistant( false );
00076         forceNewRender->setAnimates( false );
00077         forceNewRender->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
00078         forceNewRender->setEvaluateOnChange( true );
00079         forceNewRender->setDefault( 0 );
00080 }
00081 
00082 }
00083 }
00084 
00085 
00086 #endif
00087