TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/ofx/OfxhMessageSuite.cpp
Go to the documentation of this file.
00001 #include "OfxhMessageSuite.hpp"
00002 #include "OfxhMessage.hpp"
00003 #include "OfxhCore.hpp"
00004 
00005 #include <cstdarg>
00006 #include <cstdio>
00007 
00008 namespace tuttle {
00009 namespace host {
00010 namespace ofx {
00011 
00012 namespace {
00013 
00014 OfxStatus message( void* handle, const char* type, const char* id, const char* format, ... )
00015 {
00016         OfxhIMessage* effectInstance = dynamic_cast<OfxhIMessage*>( reinterpret_cast<OfxhIObject*>( handle ) );
00017 
00018         if( effectInstance )
00019         {
00020                 va_list args;
00021                 va_start( args, format );
00022                 effectInstance->vmessage( type, id, format, args );
00023                 va_end( args );
00024         }
00025         else
00026         {
00027                 va_list args;
00028                 va_start( args, format );
00029                 vprintf( format, args );
00030                 va_end( args );
00031         }
00032         return kOfxStatOK;
00033 }
00034 
00035 /// message suite for an image effect plugin
00036 struct OfxMessageSuiteV1 gMessageSuite =
00037 {
00038         message
00039 };
00040 
00041 }
00042 
00043 void* getMessageSuite( const int version )
00044 {
00045         if( version == 1 )
00046                 return static_cast<void*>( &gMessageSuite );
00047         return NULL;
00048 }
00049 
00050 }
00051 }
00052 }
00053