Method SetIndexAsync
- Namespace
- OBSStudioClient.Model
- Assembly
- OBSClient.dll
SetIndexAsync(int, CancellationToken)
Moves the filter to a position among the filters of its source, and returns when the model shows it.
public Task SetIndexAsync(int index, CancellationToken cancellationToken = default)
Parameters
indexintThe new position: 0 is the first, which is applied first, and the number of filters minus one is the last.
cancellationTokenCancellationTokenA token that ends the wait. A change that was not sent yet is not sent.
Returns
Remarks
The filters between the old and the new position move by one place, and OBS Studio says so in one event that lists them all: the model takes the positions from it. See SetEnabledAsync(bool, CancellationToken) for the order of changes and the wait.
Exceptions
- ArgumentOutOfRangeException
indexis negative (thrown at once), or is not a position among the filters of the source (the call ends with it, after the filter is known to be there).- ObsRemovedException
The filter was removed, or its source was destroyed (the filters of a source that OBS Studio removed and keeps alive can still be 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 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.