I’m developing a plugin for Final Cut Pro, and need help on the UI part. FCPX plugins are swift application bundled in a FxPlug wrapper. The UI is made of parameter views packed together, custom parameter views can be created in order to display a logo or a custom element:
I followed the official Apple documentation about FxPlug and managed to get regular parameters working (sliders, integers, etc…). Easy.
However, I can’t get a custom parameter working. Parameters needs to be instantiate in the addParameters
method:
func addParameters() throws {
let paramAPI = _apiManager!.api(for: FxParameterCreationAPI_v5.self) as! FxParameterCreationAPI_v5
// Create the custom parameter
paramAPI.addCustomParameter(withName: "Logo", parameterID: 2, defaultValue: NSData(), parameterFlags: FxParameterFlags(kFxParameterFlag_CUSTOM_UI))
}
I can then link the custom parameter with a NSView in the createView
method:
func createView(forParameterID parameterID: UInt32) -> NSView? {
if parameterID == 2 {
// Instantiate custom view with the initial frame size
let myCustomView = CustomView(frame: NSRect(x: 0, y: 0, width: 200, height: 200))
// Return the view to be managed by the host application
return myCustomView
}
// Return nil for any parameter IDs without custom view
return nil
}
My CustomView is a simple Cocoa class (for testing purpose):
import Cocoa
import AppKit
class SimpleTestView: NSView {
override func draw(_ dirtyRect: NSRect) {
super.draw(dirtyRect)
}
}
I’m running fcpxstudio.com on which I sell Final Cut Pro plugins, I was looking for a freelancer to complete the mission but can’t find anyone qualified for the job. Any help on how to add a custom parameter on the Apple FxPlug template (swift) or offers to complete the job are welcome!