Class: WahWah::Mp4Tag

Inherits:
Tag
  • Object
show all
Defined in:
lib/wahwah/mp4_tag.rb

Constant Summary collapse

META_ATOM_MAPPING =
{
  "\xA9alb".b => :album,
  "\xA9ART".b => :artist,
  "\xA9cmt".b => :comment,
  "\xA9wrt".b => :composer,
  "\xA9day".b => :year,
  "\xA9gen".b => :genre,
  "\xA9nam".b => :title,
  'covr'.b => :image,
  'disk'.b => :disc,
  'trkn'.b => :track,
  'aART'.b => :albumartist
}
META_ATOM_DECODE_BY_TYPE =
{
  0 => -> (data) { data },  # reserved
  1 => -> (data) { Helper.encode_to_utf8(data) }, # UTF-8
  2 => -> (data) { Helper.encode_to_utf8(data, 'UTF-16BE') }, # UTF-16BE
  3 => -> (data) { Helper.encode_to_utf8(data, 'SJIS') }, # SJIS

  13 => -> (data) { { data: data, mime_type: 'image/jpeg', type: :cover } },  # JPEG
  14 => -> (data) { { data: data, mime_type: 'image/png', type: :cover } },  # PNG

  21 => -> (data) { data.unpack('i>').first }, # Big endian signed integer
  22 => -> (data) { data.unpack('I>').first }, # Big endian unsigned integer
  23 => -> (data) { data.unpack('g').first }, # Big endian 32-bit floating point value
  24 => -> (data) { data.unpack('G').first }, # Big endian 64-bit floating point value

  65 => -> (data) { data.unpack('c').first }, # 8-bit signed integer
  66 => -> (data) { data.unpack('s>').first }, # Big-endian 16-bit signed integer
  67 => -> (data) { data.unpack('l>').first }, # Big-endian 32-bit signed integer
  74 => -> (data) { data.unpack('q>').first }, # Big-endian 64-bit signed integer

  75 => -> (data) { data.unpack('C').first }, # 8-bit unsigned integer
  76 => -> (data) { data.unpack('S>').first }, # Big-endian 16-bit unsigned integer
  77 => -> (data) { data.unpack('L>').first }, # Big-endian 32-bit unsigned integer
  78 => -> (data) { data.unpack('Q>').first } # Big-endian 64-bit unsigned integer
}

Constants inherited from Tag

Tag::INSPECT_ATTRIBUTES, Tag::INTEGER_ATTRIBUTES

Instance Attribute Summary

Attributes inherited from Tag

#album, #albumartist, #artist, #bit_depth, #bitrate, #comments, #composer, #disc, #disc_total, #duration, #file_size, #genre, #sample_rate, #title, #track, #track_total, #year

Method Summary

Methods inherited from Tag

#images, #initialize, #inspect

Constructor Details

This class inherits a constructor from WahWah::Tag