class
Obsctl::OBS::Client
- Obsctl::OBS::Client
- Reference
- Object
Overview
obs-websocket 5.x client used by the server-owned OBS supervisor.
Defined in:
obsctl/obs/client.crConstructors
Instance Method Summary
-
#close : Nil
Closes the WebSocket and marks this client as no longer identified.
-
#connect : Nil
Opens the WebSocket, performs Hello/Identify/Identified, and starts the reader fiber used for events and request responses.
-
#connected? : Bool
Returns true after Identify completes and the underlying socket is open.
-
#current_scene : String | Nil
Returns the current OBS program scene name when available.
-
#events : Channel(Obsctl::OBS::Protocol::Event)
Channel of parsed OBS events from opcode 5 frames.
-
#input_muted(name : String) : Bool | Nil
Returns mute state for an OBS input by exact OBS input name.
-
#input_names : Array(String)
Returns current OBS input names.
-
#input_volume(name : String) : NamedTuple(mul: Float64 | Nil, db: Float64 | Nil, percent: Int32 | Nil)
Returns OBS input volume in multiplier, dB, and user-facing percent.
-
#mute(name : String, muted : Bool) : Nil
Sets mute state for an OBS input by exact OBS input name.
-
#request(request_type : String, data : JSON::Any | Nil = nil) : Protocol::Response
Sends a typed obs-websocket request frame and waits for the matching request ID response or timeout.
-
#scene_names : Array(String)
Returns the current OBS scene names in OBS order.
-
#set_scene(name : String) : Nil
Changes the current OBS program scene by exact OBS scene name.
-
#set_volume(name : String, percent : Int32) : Nil
Sets OBS input volume using a user-facing 0-100 percentage.
-
#snapshot : State::ObsSnapshot
Fetches a full state snapshot for publication to local IPC clients.
-
#terminal_error : Domain::ConnectionFailed | Nil
Returns the safe terminal connection error that closed this client.
-
#toggle_mute(name : String) : Nil
Toggles mute state for an OBS input by exact OBS input name.
-
#version : JSON::Any
Fetches OBS and obs-websocket version metadata.
-
#wait_for_close(timeout : Time::Span) : Domain::ConnectionFailed | Nil
Waits for the WebSocket reader to observe a terminal close or protocol error, returning the same sanitized error exposed by
#terminal_error.
Constructor Detail
Instance Method Detail
Opens the WebSocket, performs Hello/Identify/Identified, and starts the reader fiber used for events and request responses.
Channel of parsed OBS events from opcode 5 frames.
Returns mute state for an OBS input by exact OBS input name.
Returns OBS input volume in multiplier, dB, and user-facing percent.
Sets mute state for an OBS input by exact OBS input name.
Sends a typed obs-websocket request frame and waits for the matching request ID response or timeout.
Sets OBS input volume using a user-facing 0-100 percentage.
Fetches a full state snapshot for publication to local IPC clients.
Returns the safe terminal connection error that closed this client.
Waits for the WebSocket reader to observe a terminal close or protocol
error, returning the same sanitized error exposed by #terminal_error.