OfxImageEffectSuiteV1 *gEffectSuite = 0; OfxPropertySuiteV1 *gPropertySuite = 0; //////////////////////////////////////////////////////////////////////////////// // Called at load static OfxStatus onLoad(void) { // fetch the host suites out of the global host pointer if(!gHost) return kOfxStatErrMissingHostFeature; gEffectSuite = (OfxImageEffectSuiteV1 *) gHost->fetchSuite(gHost->host, kOfxImageEffectSuite, 1); gPropertySuite = (OfxPropertySuiteV1 *) gHost->fetchSuite(gHost->host, kOfxPropertySuite, 1); if(!gEffectSuite || !gPropertySuite) return kOfxStatErrMissingHostFeature; return kOfxStatOK; }
The load action is always the first action called after the initial boot-strap phase has happened. By this time the plug-in's
setHost
function will have been called, so we have access to the host pointer and so the ability to fetch suites.
What this action does is first to check that the host application has in fact set the
gHost
pointer, it then goes ahead and fetches two
suites
from the host. These suites are simply structs full of function pointers from the host which the plug-in uses to communicate with the host. We are only fetching two suites from the host, the
OfxImageEffectSuiteV1
to give us access to images and more, and the
OfxPropertySuiteV1
which allows us to access values in property sets.