Skip to content

Latest commit

 

History

History
655 lines (386 loc) · 15.6 KB

Id3v2UrlLinkFrame.md

File metadata and controls

655 lines (386 loc) · 15.6 KB

node-taglib-sharp / Exports / Id3v2UrlLinkFrame

Class: Id3v2UrlLinkFrame

Provides ID3v2 URL Link frame implementation (section 4.3.1) covering W000 to WZZZ, excluding WXXX. With these frames dynamic data such as webpages with touring information, price information, or plain ordinary news can be added to the tag. There may only be one URL link frame of its kind in a tag, except when stated otherwise in the frame description. If the text string is followed by a string termination, all the following information should be ignored and not be displayed. The following table contains the types and descriptions as found in the ID3 2.4.0 native frames specification.

  • WCOM - The 'Commercial Information' frame is a URL pointing at a webpage with information such as where the album can be bought. There may be more than one WCOM frame per tag, but not with the same content.
  • WCOP - The 'Copyright/Legal information' frame is a URL pointing at a webpage where the terms of use and ownership of the field is described.
  • WOAF - The 'Official audio file webpage' frame is a URL pointing at a file specific webpage.
  • WOAR - The 'Official artist/performer webpage' frame is a URL pointing at the artists' official webpage. There may be more than one WOAR frame in a tag if the audio contains more than one performer, but not with the same content.
  • WOAS - THe 'Official audio source webpage' frame is a URL pointing at the official webpage of the source of the audio file, eg, a movie.
  • WORS - The 'Official internet radio station homepage' frame contains a URL pointing at the homepage of the internet radio station.
  • WPAY - The 'Payment' frame is a URL pointing at a webpage that will handle the process of paying for this file.
  • WPUB - The 'Publisher's official webpage' frame is a URL pointing at the official webpage for the publisher.

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

Protected new Id3v2UrlLinkFrame(header)

Parameters

Name Type
header Id3v2FrameHeader

Overrides

Id3v2Frame.constructor

Properties

_encoding

Protected _encoding: StringType = StringType.Latin1

Text encoding to use to store the text contents of the current instance.


_rawData

Protected _rawData: ByteVector

Raw data contents in the current instance.


_rawVersion

Protected _rawVersion: number

ID3v2 version of the current instance.


_textFields

Protected _textFields: string[] = []

Decoded text contained in the current instance.

Accessors

encryptionId

get encryptionId(): number

Gets the encryption ID applied to the current instance.

Returns

number

Value containing the encryption identifier for the current instance or undefined if not set.

Inherited from

Frame.encryptionId

set encryptionId(value): void

Sets the encryption ID applied to the current instance.

Parameters

Name Type Description
value number Value containing the encryption identifier for the current instance. Must be an 8-bit unsigned integer. Setting to undefined will remove the encryption header and ID

Returns

void

Inherited from

Frame.encryptionId


flags

get flags(): Id3v2FrameFlags

Gets the frame flags applied to the current instance.

Returns

Id3v2FrameFlags

Inherited from

Frame.flags

set flags(value): void

Sets the frame flags applied to the current instance. If the value includes either Encryption or Compression, render will throw.

Parameters

Name Type
value Id3v2FrameFlags

Returns

void

Inherited from

Frame.flags


frameClassType

get frameClassType(): Id3v2FrameClassType

Gets a flag indicating which type of frame the current instance is.

Returns

Id3v2FrameClassType

Overrides

Frame.frameClassType


frameId

get frameId(): Id3v2FrameIdentifier

Gets the frame ID for the current instance.

Returns

Id3v2FrameIdentifier

Object representing of the identifier of the frame

Inherited from

Frame.frameId


groupId

get groupId(): number

Gets the grouping ID applied to the current instance.

Returns

number

Value containing the grouping identifier for the current instance, or undefined if not set.

Inherited from

Frame.groupId

set groupId(value): void

Sets the grouping ID applied to the current instance.

Parameters

Name Type Description
value number Grouping identifier for the current instance. Must be an 8-bit unsigned integer. Setting to undefined will remove the grouping identity header and ID

Returns

void

Inherited from

Frame.groupId


header

Protected get header(): Id3v2FrameHeader

Gets the header for the frame. For new frames this should not exist.

Returns

Id3v2FrameHeader

Inherited from

Frame.header

Protected set header(value): void

Sets the header for the frame.

Parameters

Name Type Description
value Id3v2FrameHeader Header for the frame

Returns

void

Inherited from

Frame.header


size

get size(): number

Gets the size of the current instance as it was last stored on disk. NOTE: This value is not used outside of reading a frame from disk, so newly created frames should not have this value set.

Returns

number

Inherited from

Frame.size


text

get text(): string[]

Gets the text contained in the current instance. Modifying the contents of the returned value will not modify the contents of the current instance. The value must be reassigned for the value to change.

Returns

string[]

set text(value): void

Sets the text contained in the current instance.

Parameters

Name Type
value string[]

Returns

void


textEncoding

get textEncoding(): StringType

Gets the text encoding to use when rendering the current instance.

Returns

StringType

set textEncoding(value): void

Sets the text encoding to use when rendering the current instance. NOTE: This value will be overwritten if forceDefaultEncoding is true.

Parameters

Name Type
value StringType

Returns

void

Methods

clone

clone(): Id3v2UrlLinkFrame

Creates a deep copy of the current instance. This method is implemented by rendering the current instance as an ID3v2.4 frame and using the frame factory to create a new frame. As such, this method should be overridden by child classes.

Returns

Id3v2UrlLinkFrame

Overrides

Id3v2Frame.clone


fieldData

Protected fieldData(frameData, offset, version, dataIncludesHeader): ByteVector

Extracts the field data from the raw portion of an ID3v2 frame. This method is necessary for extracting extra data prepended to the frame such the as grouping ID.

Parameters

Name Type Description
frameData ByteVector Raw frame data
offset number Index at which the data is contained
version number Version of the ID3v2 tag the data was originally encoded with
dataIncludesHeader boolean true if frameData includes the header, false otherwise

Returns

ByteVector

Inherited from

Id3v2Frame.fieldData


parseFields

Protected parseFields(data, version): void

Populates the values in this frame by parsing its field data in a specified version.

Parameters

Name Type Description
data ByteVector Extracted field data
version number ID3v2 version the field data is encoded in

Returns

void

Overrides

Id3v2Frame.parseFields


parseRawData

Protected parseRawData(): void

Performs the actual parsing of the raw data.

Remarks

Because of the high parsing cost and relatively low usage of the class, parseFields only stores the field data, so it can be parsed on demand. Whenever a property or method is called which requires the data, this method is called, and only on the first call does it actually parse the data.

Returns

void


render

render(version): ByteVector

Renders the current instance, encoded in a specified ID3v2 version.

Parameters

Name Type Description
version number Version of ID3v2 to use when encoding the current instance

Returns

ByteVector

Inherited from

Id3v2Frame.render


renderFields

Protected renderFields(version): ByteVector

Renders the values in the current instance into field data for a specified version.

Parameters

Name Type Description
version number ID3v2 version the field data is to be encoded in.

Returns

ByteVector

Overrides

Id3v2Frame.renderFields


setData

Protected setData(data, offset, readHeader, version): void

Populates the current instance by reading the raw frame from disk, optionally reading the header.

Parameters

Name Type Description
data ByteVector Raw ID3v2 frame
offset number Offset in data at which the frame begins.
readHeader boolean Whether or not to read the reader into the current instance.
version number Version of the ID3v2 tag the data was encoded with

Returns

void

Inherited from

Id3v2Frame.setData


toString

toString(): string

Generates a string representation of the URL link frame.

Returns

string


correctEncoding

Static Protected correctEncoding(type, version): StringType

Converts an encoding to be a supported encoding for a specified tag version.

Parameters

Name Type Description
type StringType Value containing the original encoding
version number Value containing the ID3v2 version to be encoded.

Returns

StringType

Value containing the correct encoding to use, based on forceDefaultEncoding and what is supported by version

Inherited from

Id3v2Frame.correctEncoding


findUrlLinkFrame

Static findUrlLinkFrame(frames, ident): Id3v2UrlLinkFrame

Gets the first frame that matches the provided type

Parameters

Name Type Description
frames Id3v2UrlLinkFrame[] Object to search in
ident Id3v2FrameIdentifier Frame identifier to search for

Returns

Id3v2UrlLinkFrame

Frame containing the matching frameId, undefined if a match was not found


fromIdentity

Static fromIdentity(ident): Id3v2UrlLinkFrame

Constructs and initializes an empty frame with the provided frame identity

Parameters

Name Type Description
ident Id3v2FrameIdentifier Identity of the frame to construct

Returns

Id3v2UrlLinkFrame


fromOffsetRawData

Static fromOffsetRawData(data, offset, header, version): Id3v2UrlLinkFrame

Constructs and initializes a new instance by reading its raw data in a specified ID3v2 version. This method allows for offset reading from the data byte vector.

Parameters

Name Type Description
data ByteVector Raw representation of the new frame
offset number What offset in data the frame actually begins. Must be positive, safe integer
header Id3v2FrameHeader Header of the frame found at data in the data
version number ID3v2 version the frame was originally encoded with

Returns

Id3v2UrlLinkFrame


fromRawData

Static fromRawData(data, version): Id3v2UrlLinkFrame

Constructs and initializes a new instance by reading its raw data in a specified ID3v2 version.

Parameters

Name Type Description
data ByteVector Raw representation of the new frame
version number ID3v2 version the raw frame is encoded with, must be a positive 8-bit integer

Returns

Id3v2UrlLinkFrame