diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/obswebsocket.cr | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/obswebsocket.cr b/src/obswebsocket.cr index 3978b47..f8e7e3e 100644 --- a/src/obswebsocket.cr +++ b/src/obswebsocket.cr @@ -40,7 +40,7 @@ module OBSWebSocket @scenecollection = OBSWebSocket::SceneCollection.new( @@reqchan ) @@inputs = OBSWebSocket::Inputs.new( @@reqchan ) @@scenes = OBSWebSocket::SceneList.new( @@reqchan, @@inputs ) - @sources = OBSWebSocket::Sources.new( @@inputs, @@scenes ) + @sources = OBSWebSocket::Sources.new( @@reqchan, @@inputs, @@scenes ) @outputs = OBSWebSocket::Outputs.new( @@reqchan ) @video = OBSWebSocket::VideoSettings.new( @@reqchan ) @stats = OBSWebSocket::Stats.new( @@reqchan ) @@ -702,7 +702,8 @@ module OBSWebSocket class Sources getter scenes : OBSWebSocket::SceneList getter inputs : OBSWebSocket::Inputs - def initialize( @inputs : OBSWebSocket::Inputs, @scenes : OBSWebSocket::SceneList ) + @last_known_real_transform = Hash( String, OBSWebSocket::SceneItemTransform ).new + def initialize( @reqchan : Channel( Tuple( Channel( JSON::Any ) | Nil, String ) ), @inputs : OBSWebSocket::Inputs, @scenes : OBSWebSocket::SceneList ) end def []?( index : String ) : OBSWebSocket::Scene | OBSWebSocket::Input | Nil if @inputs[index]? @@ -716,6 +717,15 @@ module OBSWebSocket def to_h() : Hash( String, OBSWebSocket::Scene | OBSWebSocket::Input ) return @inputs.to_h.merge( @scenes.to_h ) end + def last_known_real_transform_add( sourcename : String, transform : JSON::Any ) + @last_known_real_transform[ sourcename ] = OBSWebSocket::SceneItemTransform.new( @reqchan, transform, sourcename, 0.to_i64 ) + end + def last_known_real_transform( sourcename : String ) : OBSWebSocket::SceneItemTransform + @last_known_real_transform[ sourcename ] + end + def last_known_real_transform?( sourcename : String ) : OBSWebSocket::SceneItemTransform | Nil + @last_known_real_transform[ sourcename ]? + end end class Inputs |