Table of Contents

Method RenameAsync

Namespace
OBSStudioClient.Model
Assembly
OBSClient.dll

RenameAsync(string, CancellationToken)

Gives the scene another name, and returns when the model shows it.

public Task RenameAsync(string name, CancellationToken cancellationToken = default)

Parameters

name string

The new name: it can not be the name of another scene. With OBS Studio that has obs-websocket 5.6 or older it can not be the name of an input either. The names are case sensitive.

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 Name is name.

Remarks

See SetEnabledAsync(bool, CancellationToken) for the order of changes and the wait.

Exceptions

ArgumentException

name is empty.

InvalidOperationException

The scene is a group (IsGroup): obs-websocket can not rename a group (SetSceneName refuses a group, and a group is not an input), so rename it in OBS Studio. Nothing was changed.

ObsNameInUseException

The name is taken, also when it is the name that the scene has already. Nothing was changed.

ObsRemovedException

The scene was removed.

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. Do not send the change again.

ObsResponseException

OBS Studio refused the change.