Class: StrDn2030::Remote::Zone
- Inherits:
-
Object
- Object
- StrDn2030::Remote::Zone
- Defined in:
- lib/str_dn_2030/zone.rb
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#volume_type ⇒ Object
readonly
Returns the value of attribute volume_type.
-
#zone ⇒ Object
readonly
Returns the value of attribute zone.
-
#zone_id ⇒ Object
(also: #id)
readonly
Returns the value of attribute zone_id.
Instance Method Summary collapse
- #active_video ⇒ Object (also: #active_input)
- #active_video=(other) ⇒ Object (also: #active_input=)
- #headphone? ⇒ Boolean
-
#initialize(parent, zone_id, volume_type = "\x03".b) ⇒ Zone
constructor
A new instance of Zone.
- #inputs ⇒ Object
- #mute=(other) ⇒ Object
- #muted? ⇒ Boolean
- #powered_on? ⇒ Boolean
- #reload ⇒ Object
- #volume ⇒ Object
- #volume=(other) ⇒ Object
Constructor Details
#initialize(parent, zone_id, volume_type = "\x03".b) ⇒ Zone
Returns a new instance of Zone.
4 5 6 7 8 9 |
# File 'lib/str_dn_2030/zone.rb', line 4 def initialize(parent, zone_id, volume_type = "\x03".b) @parent = parent @zone_id = zone_id @zone = zone_id.chr('ASCII-8BIT').freeze @volume_type = volume_type.dup.b.freeze end |
Instance Attribute Details
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
11 12 13 |
# File 'lib/str_dn_2030/zone.rb', line 11 def parent @parent end |
#volume_type ⇒ Object (readonly)
Returns the value of attribute volume_type.
11 12 13 |
# File 'lib/str_dn_2030/zone.rb', line 11 def volume_type @volume_type end |
#zone ⇒ Object (readonly)
Returns the value of attribute zone.
11 12 13 |
# File 'lib/str_dn_2030/zone.rb', line 11 def zone @zone end |
#zone_id ⇒ Object (readonly) Also known as: id
Returns the value of attribute zone_id.
11 12 13 |
# File 'lib/str_dn_2030/zone.rb', line 11 def zone_id @zone_id end |
Instance Method Details
#active_video ⇒ Object Also known as: active_input
46 47 48 |
# File 'lib/str_dn_2030/zone.rb', line 46 def active_video parent.active_input_get(zone_id) end |
#active_video=(other) ⇒ Object Also known as: active_input=
50 51 52 |
# File 'lib/str_dn_2030/zone.rb', line 50 def active_video=(other) parent.active_input_set(zone_id, other) end |
#headphone? ⇒ Boolean
34 35 36 |
# File 'lib/str_dn_2030/zone.rb', line 34 def headphone? parent.status_get(zone_id)[:flags][:headphone] end |
#inputs ⇒ Object
18 19 20 |
# File 'lib/str_dn_2030/zone.rb', line 18 def inputs parent.inputs[zone_id] end |
#mute=(other) ⇒ Object
30 31 32 |
# File 'lib/str_dn_2030/zone.rb', line 30 def mute=(other) parent.mute_set(zone_id, other) end |
#muted? ⇒ Boolean
26 27 28 |
# File 'lib/str_dn_2030/zone.rb', line 26 def muted? parent.status_get(zone_id)[:flags][:mute] end |
#powered_on? ⇒ Boolean
22 23 24 |
# File 'lib/str_dn_2030/zone.rb', line 22 def powered_on? parent.status_get(zone_id)[:flags][:power] end |
#reload ⇒ Object
14 15 16 |
# File 'lib/str_dn_2030/zone.rb', line 14 def reload parent.reload; self end |
#volume ⇒ Object
38 39 40 |
# File 'lib/str_dn_2030/zone.rb', line 38 def volume parent.volume_get(zone_id, volume_type)[:volume] end |
#volume=(other) ⇒ Object
42 43 44 |
# File 'lib/str_dn_2030/zone.rb', line 42 def volume=(other) parent.volume_set(zone_id, other, volume_type) end |