Method SetEnabledAsync
- Namespace
- OBSStudioClient.Model
- Assembly
- OBSClient.dll
SetEnabledAsync(bool, CancellationToken)
Enables or disables the filter, and returns when the model shows it.
public Task SetEnabledAsync(bool value, CancellationToken cancellationToken = default)
Parameters
valueboolTrue to enable the filter, false to disable it.
cancellationTokenCancellationTokenA token that ends the wait. A change that was not sent yet is not sent.
Returns
- Task
A task that completes when IsEnabled is
value, or when the model has been read again after the events did not show it.
Remarks
The changes that you ask for are made one at a time, in the order in which you asked for them, and each returns when the model shows it: see SetEnabledAsync(bool, CancellationToken) for the order of changes and the wait. The change is sent with the name that the filter has when its turn has come, so a rename that you asked for before it does not send it to another filter.
Exceptions
- ObsRemovedException
The filter was removed, or its source was destroyed (the filters of a source that OBS Studio removed and keeps alive can still be changed).
- ObsNotConnectedException
There is no connection to OBS Studio, or the connection that the change was asked for on has ended and another was made. 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 it: the events did not show it in time, and the model could not be read again in time. Do not send the change again.
- ObsResponseException
OBS Studio refused the change.