Class: TagLib::Ogg::XiphComment

Inherits:
Tag
  • Object
show all
Defined in:
docs/taglib/ogg.rb

Overview

Xiph comments (aka VorbisComment), a metadata format used for Ogg Vorbis and other codecs.

A Xiph comment is structured as a set of fields. Each field has a name and a value. Multiple fields with the same name are allowed, so you can also view it as a map from names to a list of values.

Instance Attribute Summary collapse

Attributes inherited from Tag

#album, #artist, #comment, #genre, #title, #track, #year

Instance Method Summary collapse

Methods inherited from Tag

#empty?

Instance Attribute Details

#vendor_idString (readonly)

Returns vendor ID of the encoder used.

Returns:

  • (String)

    vendor ID of the encoder used



73
74
75
# File 'docs/taglib/ogg.rb', line 73

def vendor_id
  @vendor_id
end

Instance Method Details

#add_field(name, value, replace = true) ⇒ void

This method returns an undefined value.

Add a name-value pair to the comment.

Parameters:

  • name (String)

    field name

  • value (String)

    field value

  • replace (Boolean) (defaults to: true)

    if true, all existing fields with the given name will be replaced



22
23
# File 'docs/taglib/ogg.rb', line 22

def add_field(name, value, replace=true)
end

#contains?(name) ⇒ Boolean

Check if the comment contains a field.

Parameters:

  • name (String)

    field name

Returns:

  • (Boolean)


29
30
# File 'docs/taglib/ogg.rb', line 29

def contains?(name)
end

#field_countInteger

Count the number of fields.

Returns:

  • (Integer)

    the number of fields in the comment (name-value pairs)



36
37
# File 'docs/taglib/ogg.rb', line 36

def field_count
end

#field_list_mapHash<String, Array<String>>

Get the contents of the comment as a hash, with the key being a field name String and the value a list of field values for that key. Example result:

{ 'TITLE' => ["Title"],
  'GENRE' => ["Rock", "Pop"] }

Note that the returned hash is read-only. Changing it will have no effect on the comment; use #add_field and #remove_field for that.

Returns:

  • (Hash<String, Array<String>>)

    a hash from field names to value lists



52
53
# File 'docs/taglib/ogg.rb', line 52

def field_list_map
end

#remove_field(name) ⇒ void #remove_field(name, value) ⇒ void

This method returns an undefined value.

Remove one or more fields.

Overloads:

  • #remove_field(name) ⇒ void

    Removes all fields with the given name.

    Parameters:

    • name (String)

      field name

  • #remove_field(name, value) ⇒ void

    Removes the field with the given name and value.

    Parameters:

    • name (String)

      field name

    • value (String)

      field value



69
70
# File 'docs/taglib/ogg.rb', line 69

def remove_field
end