From 01a7c7f34d11cbeef0b201533bef9ad3d0b640cc Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Sat, 19 Nov 2022 22:28:49 -0800 Subject: SceneItem.enable and .disable! should probably block. AFAIK we don't especially care about latency on these. --- src/obswebsocket.cr | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/obswebsocket.cr') diff --git a/src/obswebsocket.cr b/src/obswebsocket.cr index 88b66b6..6f623a0 100644 --- a/src/obswebsocket.cr +++ b/src/obswebsocket.cr @@ -831,10 +831,14 @@ module OBS end end def enable! - @reqchan.send( { nil, OBS.req( "SetSceneItemEnabled", UUID.random.to_s, JSON.parse( { "sceneName" => @scenename, "sceneItemId" => @id, "sceneItemEnabled" => true }.to_json ) ) } ) + reschan = Channel( JSON::Any ).new + @reqchan.send( { reschan, OBS.req( "SetSceneItemEnabled", UUID.random.to_s, JSON.parse( { "sceneName" => @scenename, "sceneItemId" => @id, "sceneItemEnabled" => true }.to_json ) ) } ) + d = reschan.receive # block until response end def disable! - @reqchan.send( { nil, OBS.req( "SetSceneItemEnabled", UUID.random.to_s, JSON.parse( { "sceneName" => @scenename, "sceneItemId" => @id, "sceneItemEnabled" => false }.to_json ) ) } ) + reschan = Channel( JSON::Any ).new + @reqchan.send( { reschan, OBS.req( "SetSceneItemEnabled", UUID.random.to_s, JSON.parse( { "sceneName" => @scenename, "sceneItemId" => @id, "sceneItemEnabled" => false }.to_json ) ) } ) + d = reschan.receive # block until response end def transform( newtransform : OBS::SceneItemTransform | Hash( String, String | Bool | Int64 | Float64 ) ) reqdata = ( Hash( String, String | Bool | Int64 | Float64 | Hash( String, String | Bool | Int64 | Float64 ) ) ).new -- cgit v1.2.3