1 /* 2 Software License : 3 4 Copyright (c) 2007, The Open Effects Association Ltd. All rights reserved. 5 6 Redistribution and use in source and binary forms, with or without 7 modification, are permitted provided that the following conditions are met: 8 9 * Redistributions of source code must retain the above copyright notice, 10 this list of conditions and the following disclaimer. 11 * Redistributions in binary form must reproduce the above copyright notice, 12 this list of conditions and the following disclaimer in the documentation 13 and/or other materials provided with the distribution. 14 * Neither the name The Open Effects Association Ltd, nor the names of its 15 contributors may be used to endorse or promote products derived from this 16 software without specific prior written permission. 17 18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 22 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 25 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30 #include <iostream> 31 #include <fstream> 32 33 // ofx 34 #include "ofxCore.h" 35 #include "ofxImageEffect.h" 36 #include "ofxPixels.h" 37 38 // ofx host 39 #include "ofxhBinary.h" 40 #include "ofxhPropertySuite.h" 41 #include "ofxhClip.h" 42 #include "ofxhParam.h" 43 #include "ofxhMemory.h" 44 #include "ofxhImageEffect.h" 45 #include "ofxhPluginAPICache.h" 46 #include "ofxhPluginCache.h" 47 #include "ofxhHost.h" 48 #include "ofxhImageEffectAPI.h" 49 50 // my host 51 #include "hostDemoHostDescriptor.h" 52 #include "hostDemoEffectInstance.h" 53 #include "hostDemoClipInstance.h" 54 #include "hostDemoParamInstance.h" 55 56 namespace MyHost { 57 58 // 59 // MyIntegerInstance 60 // 61 MyIntegerInstance(MyEffectInstance * effect,const std::string & name,OFX::Host::Param::Descriptor & descriptor)62 MyIntegerInstance::MyIntegerInstance(MyEffectInstance* effect, 63 const std::string& name, 64 OFX::Host::Param::Descriptor& descriptor) 65 : OFX::Host::Param::IntegerInstance(descriptor), _effect(effect), _descriptor(descriptor) 66 { 67 } 68 get(int &)69 OfxStatus MyIntegerInstance::get(int&) 70 { 71 return kOfxStatErrMissingHostFeature; 72 } 73 get(OfxTime time,int &)74 OfxStatus MyIntegerInstance::get(OfxTime time, int&) 75 { 76 return kOfxStatErrMissingHostFeature; 77 } 78 set(int)79 OfxStatus MyIntegerInstance::set(int) 80 { 81 return kOfxStatErrMissingHostFeature; 82 } 83 set(OfxTime time,int)84 OfxStatus MyIntegerInstance::set(OfxTime time, int) { 85 return kOfxStatErrMissingHostFeature; 86 } 87 88 // 89 // MyDoubleInstance 90 // 91 MyDoubleInstance(MyEffectInstance * effect,const std::string & name,OFX::Host::Param::Descriptor & descriptor)92 MyDoubleInstance::MyDoubleInstance(MyEffectInstance* effect, 93 const std::string& name, 94 OFX::Host::Param::Descriptor& descriptor) 95 : OFX::Host::Param::DoubleInstance(descriptor), _effect(effect), _descriptor(descriptor) 96 { 97 } 98 get(double & d)99 OfxStatus MyDoubleInstance::get(double& d) 100 { 101 // values for the Basic OFX plugin to work 102 d = 2.0; 103 return kOfxStatOK; 104 } 105 get(OfxTime time,double & d)106 OfxStatus MyDoubleInstance::get(OfxTime time, double& d) 107 { 108 // values for the Basic OFX plugin to work 109 d = 2.0; 110 return kOfxStatOK; 111 } 112 set(double)113 OfxStatus MyDoubleInstance::set(double) 114 { 115 return kOfxStatErrMissingHostFeature; 116 } 117 set(OfxTime time,double)118 OfxStatus MyDoubleInstance::set(OfxTime time, double) 119 { 120 return kOfxStatErrMissingHostFeature; 121 } 122 derive(OfxTime time,double &)123 OfxStatus MyDoubleInstance::derive(OfxTime time, double&) 124 { 125 return kOfxStatErrMissingHostFeature; 126 } 127 integrate(OfxTime time1,OfxTime time2,double &)128 OfxStatus MyDoubleInstance::integrate(OfxTime time1, OfxTime time2, double&) 129 { 130 return kOfxStatErrMissingHostFeature; 131 } 132 133 // 134 // MyBooleanInstance 135 // 136 MyBooleanInstance(MyEffectInstance * effect,const std::string & name,OFX::Host::Param::Descriptor & descriptor)137 MyBooleanInstance::MyBooleanInstance(MyEffectInstance* effect, 138 const std::string& name, 139 OFX::Host::Param::Descriptor& descriptor) 140 : OFX::Host::Param::BooleanInstance(descriptor), _effect(effect), _descriptor(descriptor) 141 { 142 } 143 get(bool & b)144 OfxStatus MyBooleanInstance::get(bool& b) 145 { 146 b = true; 147 return kOfxStatOK; 148 } 149 get(OfxTime time,bool & b)150 OfxStatus MyBooleanInstance::get(OfxTime time, bool& b) 151 { 152 b = true; 153 return kOfxStatOK; 154 } 155 set(bool)156 OfxStatus MyBooleanInstance::set(bool) 157 { 158 return kOfxStatErrMissingHostFeature; 159 } 160 set(OfxTime time,bool)161 OfxStatus MyBooleanInstance::set(OfxTime time, bool) { 162 return kOfxStatErrMissingHostFeature; 163 } 164 165 // 166 // MyChoiceInteger 167 // 168 MyChoiceInstance(MyEffectInstance * effect,const std::string & name,OFX::Host::Param::Descriptor & descriptor)169 MyChoiceInstance::MyChoiceInstance(MyEffectInstance* effect, 170 const std::string& name, 171 OFX::Host::Param::Descriptor& descriptor) 172 : OFX::Host::Param::ChoiceInstance(descriptor), _effect(effect), _descriptor(descriptor) 173 { 174 } 175 get(int &)176 OfxStatus MyChoiceInstance::get(int&) 177 { 178 return kOfxStatErrMissingHostFeature; 179 } 180 get(OfxTime time,int &)181 OfxStatus MyChoiceInstance::get(OfxTime time, int&) 182 { 183 return kOfxStatErrMissingHostFeature; 184 } 185 set(int)186 OfxStatus MyChoiceInstance::set(int) 187 { 188 return kOfxStatErrMissingHostFeature; 189 } 190 set(OfxTime time,int)191 OfxStatus MyChoiceInstance::set(OfxTime time, int) 192 { 193 return kOfxStatErrMissingHostFeature; 194 } 195 196 // 197 // MyRGBAInstance 198 // 199 MyRGBAInstance(MyEffectInstance * effect,const std::string & name,OFX::Host::Param::Descriptor & descriptor)200 MyRGBAInstance::MyRGBAInstance(MyEffectInstance* effect, 201 const std::string& name, 202 OFX::Host::Param::Descriptor& descriptor) 203 : OFX::Host::Param::RGBAInstance(descriptor), _effect(effect), _descriptor(descriptor) 204 { 205 } 206 get(double &,double &,double &,double &)207 OfxStatus MyRGBAInstance::get(double&,double&,double&,double&) 208 { 209 return kOfxStatErrMissingHostFeature; 210 } 211 get(OfxTime time,double &,double &,double &,double &)212 OfxStatus MyRGBAInstance::get(OfxTime time, double&,double&,double&,double&) 213 { 214 return kOfxStatErrMissingHostFeature; 215 } 216 set(double,double,double,double)217 OfxStatus MyRGBAInstance::set(double,double,double,double) 218 { 219 return kOfxStatErrMissingHostFeature; 220 } 221 set(OfxTime time,double,double,double,double)222 OfxStatus MyRGBAInstance::set(OfxTime time, double,double,double,double) 223 { 224 return kOfxStatErrMissingHostFeature; 225 } 226 227 // 228 // MyRGBInstance 229 // 230 MyRGBInstance(MyEffectInstance * effect,const std::string & name,OFX::Host::Param::Descriptor & descriptor)231 MyRGBInstance::MyRGBInstance(MyEffectInstance* effect, 232 const std::string& name, 233 OFX::Host::Param::Descriptor& descriptor) 234 : OFX::Host::Param::RGBInstance(descriptor), _effect(effect), _descriptor(descriptor) 235 { 236 } 237 get(double &,double &,double &)238 OfxStatus MyRGBInstance::get(double&,double&,double&) 239 { 240 return kOfxStatErrMissingHostFeature; 241 } 242 get(OfxTime time,double &,double &,double &)243 OfxStatus MyRGBInstance::get(OfxTime time, double&,double&,double&) 244 { 245 return kOfxStatErrMissingHostFeature; 246 } 247 set(double,double,double)248 OfxStatus MyRGBInstance::set(double,double,double) 249 { 250 return kOfxStatErrMissingHostFeature; 251 } 252 set(OfxTime time,double,double,double)253 OfxStatus MyRGBInstance::set(OfxTime time, double,double,double) 254 { 255 return kOfxStatErrMissingHostFeature; 256 } 257 258 // 259 // MyDouble2DInstance 260 // 261 MyDouble2DInstance(MyEffectInstance * effect,const std::string & name,OFX::Host::Param::Descriptor & descriptor)262 MyDouble2DInstance::MyDouble2DInstance(MyEffectInstance* effect, 263 const std::string& name, 264 OFX::Host::Param::Descriptor& descriptor) 265 : OFX::Host::Param::Double2DInstance(descriptor), _effect(effect), _descriptor(descriptor) 266 { 267 } 268 get(double &,double &)269 OfxStatus MyDouble2DInstance::get(double&,double&) 270 { 271 return kOfxStatErrMissingHostFeature; 272 } 273 get(OfxTime time,double &,double &)274 OfxStatus MyDouble2DInstance::get(OfxTime time,double&,double&) 275 { 276 return kOfxStatErrMissingHostFeature; 277 } 278 set(double,double)279 OfxStatus MyDouble2DInstance::set(double,double) 280 { 281 return kOfxStatErrMissingHostFeature; 282 } 283 set(OfxTime time,double,double)284 OfxStatus MyDouble2DInstance::set(OfxTime time,double,double) 285 { 286 return kOfxStatErrMissingHostFeature; 287 } 288 289 // 290 // MyInteger2DInstance 291 // 292 MyInteger2DInstance(MyEffectInstance * effect,const std::string & name,OFX::Host::Param::Descriptor & descriptor)293 MyInteger2DInstance::MyInteger2DInstance(MyEffectInstance* effect, 294 const std::string& name, 295 OFX::Host::Param::Descriptor& descriptor) 296 : OFX::Host::Param::Integer2DInstance(descriptor), _effect(effect), _descriptor(descriptor) 297 { 298 } 299 get(int &,int &)300 OfxStatus MyInteger2DInstance::get(int&,int&) 301 { 302 return kOfxStatErrMissingHostFeature; 303 } 304 get(OfxTime time,int &,int &)305 OfxStatus MyInteger2DInstance::get(OfxTime time,int&,int&) 306 { 307 return kOfxStatErrMissingHostFeature; 308 } 309 set(int,int)310 OfxStatus MyInteger2DInstance::set(int,int) 311 { 312 return kOfxStatErrMissingHostFeature; 313 } 314 set(OfxTime time,int,int)315 OfxStatus MyInteger2DInstance::set(OfxTime time,int,int) 316 { 317 return kOfxStatErrMissingHostFeature; 318 } 319 320 // 321 // MyInteger2DInstance 322 // 323 MyPushbuttonInstance(MyEffectInstance * effect,const std::string & name,OFX::Host::Param::Descriptor & descriptor)324 MyPushbuttonInstance::MyPushbuttonInstance(MyEffectInstance* effect, 325 const std::string& name, 326 OFX::Host::Param::Descriptor& descriptor) 327 : OFX::Host::Param::PushbuttonInstance(descriptor), _effect(effect), _descriptor(descriptor) 328 { 329 } 330 331 } 332