Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,58 @@ What changed in the protocol between 5.5.2 and 5.7.6, and where it landed:
and when it is no longer shown it ends. A change of the position is carried out for a media that plays and is shown, a position beyond the end ends the media, and a media that neither plays nor is paused refuses
a change of its position with `InvalidResourceState`.
- The model subscribes to the media input events now (`EventSubscriptions.MediaInputs`), and reads the state of each media input once, when it reads the inputs: a connect sends one request more for each media input.
- **`ObsModel` has studio mode, the preview scene and the scene transitions** *(after rc.3; the fourth step of making `ObsModel` complete, which goes on until 4.0.0)*.
- **Studio mode and the preview scene**: `SetStudioModeEnabledAsync(bool)` (`IsStudioModeEnabled` was there already), `obs.PreviewScene` (`null` while studio mode is off), `scene.IsPreview` and `scene.SwitchToPreviewAsync()`.
OBS Studio makes the program scene the preview scene when studio mode is switched on and sends no event for it, so the model reads it then (and when it connects with studio mode on).
- **`obs.Transitions`** (`ObsTransitions`) has `Current` (an `ObsTransition`: `Name`, `Uuid`, `Kind`, `IsFixed`, `IsConfigurable`), `Duration` and `IsRunning` as properties of the model (`PropertyChanged` and `Changed` say them), and the
events `Started`, `Ended` and `VideoEnded`. Its calls: `SetCurrentAsync(name)` and `SetDurationAsync(duration)` (return when the model shows the change), `TriggerAsync()` (the Transition button; returns when the transition has started),
`GetAllAsync()`, `GetKindsAsync()`, `GetSettingsAsync()`, `SetSettingsAsync(settings, overlay)`, `GetProgressAsync()` and `SetTBarPositionAsync(position, release)`. The list of transitions, their settings, the position and
the overrides are asked and not kept, because OBS Studio does not announce a change of them. A scene can bring a transition of its own: `scene.GetTransitionOverrideAsync()` (an `ObsTransitionOverride`),
`SetTransitionOverrideAsync(name, duration)` and `ClearTransitionOverrideAsync()`.
- **The program scene is the new scene from the start of a transition.** OBS Studio answers a question about the program scene with the scene that it goes to at once, and sends the event that says so when the transition has
ended (seconds later for a long one). The model reads the program scene when a transition starts, so `obs.ProgramScene` shows the new scene from the start, and `scene.SwitchToAsync()` returns then, while `Transitions.IsRunning`
is still true; before, it returned when the event came or, for a transition longer than `ConfirmationTimeout`, after the model had read the program scene because the event did not come in time.
- **Checked with OBS Studio 33.0.0** (the article has the details): the Transition button puts the preview scene on the air at once and swaps the two scenes when the transition has ended; a trigger while a transition runs does
nothing, except in the first moment of a transition; the duration belongs to the transitions and is taken while a cut is current; a scene that has a transition of its own is shown with it and `Current` does not change.
**Removing the program scene while studio mode is on makes OBS Studio stop answering for seconds**: switch to another scene first.
- The model subscribes to the transition events now (`EventSubscriptions.Transitions`), and reads the current transition when it connects, and the preview scene while studio mode is on: a connect sends one or two requests more.
- **`ObsModel` has the transform of a scene item, its blend mode, copies of scene items, and a choice of what it follows of what OBS Studio sends very often** *(after rc.3; the fifth step of making `ObsModel` complete, which goes on until 4.0.0)*.
- **`ObsModelOptions.HighVolume`** (`ObsHighVolume`, `None` by default) says what the model follows of what OBS Studio sends many times a second, which every client that listens pays for (OBS Studio does not include these events in
`EventSubscriptions.All` either). `ObsHighVolume.Transforms` makes the model follow the transform of every scene item, and subscribe to the events for it.
- **The transform of a scene item**: `item.Transform` (a `SceneItemTransform?`, `null` unless the model follows the transforms; it is a copy that does not change, `PropertyChanged` and `Changed` tell when it is another), `GetTransformAsync()` (asks OBS Studio, with and
without `HighVolume`) and `SetTransformAsync(update)` (a `SceneItemTransformUpdate`, for example `item.Transform.ToUpdate() with { ScaleX = 2 }`: it returns when the model shows the change, or when OBS Studio has answered if the model does not follow the transforms).
`SceneItemTransform` has value equality now (`Equals` and `GetHashCode`; the numbers are 32 bit numbers, as OBS Studio keeps them).
- **The blend mode** (`GetBlendModeAsync()`, `SetBlendModeAsync(mode)`): asked and not kept, because OBS Studio announces no change of it.
- **A copy of a scene item**: `DuplicateAsync(destination)` makes it on top of its scene or of another one, and returns it when the model shows it. It has the transform, the crop and whether the item is shown, and is not locked and has the normal blend mode.
`obs.SceneItemSelected` (`ObsSceneItemEventArgs`) says that an item was selected in OBS Studio (also the one that OBS Studio selects when an item is made); the model does not keep which item is selected, because OBS Studio says nothing when it is not.
- **Checked with OBS Studio 33.0.0 (obs-websocket 5.7.6)**: a change of the position, the scale, the rotation, the alignment and the bounds is announced at once, a crop and the size of a source **only for a scene that OBS Studio renders** (the program scene, the preview scene of
studio mode, a scene that a projector shows; for another scene when it is rendered), so the transform that the model shows of an item in such a scene can be behind until then: `SetTransformAsync` and `DuplicateAsync` read the scene again and do not depend on it. A change
with a crop is two events (the crop comes last). A blend mode that is set makes OBS Studio send the transform again, which is no change. The size of an item is the size of its source times the scale, whatever the bounds are.
- **`DuplicateSceneItem` with the UUID of the destination alone makes the copy in the scene of the original** (obs-websocket reads the destination only when the request has its name, and then the UUID that is there wins). `DuplicateAsync` gives both. With the plain client give the
destination by name; the article about requests says so.
- The simulation has transforms, blend modes and copies, and the checks that obs-websocket 5.7.6 makes of a transform (read from its source and checked against OBS Studio 33.0.0); the model is compared with it, with and without following the transforms, and against a real OBS Studio.
- **`ObsModel` follows whether the inputs are on the air and shown** *(after rc.3; step 5b of making `ObsModel` complete, which goes on until 4.0.0)*.
- **`ObsHighVolume.Activity`** (`ObsHighVolume.All` has it too) makes the model read `GetSourceActive` for every input and subscribe to `InputActiveStateChanged` and `InputShowStateChanged`, which OBS Studio sends for every input that a change of the program scene,
a transition, the preview scene or a scene item reaches (`ObsModelOptions.HighVolume`; the default is still none, so a model that does not ask sends no request for it and does not subscribe).
- **`input.IsActive`** (on the air: shown in the program output) and **`input.IsShowing`** (shown: on the air, or in the preview of studio mode, a projector or the window of its properties) are `bool?`: `null` unless the model follows the activity. `PropertyChanged` and `Changed` tell each by itself.
The activity of a scene is asked and not kept (`scene.GetActivityAsync()`, on every source), because OBS Studio announces none for a scene.
- **Checked with OBS Studio 33.0.0 (obs-websocket 5.7.6)**: a scene that goes on the air puts its inputs on the air when the transition starts, and the scene that goes off takes them off after it has ended (a fade keeps both on the air while it runs, and `SwitchToAsync()` returns before that, as it does for the program scene);
a scene that is nested puts its inputs on the air as long as the scene items that lead to it are enabled; the preview scene of studio mode shows its inputs and does not put them on the air; **in studio mode a copy of the program scene is on the air**, so hiding a scene item of the program scene, or making an input in it,
changes nothing of what is on the air until the next scene goes on the air or studio mode is switched off; the two events come in no fixed order, and none comes for an input that OBS Studio destroys.
- The simulation has the activity (with the copy of studio mode), and the model is compared with it, with and without following it, and against a real OBS Studio, where the model has to equal what `GetSourceActive` says of every input after every step.
The simulation also announces the preview scene first when studio mode is switched off, as OBS Studio does (it makes the preview scene the program scene for a moment, and then the scene that was), and does not make a scene that was removed during a transition the preview scene.
- **`ObsModel` follows the levels of the audio** *(after rc.3; step 5c of making `ObsModel` complete, which goes on until 4.0.0)*.
- **`ObsHighVolume.AudioLevels`** (and `ObsHighVolume.All`, which is `Transforms | Activity | AudioLevels`) makes the model subscribe to `InputVolumeMeters`, which OBS Studio sends every 50 milliseconds to every client that asks, also when nothing plays, and for which it has every input that is on the
air measure its audio for as long as someone is subscribed (`ObsModelOptions.HighVolume`; the default is still none, so a model that does not ask does not subscribe).
- **`input.Levels`** (an `ObsAudioLevels?`: the `Input` and its `Channels`, each an `ObsChannelLevel` with `Magnitude`, `Peak` and `InputPeak` as multipliers of the full scale, and `MagnitudeDb`, `PeakDb` and `InputPeakDb` with -100 for silence) is what OBS Studio said of the input in its last message: `null` unless the model follows the levels and
OBS Studio lists the input. `PropertyChanged` tells when the levels change, when OBS Studio stops listing the input, and when the connection ends. **`obs.AudioLevels`** (`ObsAudioLevelsEventArgs`: `Levels` of every listed input, and `Ended` with the inputs that stopped being listed) says that new levels came.
- **A stream and not a history.** The levels do not go through the engine of the model: they are in the inputs when the message arrives. The application is not told of every message: at most one notification waits in the queue of the notifications, and a handler that is slower than OBS Studio gets the newest
levels (`Ended` has every input that stopped being listed meanwhile). The levels never fill the queue (`MaxPendingNotifications`), never hold up what the model reads, and `Changed` does not tell them. A message that says what the previous one said is not told. The plain client passes on one `InputVolumeMeters` event every 100 ms,
the model uses every message.
- **Checked with OBS Studio 33.0.0 (obs-websocket 5.7.6)**: a message every 50 milliseconds, with an empty list when nothing is on the air; it lists the inputs that are on the air and have audio, in the order in which they came on the air, so not an input that is only shown in the preview of studio mode, one whose scene item is hidden, or one without audio, and the
inputs of the scene that goes off the air until the transition has ended; a muted input is listed, with a magnitude and a peak of 0 and the peak of the input as it is, and the volume scales the magnitude and the peak and not the peak of the input; an input that plays nothing is listed with zeros; the first message that lists an input has no channels; a mono file arrives as two channels
with the same levels, a stereo file with the left channel first; **the first message that has audio of an input can say a peak that is far too high** (1.9 was measured often, and 2.7e20 once), which `ObsChannelLevel.Peak` says.
- The simulation has the levels (a tick sends a message, and the random walks make some), and the model is compared with it over the whole stack, for the inputs that are on the air and those that go off it, a lost connection and a switch of the scene collection, and against a real OBS Studio with a tone of a known loudness.
- Support for the **Canvases** category of obs-websocket 5.7.0: `GetCanvasList`, the `Canvas`, `CanvasFlags` and
`CanvasVideoSettings` classes, the `CanvasCreated`, `CanvasRemoved` and `CanvasNameChanged` events, and the
`EventSubscriptions.Canvases` flag (included in `EventSubscriptions.All`).
Expand Down
Loading
Loading