Event Changed
- Namespace
- OBSStudioClient.Model
- Assembly
- OBSClient.dll
Occurs when something in the model changes: an object appeared or went, a value changed, or the model corrected itself. The records come in the order in which the changes happened, one at a time.
public event EventHandler<ObsChangedEventArgs>? Changed
Returns
- EventHandler<ObsChangedEventArgs>
- Occurs when something in the model changes: an object appeared or went, a value changed, or the model corrected itself. The records come in the order in which the changes happened, one at a time.
Remarks
A handler sees the model as it is when the handler runs, which can be newer than the change that it is told about: the properties are always current, the change is a notification. While the model is being read (after a connection is made, and after one is restored) the changes are not raised one by one: Resynchronized is raised when it is complete. What does not depend on the scene collection that is read is the exception: the file that an output wrote (CurrentFile, LastSavedPath) and that OBS Studio is exiting (IsExiting) are told when they happen, in front of the events that go with them (FileChanged, Saved, ExitStarted), which are told at once as well.
The PropertyChanged events are not lost in that time. The objects that you hold are brought in line with OBS Studio as it is read, and when the model is complete each of them raises PropertyChanged once for each property that changed (the IsMuted of an input that was muted while the connection was down, the Name of a scene that was renamed, the IsRemoved of an input that was removed, and the Scenes and Inputs of the ObsModel itself). The first time that the model is complete, only the ObsModel does: the objects are new to you then. There is no record in Changed for any of these: Resynchronized comes after them, and says that you should read again what you hold. When more properties changed than may be kept meanwhile (see MaxPendingNotifications), each object raises PropertyChanged once with an empty property name instead, which says that all of its properties changed.
There is one record for each change of a value or of a list, not one for each object that the change moves: when a scene item is moved, the record is a change of Items of its scene; the Index of the items that moved are announced by their PropertyChanged events.