Method CreateAsync
- Namespace
- OBSStudioClient.Model
- Assembly
- OBSClient.dll
CreateAsync(string, CancellationToken)
Makes a scene collection, which OBS Studio loads at once, and returns when the model shows it completely.
public Task CreateAsync(string name, CancellationToken cancellationToken = default)
Parameters
namestringThe name of the new scene collection: it can not be the name of another scene collection. The names are case sensitive.
cancellationTokenCancellationTokenA token that ends the wait. A change that was not sent yet is not sent.
Returns
- Task
A task that completes when Names lists the collection, Current is another collection than before the call (OBS Studio loaded the new one) and the model has read it.
Remarks
The collection has one scene, named "Scene", and nothing else (measured with OBS Studio 33.0.0). What the application holds of the collection that was loaded before is gone, as it is for SetCurrentAsync(string, CancellationToken), which also says how long the call waits.
Exceptions
- ArgumentException
nameis empty.- ObsNameInUseException
There is a scene collection with that name. Nothing was 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. Nothing was changed.
- ObsUnknownOutcomeException
OBS Studio did not answer in time, or the connection ended: it is not known whether it made the collection.
- ObsNotConfirmedException
OBS Studio said that it made the collection, and the model does not list it: OBS Studio did not make it. Do not send the change again.
- ObsResponseException
OBS Studio refused the change.