Table of Contents

Method GetParameterAsync

Namespace
OBSStudioClient.Model
Assembly
OBSClient.dll

GetParameterAsync(string, string, CancellationToken)

Asks OBS Studio for a parameter of the configuration of the profile that is current: what it is now, and what OBS Studio gives it when nobody set it.

public Task<ObsProfileParameter> GetParameterAsync(string category, string name, CancellationToken cancellationToken = default)

Parameters

category string

The category (the section of the configuration file of the profile): Video, SimpleOutput, AdvOut, Output, ...

name string

The name of the parameter in its category: BaseCX, FilePath, ...

cancellationToken CancellationToken

A token that ends the wait. A request that was not sent yet is not sent.

Returns

Task<ObsProfileParameter>

The parameter. It has no value (HasValue is false) when nobody set it and OBS Studio has no default for it, and that is no error: OBS Studio does not say which parameters exist.

Remarks

OBS Studio keeps what it does not have a setting window for, and the settings that the model has a call for (GetVideoSettingsAsync(CancellationToken)), in the configuration of the profile; this reads it as it is, as text, whatever it means (Video/BaseCX is "1920"). The category and the name are case sensitive (measured with OBS Studio 33.0.0). OBS Studio does not announce a change of a parameter, so the model does not keep them: ask when you need one. Only the profile that is current can be asked. The request is made in its turn, after the changes that were asked for before it (see SetEnabledAsync(bool, CancellationToken)).

Exceptions

ArgumentException

category or name is empty.

ObsNotConnectedException

There is no connection to OBS Studio.

ObsNotReadyException

OBS Studio is changing its scene collection, or did so after the call.

TimeoutException

OBS Studio did not answer in time (WriteTimeout).