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
settingsobjectThe 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.overlayboolTrue 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.
cancellationTokenCancellationTokenA 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
settingsis 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).