Class ObsProfiles
- Namespace
- OBSStudioClient.Model
- Assembly
- OBSClient.dll
The profiles of OBS Studio: which one is current, the names of all, and the calls that switch to one, make one and remove one.
public sealed class ObsProfiles : INotifyPropertyChanged
- Inheritance
-
ObsProfiles
- Implements
- Inherited Members
Remarks
It is the same object for as long as the ObsModel lives (Profiles), and says with INotifyPropertyChanged when Current and Names change, also when the user (or another program) changes them in OBS Studio. A profile holds what OBS Studio keeps apart from the scenes: its video settings (GetVideoSettingsAsync(CancellationToken)), its stream service (GetStreamServiceAsync(CancellationToken)), the folder for recordings (GetRecordDirectoryAsync(CancellationToken)), its other settings (GetParameterAsync(string, string, CancellationToken)), and the data that programs keep in it (GetPersistentDataAsync(ObsDataRealm, string, CancellationToken)). Only the current profile can be read and changed, so switch to a profile before asking for or changing what it holds. What is in the scenes belongs to the scene collection (SceneCollections), so a switch of the profile does not change anything else that the model shows.
What OBS Studio does (measured with OBS Studio 33.0.0, and read in its source): a switch to another profile is done when OBS Studio answers, and the events that say so come at the same moment. A profile that is made is a clean one (the settings that OBS Studio gives a new profile), and becomes the current one a moment after OBS Studio has answered (about a tenth of a second). Nothing happens when the profile that is asked for is the current one already. OBS Studio does not remove the current profile: it asks the user in its own window, and answers at once as if it had, so RemoveAsync(string, CancellationToken) refuses it before it sends anything. A switch to a profile with another sample rate or speaker setup makes OBS Studio ask the user, in its window, whether it may restart; the profile is the current one all the same.
Properties
- Current
Gets the name of the current profile. It is null until OBS Studio has said.
- Names
Gets the names of the profiles, in the order in which OBS Studio lists them. The list is empty until OBS Studio has said, and it is another list when the profiles change.
Methods
- CreateAsync(string, CancellationToken)
Makes a profile, which becomes the current one, and returns when the model shows it.
- 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.
- RemoveAsync(string, CancellationToken)
Removes a profile, and returns when the model no longer lists it.
- SetCurrentAsync(string, CancellationToken)
Makes a profile the current one, and returns when the model shows it.
- SetParameterAsync(string, string, string?, CancellationToken)
Sets a parameter of the configuration of the profile that is current, or removes it, and returns when OBS Studio has answered.
Events
- PropertyChanged
Occurs when a property value changes.