Method CreateFilterAsync
- Namespace
- OBSStudioClient.Model
- Assembly
- OBSClient.dll
CreateFilterAsync(string, string, object?, CancellationToken)
Adds a filter to the scene or the input (on top of its filters), and returns it when the model shows it.
public Task<ObsFilter> CreateFilterAsync(string name, string kind, object? settings = null, CancellationToken cancellationToken = default)
Parameters
namestringThe name of the new filter: it can not be the name of another filter of this source.
kindstringThe kind of filter, as OBS Studio calls it: for example
color_filter_v2(the plain client lists them:obs.Client.GetSourceFilterKindList()).settingsobjectThe settings that the filter starts with, for example
new { gamma = 0.5 }, or null for the defaults of the kind.cancellationTokenCancellationTokenA token that ends the wait. A change that was not sent yet is not sent.
Returns
Remarks
See SetEnabledAsync(bool, CancellationToken) for the order of changes and the wait. A source that OBS Studio removed and keeps alive (Detached) can still be given a filter; one that was destroyed can not.
Exceptions
- ArgumentException
nameorkindis empty, orsettingsis not an object.- ObsNameInUseException
The source has a filter with that name already. Nothing was changed.
- ObsRemovedException
The source was destroyed.
- ObsNotConnectedException
There is no connection to OBS Studio. Nothing was changed.
- ObsNotReadyException
OBS Studio is changing its scene collection, or did so after the call. Nothing was changed.
- ObsUnknownOutcomeException
OBS Studio did not answer in time, or the connection ended: it is not known whether it made the change.
- ObsNotConfirmedException
OBS Studio made the change, and the model does not show the filter. Do not send the change again.
- ObsResponseException
OBS Studio refused the change (it does not know the kind, for example).