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
-
#audio_snapshot : Array(State::AudioState)
Fetches only the audio input list for targeted state updates.
-
#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.
- #output_state : State::OutputState
- #pause_record : Nil
- #profiles : NamedTuple(current: String | Nil, names: Array(String))
-
#record_status : State::RecordStatus
Returns the full record status, including pause state and timecode.
-
#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.
- #resume_record : Nil
- #scene_collections : NamedTuple(current: String | Nil, names: Array(String))
-
#scene_names : Array(String)
Returns the current OBS scene names in OBS order.
-
#scene_snapshot : NamedTuple(current_scene: String | Nil, scenes: Array(State::SceneState))
Fetches only the scene list and current scene for targeted state updates.
- #set_profile(name : String) : Nil
-
#set_scene(name : String) : Nil
Changes the current OBS program scene by exact OBS scene name.
- #set_scene_collection(name : String) : Nil
-
#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.
-
#start_record : Nil
Starts recording.
- #stats : State::ObsStats
-
#stop_record : String | Nil
Stops recording and returns the written file path when OBS reports one.
-
#telemetry_sample : TelemetrySample
Fetches the performance and output counters used by the daemon's periodic telemetry poller.
-
#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.
- #toggle_record : Bool | Nil
- #toggle_stream : Bool | Nil
-
#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
Fetches only the audio input list for targeted state updates.
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.
Returns the full record status, including pause state and timecode.
Sends a typed obs-websocket request frame and waits for the matching request ID response or timeout.
Fetches only the scene list and current scene for targeted state updates.
Sets OBS input volume using a user-facing 0-100 percentage.
Fetches a full state snapshot for publication to local IPC clients.
Stops recording and returns the written file path when OBS reports one.
Fetches the performance and output counters used by the daemon's periodic telemetry poller. OBS exposes bytes rather than bitrate, so the supervisor derives kbit/s from consecutive samples.
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.