Hi Bob,
In order for custom parameters to appear in Final Cut's parameter view, your plugin must create their UI. Final Cut doesn't know what's inside the parameter, so we can't create the UI like we can for standard parameter types.
To supply the parameter UI, first declare that your plugin formally supports the FxCustomParameterViewHost protocol:
@interface MyPlugin : NSObject <FxFilter, FxCustomParameterViewHost> {}
Next, set the CustomUI flag on your parameter:
[parmsApi addCustomParameterWithName: @"MyValue" parmId: kParamID_MyValue
defaultValue: [NSNumber numberWithInt:130]
parmFlags: kFxParameterFlag_CUSTOM_UI];
Finally, implement the method that creates a UI view for your custom parameter:
@implementation MyPlugin
- (NSView *)createViewForParm:(UInt32)parmId {
if (parmId == kParamID_MyValue)
return [[MyCustomView alloc] init];
return nil;
}
@end
In order for custom parameters to appear in XML, the parameter value must conform to the NSCoding protocol. In your example, you are using NSNumbers, so that should work. If you implement your own parameter class, you must make sure that the class implements the NSCoding protocol.
You might want to check out the SimpleMatte example in the FxPlug SDK. That plugin demonstrates the use of a custom parameter.
- Paul
On Aug 9, 2010, at 7:44 AM, Robert Monaghan wrote:
Hi Everyone..
Is there a secret trick to get:
[parmsApi addCustomParameterWithName: @"MyValue" parmId: kParamID_MyValue
defaultValue: [NSNumber numberWithInt:130]
parmFlags: kFxParameterFlag_DEFAULT];
to work in FxPlug?
Every other type of parameter works just fine. I haven't been able to get this one to show up at all.
When I export some XML from Final Cut Pro all of the other controls/paramenters show up, except the ones
created with ... (I've tried all sorts of flags, but nothing changes..)
Any suggestions??
bob.