Table of Contents

Method SetSettingsAsync

Namespace
OBSStudioClient.Model
Assembly
OBSClient.dll

SetSettingsAsync(object, bool, CancellationToken)

Changes the settings of the current transition, and returns when OBS Studio has made the change.

public Task SetSettingsAsync(object settings, bool overlay = true, CancellationToken cancellationToken = default)

Parameters

settings object

The settings to change: an object (for example new { direction = "left" }), a dictionary, or a JsonElement. What the fields are called depends on the kind of the transition.

overlay bool

True to change the settings that are given and leave the others as they are; false to take all the settings back to their defaults first.

cancellationToken CancellationToken

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

Returns

Task

A task that completes when OBS Studio has answered that it made the change.

Remarks

Nothing in the model shows the settings, so the call has nothing to wait for but the answer of OBS Studio: ask what it holds with GetSettingsAsync(CancellationToken). OBS Studio does not check the settings (see SetSettingsAsync(object, bool, CancellationToken)).

Exceptions

ArgumentException

settings is not an object, or can not be written as JSON.

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.

ObsResponseException

OBS Studio refused the change: the current transition has no settings (ErrorCode is ResourceNotConfigurable; measured for a cut and a fade).