/// static functions for the suite static OfxStatus propReset(OfxPropertySetHandle properties, const char *property) { # ifdef OFX_DEBUG_PROPERTIES std::cout << "OFX: propReset - " << properties << ' ' << property << " ..."; # endif try { Set *thisSet = reinterpret_cast<Set*>(properties); if(!thisSet || !thisSet->verifyMagic()) { # ifdef OFX_DEBUG_PROPERTIES std::cout << ' ' << StatStr(kOfxStatErrBadHandle) << std::endl; # endif return kOfxStatErrBadHandle; } Property *prop = thisSet->fetchProperty(property, false); if(!prop) { # ifdef OFX_DEBUG_PROPERTIES std::cout << ' ' << StatStr(kOfxStatErrUnknown) << std::endl; # endif return kOfxStatErrUnknown; } prop->reset(); # ifdef OFX_DEBUG_PROPERTIES std::cout << ' ' << StatStr(kOfxStatOK) << std::endl; # endif } catch (const Exception& e) { # ifdef OFX_DEBUG_PROPERTIES std::cout << ' ' << StatStr(e.getStatus()) << std::endl; # endif return e.getStatus(); } catch (...) { # ifdef OFX_DEBUG_PROPERTIES std::cout << ' ' << StatStr(kOfxStatErrUnknown) << std::endl; # endif return kOfxStatErrUnknown; } return kOfxStatOK; }
/// static functions for the suite static OfxStatus propGetDimension(OfxPropertySetHandle properties, const char *property, int *count) { # ifdef OFX_DEBUG_PROPERTIES std::cout << "OFX: propGetDimension - " << properties << ' ' << property << " ..."; # endif if (!properties) { # ifdef OFX_DEBUG_PROPERTIES std::cout << ' ' << StatStr(kOfxStatErrBadHandle) << std::endl; # endif return kOfxStatErrBadHandle; } try { Set *thisSet = reinterpret_cast<Set*>(properties); Property *prop = thisSet->fetchProperty(property, true); if(!prop) { # ifdef OFX_DEBUG_PROPERTIES std::cout << "unknown property\n"; # endif return kOfxStatErrUnknown; } *count = prop->getDimension(); # ifdef OFX_DEBUG_PROPERTIES std::cout << *count << ' ' << StatStr(kOfxStatOK) << std::endl; # endif return kOfxStatOK; } catch (const Exception& e) { # ifdef OFX_DEBUG_PROPERTIES std::cout << ' ' << StatStr(e.getStatus()) << std::endl; # endif return e.getStatus(); } catch (...) { # ifdef OFX_DEBUG_PROPERTIES std::cout << ' ' << StatStr(kOfxStatErrUnknown) << std::endl; # endif return kOfxStatErrUnknown; } }