summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/obswebsocket.cr8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/obswebsocket.cr b/src/obswebsocket.cr
index 66a19f3..8a729d5 100644
--- a/src/obswebsocket.cr
+++ b/src/obswebsocket.cr
@@ -619,10 +619,14 @@ module OBSWebSocket
program!
end
def program!
- @reqchan.send( { nil, OBSWebSocket.req( "SetCurrentProgramScene", UUID.random.to_s, JSON.parse( { "sceneName" => @name }.to_json ) ) } )
+ reschan = Channel( JSON::Any ).new
+ @reqchan.send( { reschan, OBSWebSocket.req( "SetCurrentProgramScene", UUID.random.to_s, JSON.parse( { "sceneName" => @name }.to_json ) ) } )
+ reschan.receive # we get weird behavior on transitions unless we block here
end
def preview!
- @reqchan.send( { nil, OBSWebSocket.req( "SetCurrentPreviewScene", UUID.random.to_s, JSON.parse( { "sceneName" => @name }.to_json ) ) } )
+ reschan = Channel( JSON::Any ).new
+ @reqchan.send( { reschan, OBSWebSocket.req( "SetCurrentPreviewScene", UUID.random.to_s, JSON.parse( { "sceneName" => @name }.to_json ) ) } )
+ reschan.receive # we get weird behavior on transitions unless we block here
end
def createinput( iname : String, kind : String, settings : OBSWebSocket::InputSettings | Hash( String, String | Bool | Int64 | Float64 ) | Nil = nil, enabled : Bool = true )
reqdata = ( Hash( String, String | Bool | Int64 | Float64 | Hash( String, String | Bool | Int64 | Float64 ) ) ).new