Class: ATEM::Switcher::Input::Audio
- Inherits:
-
Object
- Object
- ATEM::Switcher::Input::Audio
- Defined in:
- lib/atem/switcher/input/audio.rb
Instance Attribute Summary collapse
-
#balance ⇒ Object
readonly
Returns the value of attribute balance.
-
#gain ⇒ Object
readonly
Returns the value of attribute gain.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#levels ⇒ Object
Returns the value of attribute levels.
-
#media_player ⇒ Object
readonly
Returns the value of attribute media_player.
-
#mix ⇒ Object
readonly
Returns the value of attribute mix.
-
#plug ⇒ Object
readonly
Returns the value of attribute plug.
-
#switcher ⇒ Object
readonly
Returns the value of attribute switcher.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #init_from(packet) ⇒ Object
-
#initialize(switcher, input) ⇒ Audio
constructor
A new instance of Audio.
- #level ⇒ Object
Constructor Details
#initialize(switcher, input) ⇒ Audio
20 21 22 23 24 25 26 |
# File 'lib/atem/switcher/input/audio.rb', line 20 def initialize switcher, input @switcher = switcher @input = input @level = 0 end |
Instance Attribute Details
#balance ⇒ Object (readonly)
Returns the value of attribute balance.
9 10 11 |
# File 'lib/atem/switcher/input/audio.rb', line 9 def balance @balance end |
#gain ⇒ Object (readonly)
Returns the value of attribute gain.
9 10 11 |
# File 'lib/atem/switcher/input/audio.rb', line 9 def gain @gain end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/atem/switcher/input/audio.rb', line 9 def id @id end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
9 10 11 |
# File 'lib/atem/switcher/input/audio.rb', line 9 def input @input end |
#levels ⇒ Object
Returns the value of attribute levels.
10 11 12 |
# File 'lib/atem/switcher/input/audio.rb', line 10 def levels @levels end |
#media_player ⇒ Object (readonly)
Returns the value of attribute media_player.
9 10 11 |
# File 'lib/atem/switcher/input/audio.rb', line 9 def media_player @media_player end |
#mix ⇒ Object (readonly)
Returns the value of attribute mix.
9 10 11 |
# File 'lib/atem/switcher/input/audio.rb', line 9 def mix @mix end |
#plug ⇒ Object (readonly)
Returns the value of attribute plug.
9 10 11 |
# File 'lib/atem/switcher/input/audio.rb', line 9 def plug @plug end |
#switcher ⇒ Object (readonly)
Returns the value of attribute switcher.
9 10 11 |
# File 'lib/atem/switcher/input/audio.rb', line 9 def switcher @switcher end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
9 10 11 |
# File 'lib/atem/switcher/input/audio.rb', line 9 def type @type end |
Class Method Details
.from(packet, switcher, input) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/atem/switcher/input/audio.rb', line 12 def self.from packet, switcher, input audio = self.new switcher, input audio.init_from packet audio end |
Instance Method Details
#init_from(packet) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/atem/switcher/input/audio.rb', line 28 def init_from packet @id, @type, @media_player, @plug, @mix, @gain, @balance = packet.unpack("S>CxxxCCCxS>s>") # Now we have the right data, we can name the input itself if @input.quick_init values = { 1001 => ['XLR', 'XLR0'], 1101 => ['AES/EBU', 'AES3'], 1201 => ['RCA', 'RCA_'], } @input.init @input.id, values[@input.id][0], values[@input.id][1] end end |
#level ⇒ Object
49 50 51 |
# File 'lib/atem/switcher/input/audio.rb', line 49 def level (@levels[:left] + @levels[:right]) / 2 end |