Table of Contents

Method SetDurationAsync

Namespace
OBSStudioClient.Model
Assembly
OBSClient.dll

SetDurationAsync(TimeSpan, CancellationToken)

Sets how long the transitions take, and returns when the model shows it.

public Task SetDurationAsync(TimeSpan duration, CancellationToken cancellationToken = default)

Parameters

duration TimeSpan

The duration, from 50 ms to 20 seconds (a part of a millisecond is rounded).

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 Duration is the duration.

Remarks

The duration is the same for all the transitions that have one, and OBS Studio takes it while the current transition is a cut too (it uses it when another one becomes the current one). It sends an event only when the duration changed. See SetEnabledAsync(bool, CancellationToken) for the order of changes and the wait.

Exceptions

ArgumentOutOfRangeException

duration is less than 50 ms or more than 20 seconds. Nothing was sent.

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 it: the events did not show it in time. Do not send the change again.

ObsResponseException

OBS Studio refused the change.