1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
/*
Software License :
Copyright (c) 2007-2009, The Open Effects Association Ltd. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name The Open Effects Association Ltd, nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef OFXH_PARAM_H
#define OFXH_PARAM_H
#include <string>
#include <map>
#include <list>
#include <cstdarg>
//ofx
#include "ofxParam.h"
//ofxh
#include "ofxhPropertySuite.h"
namespace OFX {
namespace Host {
namespace Param {
/// fetch the param suite
const void *GetSuite(int version);
bool isColourParam(const std::string ¶mType);
bool isIntParam(const std::string ¶mType);
/// is this a standard type
bool isStandardType(const std::string &type);
/// base class for all params
class Base {
private:
Base();
protected:
std::string _paramName;
std::string _paramType;
Property::Set _properties;
public:
Base(const std::string &name, const std::string &type);
Base(const std::string &name, const std::string &type, const Property::Set &properties);
virtual ~Base();
/// grab a handle on the parameter for passing to the C API
OfxParamHandle getHandle() const;
virtual bool verifyMagic() { return true; }
/// grab a handle on the properties of this parameter for the C api
OfxPropertySetHandle getPropHandle() const;
const Property::Set &getProperties() const;
Property::Set &getProperties();
const std::string &getType() const;
const std::string &getName() const;
const std::string &getParentName() const;
const std::string &getLabel() const;
const std::string &getShortLabel() const;
const std::string &getLongLabel() const;
const std::string &getScriptName() const;
const std::string &getDoubleType() const;
const std::string &getDefaultCoordinateSystem() const;
const std::string &getCacheInvalidation() const;
const std::string &getHint() const;
bool getEnabled() const;
bool getCanUndo() const;
bool getSecret() const;
bool getIsPersistant() const;
bool getEvaluateOnChange() const;
bool getCanAnimate() const;
};
/// the Descriptor of a plugin parameter
class Descriptor : public Base {
Descriptor();
public:
/// make a parameter, with the given type and name
Descriptor(const std::string &type, const std::string &name);
/// add standard param props, will call the below
void addStandardParamProps(const std::string &type);
/// add standard properties to a params that can take an interact
void addInteractParamProps(const std::string &type);
/// add standard properties to a value holding param
void addValueParamProps(const std::string &type, Property::TypeEnum valueType, int dim);
/// add standard properties to a value holding param
void addNumericParamProps(const std::string &type, Property::TypeEnum valueType, int dim);
};
/// base class to the param set instance and param set descriptor
class BaseSet {
public:
virtual ~BaseSet();
/// obtain a handle on this set for passing to the C api
OfxParamSetHandle getParamSetHandle() const;
/// get the property handle that lives with the set
/// The plugin descriptor/instance that derives from
/// this will provide this.
virtual Property::Set &getParamSetProps() = 0;
};
/// a set of parameters
class SetDescriptor : public BaseSet {
std::map<std::string, Descriptor*> _paramMap;
std::list<Descriptor *> _paramList;
/// CC doesn't exist
SetDescriptor(const SetDescriptor &);
public:
/// default ctor
SetDescriptor();
/// dtor
virtual ~SetDescriptor();
/// get the map of params
const std::map<std::string, Descriptor*> &getParams() const;
/// get the list of params
const std::list<Descriptor *> &getParamList() const;
/// define a param
virtual Descriptor *paramDefine(const char *paramType,
const char *name);
/// add a param in
virtual void addParam(const std::string &name, Descriptor *p);
};
// forward declare
class SetInstance;
/// the description of a plugin parameter
class Instance : public Base, protected Property::NotifyHook {
Instance();
protected:
SetInstance* _paramSetInstance;
Instance* _parentInstance;
public:
virtual ~Instance();
/// make a parameter, with the given type and name
explicit Instance(Descriptor& descriptor, Param::SetInstance* instance = 0);
// OfxStatus instanceChangedAction(const std::string &why,
// OfxTime time,
// double renderScaleX,
// double renderScaleY);
// get the param instance
OFX::Host::Param::SetInstance* getParamSetInstance() { return _paramSetInstance; }
// set/get parent instance
void setParentInstance(Instance* instance);
Instance* getParentInstance();
// copy one parameter to another, with a range (NULL means to copy all animation)
virtual OfxStatus copyFrom(const Instance &instance, OfxTime offset, const OfxRangeD* range);
// callback which should set enabled state as appropriate
virtual void setEnabled();
// callback which should set secret state as appropriate
virtual void setSecret();
/// callback which should update label
virtual void setLabel();
/// callback which should set range
virtual void setRange();
/// callback which should set display range
virtual void setDisplayRange();
/// callback which should set evaluate on change
virtual void setEvaluateOnChange();
// va list calls below turn the var args (oh what a mistake)
// suite functions into virtual function calls on instances
// they are not to be overridden by host implementors by
// by the various typeed param instances so that they can
// deconstruct the var args lists
/// get a value, implemented by instances to deconstruct var args
virtual OfxStatus getV(va_list arg);
/// get a value, implemented by instances to deconstruct var args
virtual OfxStatus getV(OfxTime time, va_list arg);
/// set a value, implemented by instances to deconstruct var args
virtual OfxStatus setV(va_list arg);
/// key a value, implemented by instances to deconstruct var args
virtual OfxStatus setV(OfxTime time, va_list arg);
/// derive a value, implemented by instances to deconstruct var args
virtual OfxStatus deriveV(OfxTime time, va_list arg);
/// integrate a value, implemented by instances to deconstruct var args
virtual OfxStatus integrateV(OfxTime time1, OfxTime time2, va_list arg);
/// overridden from Property::NotifyHook
virtual void notify(const std::string &name, bool single, int num) OFX_EXCEPTION_SPEC;
};
class KeyframeParam {
public:
virtual OfxStatus getNumKeys(unsigned int &nKeys) const ;
virtual OfxStatus getKeyTime(int nth, OfxTime& time) const ;
virtual OfxStatus getKeyIndex(OfxTime time, int direction, int & index) const ;
virtual OfxStatus deleteKey(OfxTime time) ;
virtual OfxStatus deleteAllKeys() ;
virtual ~KeyframeParam() {
}
};
class GroupInstance : public Instance {
protected:
std::vector<Param::Instance*> _children;
public:
GroupInstance(Descriptor& descriptor, Param::SetInstance* instance = 0) : Instance(descriptor,instance) {}
void setChildren(std::vector<Param::Instance*> children);
const std::vector<Param::Instance*> &getChildren() const;
};
class PageInstance : public Instance {
public:
PageInstance(Descriptor& descriptor, Param::SetInstance* instance = 0) : Instance(descriptor,instance) {}
const std::map<int,Param::Instance*> &getChildren() const;
protected :
mutable std::map<int,Param::Instance*> _children; // if set in a notify hook, this need not be mutable
};
class IntegerInstance : public Instance, public KeyframeParam {
public:
IntegerInstance(Descriptor& descriptor, Param::SetInstance* instance = 0) : Instance(descriptor,instance) {}
// Deriving implementatation needs to overide these
virtual OfxStatus get(int&) = 0;
virtual OfxStatus get(OfxTime time, int&) = 0;
virtual OfxStatus set(int) = 0;
virtual OfxStatus set(OfxTime time, int) = 0;
// probably derived class does not need to implement, default is an approximation
virtual OfxStatus derive(OfxTime time, int&) ;
virtual OfxStatus integrate(OfxTime time1, OfxTime time2, int&) ;
/// implementation of var args function
virtual OfxStatus getV(va_list arg);
/// implementation of var args function
virtual OfxStatus getV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus setV(va_list arg);
/// implementation of var args function
virtual OfxStatus setV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus deriveV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus integrateV(OfxTime time1, OfxTime time2, va_list arg);
};
class ChoiceInstance : public Instance, public KeyframeParam {
public:
ChoiceInstance(Descriptor& descriptor, Param::SetInstance* instance = 0);
// callback which should set option as appropriate
virtual void setOption(int num);
// Deriving implementatation needs to overide these
virtual OfxStatus get(int&) = 0;
virtual OfxStatus get(OfxTime time, int&) = 0;
virtual OfxStatus set(int) = 0;
virtual OfxStatus set(OfxTime time, int) = 0;
/// implementation of var args function
virtual OfxStatus getV(va_list arg);
/// implementation of var args function
virtual OfxStatus getV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus setV(va_list arg);
/// implementation of var args function
virtual OfxStatus setV(OfxTime time, va_list arg);
/// overridden from Instance
virtual void notify(const std::string &name, bool single, int num) OFX_EXCEPTION_SPEC;
};
class DoubleInstance : public Instance, public KeyframeParam {
public:
DoubleInstance(Descriptor& descriptor, Param::SetInstance* instance = 0) : Instance(descriptor,instance) {}
// Deriving implementatation needs to overide these
virtual OfxStatus get(double&) = 0;
virtual OfxStatus get(OfxTime time, double&) = 0;
virtual OfxStatus set(double) = 0;
virtual OfxStatus set(OfxTime time, double) = 0;
virtual OfxStatus derive(OfxTime time, double&) = 0;
virtual OfxStatus integrate(OfxTime time1, OfxTime time2, double&) = 0;
/// implementation of var args function
virtual OfxStatus getV(va_list arg);
/// implementation of var args function
virtual OfxStatus getV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus setV(va_list arg);
/// implementation of var args function
virtual OfxStatus setV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus deriveV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus integrateV(OfxTime time1, OfxTime time2, va_list arg);
};
class BooleanInstance : public Instance, public KeyframeParam {
public:
BooleanInstance(Descriptor& descriptor, Param::SetInstance* instance = 0) : Instance(descriptor,instance) {}
// Deriving implementatation needs to overide these
virtual OfxStatus get(bool&) = 0;
virtual OfxStatus get(OfxTime time, bool&) = 0;
virtual OfxStatus set(bool) = 0;
virtual OfxStatus set(OfxTime time, bool) = 0;
/// implementation of var args function
virtual OfxStatus getV(va_list arg);
/// implementation of var args function
virtual OfxStatus getV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus setV(va_list arg);
/// implementation of var args function
virtual OfxStatus setV(OfxTime time, va_list arg);
};
class RGBAInstance : public Instance, public KeyframeParam {
public:
RGBAInstance(Descriptor& descriptor, Param::SetInstance* instance = 0) : Instance(descriptor,instance) {}
// Deriving implementatation needs to overide these
virtual OfxStatus get(double&,double&,double&,double&) = 0;
virtual OfxStatus get(OfxTime time, double&,double&,double&,double&) = 0;
virtual OfxStatus set(double,double,double,double) = 0;
virtual OfxStatus set(OfxTime time, double,double,double,double) = 0;
// derived class does not need to implement, default is an approximation
virtual OfxStatus derive(OfxTime time, double&,double&,double&,double&) ;
virtual OfxStatus integrate(OfxTime time1, OfxTime time2, double&,double&,double&,double&) ;
/// implementation of var args function
virtual OfxStatus getV(va_list arg);
/// implementation of var args function
virtual OfxStatus getV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus setV(va_list arg);
/// implementation of var args function
virtual OfxStatus setV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus deriveV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus integrateV(OfxTime time1, OfxTime time2, va_list arg);
};
class RGBInstance : public Instance, public KeyframeParam {
public:
RGBInstance(Descriptor& descriptor, Param::SetInstance* instance = 0) : Instance(descriptor,instance) {}
// Deriving implementatation needs to overide these
virtual OfxStatus get(double&,double&,double&) = 0;
virtual OfxStatus get(OfxTime time, double&,double&,double&) = 0;
virtual OfxStatus set(double,double,double) = 0;
virtual OfxStatus set(OfxTime time, double,double,double) = 0;
// derived class does not need to implement, default is an approximation
virtual OfxStatus derive(OfxTime time, double&,double&,double&) ;
virtual OfxStatus integrate(OfxTime time1, OfxTime time2, double&,double&,double&) ;
/// implementation of var args function
virtual OfxStatus getV(va_list arg);
/// implementation of var args function
virtual OfxStatus getV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus setV(va_list arg);
/// implementation of var args function
virtual OfxStatus setV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus deriveV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus integrateV(OfxTime time1, OfxTime time2, va_list arg);
};
class Double2DInstance : public Instance, public KeyframeParam {
public:
Double2DInstance(Descriptor& descriptor, Param::SetInstance* instance = 0) : Instance(descriptor,instance) {}
// Deriving implementatation needs to overide these
virtual OfxStatus get(double&,double&) = 0;
virtual OfxStatus get(OfxTime time, double&,double&) = 0;
virtual OfxStatus set(double,double) = 0;
virtual OfxStatus set(OfxTime time, double,double) = 0;
// derived class does not need to implement, default is an approximation
virtual OfxStatus derive(OfxTime time, double&,double&) ;
virtual OfxStatus integrate(OfxTime time1, OfxTime time2, double&,double&) ;
/// implementation of var args function
virtual OfxStatus getV(va_list arg);
/// implementation of var args function
virtual OfxStatus getV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus setV(va_list arg);
/// implementation of var args function
virtual OfxStatus setV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus deriveV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus integrateV(OfxTime time1, OfxTime time2, va_list arg);
};
class Integer2DInstance : public Instance, public KeyframeParam {
public:
Integer2DInstance(Descriptor& descriptor, Param::SetInstance* instance = 0) : Instance(descriptor,instance) {}
// Deriving implementatation needs to overide these
virtual OfxStatus get(int&,int&) = 0;
virtual OfxStatus get(OfxTime time, int&,int&) = 0;
virtual OfxStatus set(int,int) = 0;
virtual OfxStatus set(OfxTime time, int,int) = 0;
// derived class does not need to implement, default is an approximation
virtual OfxStatus derive(OfxTime time, int&,int&) ;
virtual OfxStatus integrate(OfxTime time1, OfxTime time2, int&,int&) ;
/// implementation of var args function
virtual OfxStatus getV(va_list arg);
/// implementation of var args function
virtual OfxStatus getV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus setV(va_list arg);
/// implementation of var args function
virtual OfxStatus setV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus deriveV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus integrateV(OfxTime time1, OfxTime time2, va_list arg);
};
class Double3DInstance : public Instance , public KeyframeParam{
public:
Double3DInstance(Descriptor& descriptor, Param::SetInstance* instance = 0) : Instance(descriptor,instance) {}
// Deriving implementatation needs to overide these
virtual OfxStatus get(double&,double&,double&) = 0;
virtual OfxStatus get(OfxTime time, double&,double&,double&) = 0;
virtual OfxStatus set(double,double,double) = 0;
virtual OfxStatus set(OfxTime time, double,double,double) = 0;
// derived class does not need to implement, default is an approximation
virtual OfxStatus derive(OfxTime time, double&,double&,double&) ;
virtual OfxStatus integrate(OfxTime time1, OfxTime time2, double&,double&,double&) ;
/// implementation of var args function
virtual OfxStatus getV(va_list arg);
/// implementation of var args function
virtual OfxStatus getV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus setV(va_list arg);
/// implementation of var args function
virtual OfxStatus setV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus deriveV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus integrateV(OfxTime time1, OfxTime time2, va_list arg);
};
class Integer3DInstance : public Instance, public KeyframeParam {
public:
Integer3DInstance(Descriptor& descriptor, Param::SetInstance* instance = 0) : Instance(descriptor,instance) {}
virtual OfxStatus get(int&,int&,int&) = 0;
virtual OfxStatus get(OfxTime time, int&,int&,int&) = 0;
virtual OfxStatus set(int,int,int) = 0;
virtual OfxStatus set(OfxTime time, int,int,int) = 0;
// derived class does not need to implement, default is an approximation
virtual OfxStatus derive(OfxTime time, int&,int&,int&) ;
virtual OfxStatus integrate(OfxTime time1, OfxTime time2, int&,int&,int&) ;
/// implementation of var args function
virtual OfxStatus getV(va_list arg);
/// implementation of var args function
virtual OfxStatus getV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus setV(va_list arg);
/// implementation of var args function
virtual OfxStatus setV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus deriveV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus integrateV(OfxTime time1, OfxTime time2, va_list arg);
};
class StringInstance : public Instance, public KeyframeParam {
std::string _returnValue; ///< location to hold temporary return value. Should delegate this to implementation!!!
public:
StringInstance(Descriptor& descriptor, Param::SetInstance* instance = 0) : Instance(descriptor,instance) {}
virtual OfxStatus get(std::string &) = 0;
virtual OfxStatus get(OfxTime time, std::string &) = 0;
virtual OfxStatus set(const char*) = 0;
virtual OfxStatus set(OfxTime time, const char*) = 0;
/// implementation of var args function
/// Be careful: the char* is only valid until next API call
/// see http://openfx.sourceforge.net/Documentation/1.3/ofxProgrammingReference.html#ArchitectureStrings
virtual OfxStatus getV(va_list arg);
/// implementation of var args function
/// Be careful: the char* is only valid until next API call
/// see http://openfx.sourceforge.net/Documentation/1.3/ofxProgrammingReference.html#ArchitectureStrings
virtual OfxStatus getV(OfxTime time, va_list arg);
/// implementation of var args function
virtual OfxStatus setV(va_list arg);
/// implementation of var args function
virtual OfxStatus setV(OfxTime time, va_list arg);
};
class CustomInstance : public StringInstance {
public:
CustomInstance(Descriptor& descriptor, Param::SetInstance* instance = 0) : StringInstance(descriptor,instance) {}
};
class PushbuttonInstance : public Instance, public KeyframeParam {
public:
PushbuttonInstance(Descriptor& descriptor, Param::SetInstance* instance = 0) : Instance(descriptor,instance) {}
};
/// A set of parameters
///
/// As we are the owning object we delete the params inside ourselves. It was tempting
/// to make params autoref objects and have shared ownership with the client code
/// but that adds complexity for no strong gain.
class SetInstance : public BaseSet {
protected:
std::map<std::string, Instance*> _params; ///< params by name
std::list<Instance *> _paramList; ///< params list
public :
/// ctor
///
/// The propery set being passed in belongs to the owning
/// plugin instance.
explicit SetInstance();
/// dtor.
virtual ~SetInstance();
/// get the params
const std::map<std::string, Instance*> &getParams() const;
/// get the params
const std::list<Instance*> &getParamList() const;
// get the param
Instance* getParam(const std::string &name) const {
std::map<std::string,Instance*>::const_iterator it = _params.find(name);
if(it!=_params.end())
return it->second;
else
return 0;
}
/// The inheriting plugin instance needs to set this up to deal with
/// plug-ins changing their own values.
virtual void paramChangedByPlugin(Param::Instance *param) = 0;
/// add a param
virtual OfxStatus addParam(const std::string& name, Instance* instance);
/// make a parameter instance
///
/// Client host code needs to implement this
virtual Instance* newParam(const std::string& name, Descriptor& Descriptor) = 0;
/// Triggered when the plug-in calls OfxParameterSuiteV1::paramEditBegin
///
/// Client host code needs to implement this
virtual OfxStatus editBegin(const std::string& name) = 0;
/// Triggered when the plug-in calls OfxParameterSuiteV1::paramEditEnd
///
/// Client host code needs to implement this
virtual OfxStatus editEnd() = 0;
};
}
}
}
#endif // OFXH_PARAM_H