Class: Mp3file::XingHeader
- Inherits:
-
Object
- Object
- Mp3file::XingHeader
- Defined in:
- lib/mp3file/xing_header.rb
Defined Under Namespace
Classes: XingHeaderFormat
Instance Attribute Summary collapse
-
#bytes ⇒ Object
readonly
Returns the value of attribute bytes.
-
#frames ⇒ Object
readonly
Returns the value of attribute frames.
-
#quality ⇒ Object
readonly
Returns the value of attribute quality.
-
#toc ⇒ Object
readonly
Returns the value of attribute toc.
Instance Method Summary collapse
-
#initialize(io) ⇒ XingHeader
constructor
A new instance of XingHeader.
Constructor Details
#initialize(io) ⇒ XingHeader
Returns a new instance of XingHeader.
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/mp3file/xing_header.rb', line 25 def initialize(io) head = nil begin head = XingHeaderFormat.read(io) rescue BinData::ValidityError => ve raise InvalidXingHeaderError, ve. end @frames = head.frames if head.frames_present == 1 @bytes = head.bytes if head.bytes_present == 1 @toc = head.toc.dup if head.toc_present == 1 @quality = head.quality if head.quality_present == 1 end |
Instance Attribute Details
#bytes ⇒ Object (readonly)
Returns the value of attribute bytes.
5 6 7 |
# File 'lib/mp3file/xing_header.rb', line 5 def bytes @bytes end |
#frames ⇒ Object (readonly)
Returns the value of attribute frames.
5 6 7 |
# File 'lib/mp3file/xing_header.rb', line 5 def frames @frames end |
#quality ⇒ Object (readonly)
Returns the value of attribute quality.
5 6 7 |
# File 'lib/mp3file/xing_header.rb', line 5 def quality @quality end |
#toc ⇒ Object (readonly)
Returns the value of attribute toc.
5 6 7 |
# File 'lib/mp3file/xing_header.rb', line 5 def toc @toc end |