diff options
-rw-r--r-- | src/obswebsocket.cr | 8 |
1 files changed, 6 insertions, 2 deletions
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 |