Class: ATEM::Switcher::Input
- Inherits:
-
Object
- Object
- ATEM::Switcher::Input
- Defined in:
- lib/atem/switcher/input.rb,
lib/atem/switcher/input/audio.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#audio ⇒ Object
Returns the value of attribute audio.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#quick_init ⇒ Object
readonly
Returns the value of attribute quick_init.
-
#short_name ⇒ Object
readonly
Returns the value of attribute short_name.
-
#switcher ⇒ Object
readonly
Returns the value of attribute switcher.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #init(id, name = nil, short_name = nil) ⇒ Object
- #init_from(packet) ⇒ Object
-
#initialize(switcher) ⇒ Input
constructor
A new instance of Input.
- #preview ⇒ Object
- #program ⇒ Object
Constructor Details
#initialize(switcher) ⇒ Input
Returns a new instance of Input.
27 28 29 30 31 |
# File 'lib/atem/switcher/input.rb', line 27 def initialize switcher @switcher = switcher end |
Instance Attribute Details
#audio ⇒ Object
Returns the value of attribute audio.
8 9 10 |
# File 'lib/atem/switcher/input.rb', line 8 def audio @audio end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/atem/switcher/input.rb', line 7 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/atem/switcher/input.rb', line 7 def name @name end |
#quick_init ⇒ Object (readonly)
Returns the value of attribute quick_init.
7 8 9 |
# File 'lib/atem/switcher/input.rb', line 7 def quick_init @quick_init end |
#short_name ⇒ Object (readonly)
Returns the value of attribute short_name.
7 8 9 |
# File 'lib/atem/switcher/input.rb', line 7 def short_name @short_name end |
#switcher ⇒ Object (readonly)
Returns the value of attribute switcher.
7 8 9 |
# File 'lib/atem/switcher/input.rb', line 7 def switcher @switcher end |
#type ⇒ Object
Returns the value of attribute type.
8 9 10 |
# File 'lib/atem/switcher/input.rb', line 8 def type @type end |
Class Method Details
.from(packet, switcher, type) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/atem/switcher/input.rb', line 16 def self.from packet, switcher, type input = self.new switcher input.init_from packet input.type = type input end |
Instance Method Details
#init(id, name = nil, short_name = nil) ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/atem/switcher/input.rb', line 40 def init id, name = nil, short_name = nil @id = id @name = name or "Input #{@id}" @short_name = short_name or "#{@id.to_s.rjust(4, "0")}" @quick_init = true end |
#init_from(packet) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/atem/switcher/input.rb', line 33 def init_from packet @id, @name, @short_name, @supported, @ext_port_type, @port_type, @availability = packet.unpack("S>Z20Z4xCxCCxC") end |
#preview ⇒ Object
51 52 53 |
# File 'lib/atem/switcher/input.rb', line 51 def preview @switcher.preview @id end |
#program ⇒ Object
55 56 57 |
# File 'lib/atem/switcher/input.rb', line 55 def program @switcher.program @id end |