Description
LckMediator is a static utility that coordinates registration and lookup of cameras (ILckCamera) and monitors (ILckMonitor) within LCK. It maintains collections of active cameras and monitors, raises events when they are registered or unregistered, and forwards monitor-to-camera assignments to downstream systems like mixers.
In most cases you won’t call LckMediator directly — LckCamera and LckMonitor register and unregister themselves automatically during their lifecycle. Use it when you need manual control over custom camera/monitor implementations or want to react to registration events.
Usage
Manually registering a custom ILckCamera implementation
Reacting to camera/monitor registration events
References
Events
| Event | Type | Description |
|---|---|---|
| CameraRegistered | Action<ILckCamera> | Invoked when a new camera is registered. |
| CameraUnregistered | Action<ILckCamera> | Invoked when a camera is unregistered. |
| MonitorRegistered | Action<ILckMonitor> | Invoked when a new monitor is registered. |
| MonitorUnregistered | Action<ILckMonitor> | Invoked when a monitor is unregistered. |
| MonitorToCameraAssignment | Action<string, string> | Invoked when a monitor is assigned to a camera. |
Methods
| Method | Returns | Description |
|---|---|---|
RegisterCamera(ILckCamera) | void | Registers a camera if not already present. |
UnregisterCamera(ILckCamera) | void | Unregisters a camera by ID. |
RegisterMonitor(ILckMonitor) | void | Registers a monitor if not already present. |
UnregisterMonitor(ILckMonitor) | void | Unregisters a monitor by ID. |
| GetCameraById(string id) | ILckCamera | Retrieves a registered camera by its ID. |
| GetMonitorById(string id) | ILckMonitor | Retrieves a registered monitor by its ID. |
| GetCameras() | IEnumerable<ILckCamera> | Returns all currently registered cameras. |
| GetMonitors() | IEnumerable<ILckMonitor> | Returns all currently registered monitors. |
| NotifyMixerAboutMonitorForCamera(string, string) | void | Notifies listeners about an assignment between monitor and camera. |
See Also
- LckCamera — MonoBehaviour that auto-registers with LckMediator on enable
- LckMonitor — MonoBehaviour that auto-registers with LckMediator on enable
- ILckCamera — Interface for custom camera implementations
- ILckMonitor — Interface for custom monitor implementations