<!--
{
  "availability" : [
    "FxPlug: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "professional_video_applications",
  "identifier" : "/documentation/professional_video_applications/FxCustomParameterActionAPI_v4",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Professional Video Applications"
    ],
    "preciseIdentifier" : "c:objc(pl)FxCustomParameterActionAPI_v4"
  },
  "title" : "FxCustomParameterActionAPI_v4"
}
-->

# FxCustomParameterActionAPI_v4

Defines the methods the host application provides to support a custom parameter view.

```
protocol FxCustomParameterActionAPI_v4
```

## Overview

Because custom parameter views can get user events at any time, this protocol provides methods to prepare the host application for parameter changes or other actions at arbitrary times.

Use the [`startAction(_:)`](/documentation/professional_video_applications/FxCustomParameterActionAPI_v4/startAction(_:)) and [`endAction(_:)`](/documentation/professional_video_applications/FxCustomParameterActionAPI_v4/endAction(_:)) commands only when the host application didn’t call your code. For example, in a custom view, the OS directly asks your view to redraw when it needs updating. At this point, the application has no point of reference for interacting with your plug-in, so you must tell it to start the communication by calling [`startAction(_:)`](/documentation/professional_video_applications/FxCustomParameterActionAPI_v4/startAction(_:)). In the past, if you called [`startAction(_:)`](/documentation/professional_video_applications/FxCustomParameterActionAPI_v4/startAction(_:)) when the host called your plug-in, there were no harmful side effects. Starting with FxPlug 4, calling [`startAction(_:)`](/documentation/professional_video_applications/FxCustomParameterActionAPI_v4/startAction(_:)) when the host calls your plug-in can cause hangs in the host application. Call [`startAction(_:)`](/documentation/professional_video_applications/FxCustomParameterActionAPI_v4/startAction(_:)) if you’re executing any code in a block that you created, such as calling <doc://com.apple.documentation/documentation/Dispatch/dispatch_async>.

You mainly need to use [`startAction(_:)`](/documentation/professional_video_applications/FxCustomParameterActionAPI_v4/startAction(_:)) and [`endAction(_:)`](/documentation/professional_video_applications/FxCustomParameterActionAPI_v4/endAction(_:)) when handling custom <doc://com.apple.documentation/documentation/AppKit/NSView> events for custom parameters or when running code in a dispatch block that your plug-in created.

It is NOT safe to set or get parameter values at arbitrary times outside of a [`startAction(_:)`](/documentation/professional_video_applications/FxCustomParameterActionAPI_v4/startAction(_:)) and [`endAction(_:)`](/documentation/professional_video_applications/FxCustomParameterActionAPI_v4/endAction(_:)) pair. For example, when a custom parameter view receives a `keyDown:positionY:keyPressed:modifiers:forceUpdate:didHandle:time:` event, it may want to change its parameter value. It then calls the following sequence:

```swift
let actionAPI = _apiManager!.api(for: FxCustomParameterActionAPI_v4.self) as! FxCustomParameterActionAPI_v4
let time = actionAPI.currentTime

actionAPI.startAction(_:self)
let settingAPI = _apiManager!.api(for: FxParameterSettingAPI_v5.self) as! FxParameterSettingAPI_v5
settingAPI.setCustomParameterValue(myObject, toParameter: myParameterID, at: time)
actionAPI.endAction(_:self)
```

## Topics

### Instance Methods

[`func currentTime() -> CMTime`](/documentation/professional_video_applications/FxCustomParameterActionAPI_v4/currentTime())

Returns the current time, expressed as a rational time.

[`func startAction(Any!)`](/documentation/professional_video_applications/FxCustomParameterActionAPI_v4/startAction(_:))

Prepares the host to access parameters.

[`func endAction(Any!)`](/documentation/professional_video_applications/FxCustomParameterActionAPI_v4/endAction(_:))

Tells the host application that the plug-in is done accessing parameters.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)