diff options
Diffstat (limited to 'src/obswebsocket.cr')
-rw-r--r-- | src/obswebsocket.cr | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/obswebsocket.cr b/src/obswebsocket.cr index b824153..d3432f4 100644 --- a/src/obswebsocket.cr +++ b/src/obswebsocket.cr @@ -972,6 +972,21 @@ module OBS def deletecache( input : String ) @inputs.delete( input ) end + def pretty_print(pp) : Nil + executed = exec_recursive(:pretty_print) do + pp.list("{", self.to_h, "}") do |key, value| + pp.group do + key.pretty_print(pp) + pp.text " =>" + pp.nest do + pp.breakable + value.pretty_print(pp) + end + end + end + end + pp.text "{...}" unless executed + end end class Input @@ -996,6 +1011,12 @@ module OBS value.sourcenamecache( name ) end end + def pretty_print(pp) : Nil + self.name.pretty_print(pp) + self.kind.pretty_print(pp) + self.settings.pretty_print(pp) + self.filters.pretty_print(pp) + end end class InputSettings @@ -1030,6 +1051,11 @@ module OBS def namecache( name : String) @name = name end + def pretty_print(pp) : Nil + @inputkind.pretty_print(pp) + @name.pretty_print(pp) + @inputsettings.pretty_print(pp) + end end class SourceFilters # Note: a property of both OBS::Input and OBS::Scene @@ -1071,6 +1097,10 @@ module OBS @filters_by_name = Hash( String, OBS::SourceFilter ).new @filters_by_index = Array( String ).new end + def pretty_print(pp) : Nil + @sourcename.pretty_print(pp) + self.to_h.pretty_print(pp) + end end class SourceFilter |