Table of Contents

Method ToggleEnabledAsync

Namespace
OBSStudioClient.Model
Assembly
OBSClient.dll

ToggleEnabledAsync(CancellationToken)

Enables the filter when it is disabled, and disables it when it is enabled, and returns when the model shows it.

public Task<bool> ToggleEnabledAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token that ends the wait. A change that was not sent yet is not sent.

Returns

Task<bool>

A task that completes with the value that IsEnabled was set to.

Remarks

OBS Studio has no request that toggles a filter. When its turn has come, after every change that you asked for before it has been answered, the change asks OBS Studio whether the filter is enabled, and sets the opposite: two calls make two toggles, in the order in which you asked for them. See SetEnabledAsync(bool, CancellationToken) for the order of changes and the wait.

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. Nothing was changed.

ObsNotReadyException

OBS Studio is changing its scene collection, or did so after the call, or did not say in time whether the filter is enabled. 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. Do not send the change again.

ObsResponseException

OBS Studio refused the change.