Class: Moc::Controller::Status::Song
- Inherits:
-
Object
- Object
- Moc::Controller::Status::Song
- Defined in:
- lib/moc/controller/status.rb
Instance Attribute Summary collapse
-
#average_bitrate ⇒ Object
readonly
Returns the value of attribute average_bitrate.
-
#bitrate ⇒ Object
readonly
Returns the value of attribute bitrate.
-
#channels ⇒ Object
readonly
Returns the value of attribute channels.
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#rate ⇒ Object
readonly
Returns the value of attribute rate.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
- #duration ⇒ Object
-
#initialize(controller) ⇒ Song
constructor
A new instance of Song.
- #inspect ⇒ Object
Constructor Details
#initialize(controller) ⇒ Song
Returns a new instance of Song.
118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/moc/controller/status.rb', line 118 def initialize (controller) @controller = controller @internal = Live::Song.new(controller) @channels = @internal.channels @rate = @internal.rate @bitrate = @internal.bitrate @average_bitrate = @internal.average_bitrate @position = @internal.position @file = @internal.file = @internal. end |
Instance Attribute Details
#average_bitrate ⇒ Object (readonly)
Returns the value of attribute average_bitrate.
116 117 118 |
# File 'lib/moc/controller/status.rb', line 116 def average_bitrate @average_bitrate end |
#bitrate ⇒ Object (readonly)
Returns the value of attribute bitrate.
116 117 118 |
# File 'lib/moc/controller/status.rb', line 116 def bitrate @bitrate end |
#channels ⇒ Object (readonly)
Returns the value of attribute channels.
116 117 118 |
# File 'lib/moc/controller/status.rb', line 116 def channels @channels end |
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
116 117 118 |
# File 'lib/moc/controller/status.rb', line 116 def controller @controller end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
116 117 118 |
# File 'lib/moc/controller/status.rb', line 116 def file @file end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
116 117 118 |
# File 'lib/moc/controller/status.rb', line 116 def position @position end |
#rate ⇒ Object (readonly)
Returns the value of attribute rate.
116 117 118 |
# File 'lib/moc/controller/status.rb', line 116 def rate @rate end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
116 117 118 |
# File 'lib/moc/controller/status.rb', line 116 def end |
Instance Method Details
#duration ⇒ Object
139 140 141 |
# File 'lib/moc/controller/status.rb', line 139 def duration .time if end |
#inspect ⇒ Object
143 144 145 |
# File 'lib/moc/controller/status.rb', line 143 def inspect "#<#{self.class.name}: track=#{track} title=#{title.inspect} artist=#{artist.inspect} album=#{album.inspect} channels=#{channels} bitrate=#{bitrate}(#{average_bitrate}) position=#{position}/#{duration || ??}>" end |