Class: Id3Taginator::Header::Id3v2Flags
- Inherits:
-
Object
- Object
- Id3Taginator::Header::Id3v2Flags
- Defined in:
- lib/id3taginator/header/id3v2_flags.rb
Instance Method Summary collapse
-
#experimental? ⇒ Boolean
determines if experimental tags are present.
-
#extended_header? ⇒ Boolean
determines if an extended header is present.
-
#footer=(enabled) ⇒ Object
enables or disables a footer.
-
#footer? ⇒ Boolean
determines if a footer is present.
-
#initialize(flags) ⇒ Id3v2Flags
constructor
constructor.
-
#to_bytes ⇒ String
dumps the flags to a byte string.
-
#unsynchronized=(enabled) ⇒ Object
enables or synchronization for the tag.
-
#unsynchronized? ⇒ Boolean
determined if the tag is unsynchronized.
Constructor Details
#initialize(flags) ⇒ Id3v2Flags
constructor
10 11 12 |
# File 'lib/id3taginator/header/id3v2_flags.rb', line 10 def initialize(flags) @flags = flags end |
Instance Method Details
#experimental? ⇒ Boolean
determines if experimental tags are present
38 39 40 |
# File 'lib/id3taginator/header/id3v2_flags.rb', line 38 def experimental? (@flags & 0b0010_0000) == 0b0010_0000 end |
#extended_header? ⇒ Boolean
determines if an extended header is present
31 32 33 |
# File 'lib/id3taginator/header/id3v2_flags.rb', line 31 def extended_header? (@flags & 0b0100_0000) == 0b0100_0000 end |
#footer=(enabled) ⇒ Object
enables or disables a footer
52 53 54 |
# File 'lib/id3taginator/header/id3v2_flags.rb', line 52 def (enabled) @flags = enabled ? @flags | 0b0001_0000 : @flags & 0b1110_1111 end |
#footer? ⇒ Boolean
determines if a footer is present
45 46 47 |
# File 'lib/id3taginator/header/id3v2_flags.rb', line 45 def (@flags & 0b0001_0000) == 0b0001_0000 end |
#to_bytes ⇒ String
dumps the flags to a byte string
59 60 61 |
# File 'lib/id3taginator/header/id3v2_flags.rb', line 59 def to_bytes @flags.chr end |
#unsynchronized=(enabled) ⇒ Object
enables or synchronization for the tag
24 25 26 |
# File 'lib/id3taginator/header/id3v2_flags.rb', line 24 def unsynchronized=(enabled) @flags = enabled ? @flags | 0b1000_0000 : @flags & 0b0111_1111 end |
#unsynchronized? ⇒ Boolean
determined if the tag is unsynchronized
17 18 19 |
# File 'lib/id3taginator/header/id3v2_flags.rb', line 17 def unsynchronized? (@flags & 0b1000_0000) == 0b1000_0000 end |