Class: Id3v2UserUrlLinkFrame

November 25, 2024 · View on GitHub

node-taglib-sharp / Exports / Id3v2UserUrlLinkFrame

Class: Id3v2UserUrlLinkFrame

Provides support for ID3v2 User URL Link frames (WXXX).

Hierarchy

Table of contents

Properties

Accessors

Methods

Properties

_encoding

Protected _encoding: StringType = StringType.Latin1

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

Inherited from

Id3v2UrlLinkFrame._encoding


_rawData

Protected _rawData: ByteVector

Raw data contents in the current instance.

Inherited from

Id3v2UrlLinkFrame._rawData


_rawVersion

Protected _rawVersion: number

ID3v2 version of the current instance.

Inherited from

Id3v2UrlLinkFrame._rawVersion


_textFields

Protected _textFields: string[] = []

Decoded text contained in the current instance.

Inherited from

Id3v2UrlLinkFrame._textFields

Accessors

description

get description(): string

Gets the description stored in the current instance.

Returns

string

set description(value): void

Sets the description stored in the current instance. There should only be one frame with a matching description per tag.

Parameters

NameType
valuestring

Returns

void


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

UrlLinkFrame.encryptionId

set encryptionId(value): void

Sets the encryption ID applied to the current instance.

Parameters

NameTypeDescription
valuenumberValue 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

UrlLinkFrame.encryptionId


flags

get flags(): Id3v2FrameFlags

Gets the frame flags applied to the current instance.

Returns

Id3v2FrameFlags

Inherited from

UrlLinkFrame.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

NameType
valueId3v2FrameFlags

Returns

void

Inherited from

UrlLinkFrame.flags


frameClassType

get frameClassType(): Id3v2FrameClassType

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

Returns

Id3v2FrameClassType

Overrides

UrlLinkFrame.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

UrlLinkFrame.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

UrlLinkFrame.groupId

set groupId(value): void

Sets the grouping ID applied to the current instance.

Parameters

NameTypeDescription
valuenumberGrouping 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

UrlLinkFrame.groupId


Protected get header(): Id3v2FrameHeader

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

Returns

Id3v2FrameHeader

Inherited from

UrlLinkFrame.header

Protected set header(value): void

Sets the header for the frame.

Parameters

NameTypeDescription
valueId3v2FrameHeaderHeader for the frame

Returns

void

Inherited from

UrlLinkFrame.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

UrlLinkFrame.size


text

get text(): string[]

Gets the text contained in the current instance. NOTE: 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[]

Overrides

UrlLinkFrame.text

set text(value): void

Sets the text contained in the current instance.

Parameters

NameType
valuestring[]

Returns

void

Overrides

UrlLinkFrame.text


textEncoding

get textEncoding(): StringType

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

Returns

StringType

Inherited from

UrlLinkFrame.textEncoding

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

NameType
valueStringType

Returns

void

Inherited from

UrlLinkFrame.textEncoding

Methods

clone

clone(): Id3v2UserUrlLinkFrame

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

Id3v2UserUrlLinkFrame

Overrides

Id3v2UrlLinkFrame.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

NameTypeDescription
frameDataByteVectorRaw frame data
offsetnumberIndex at which the data is contained
versionnumberVersion of the ID3v2 tag the data was originally encoded with
dataIncludesHeaderbooleantrue if frameData includes the header, false otherwise

Returns

ByteVector

Inherited from

Id3v2UrlLinkFrame.fieldData


parseFields

Protected parseFields(data, version): void

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

Parameters

NameTypeDescription
dataByteVectorExtracted field data
versionnumberID3v2 version the field data is encoded in

Returns

void

Inherited from

Id3v2UrlLinkFrame.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

Inherited from

Id3v2UrlLinkFrame.parseRawData


render

render(version): ByteVector

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

Parameters

NameTypeDescription
versionnumberVersion of ID3v2 to use when encoding the current instance

Returns

ByteVector

Inherited from

Id3v2UrlLinkFrame.render


renderFields

Protected renderFields(version): ByteVector

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

Parameters

NameTypeDescription
versionnumberID3v2 version the field data is to be encoded in.

Returns

ByteVector

Inherited from

Id3v2UrlLinkFrame.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

NameTypeDescription
dataByteVectorRaw ID3v2 frame
offsetnumberOffset in data at which the frame begins.
readHeaderbooleanWhether or not to read the reader into the current instance.
versionnumberVersion of the ID3v2 tag the data was encoded with

Returns

void

Inherited from

Id3v2UrlLinkFrame.setData


toString

toString(): string

Generates a string representation of the URL link frame.

Returns

string

Overrides

Id3v2UrlLinkFrame.toString


correctEncoding

Static Protected correctEncoding(type, version): StringType

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

Parameters

NameTypeDescription
typeStringTypeValue containing the original encoding
versionnumberValue 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

Id3v2UrlLinkFrame.correctEncoding


findUrlLinkFrame

Static findUrlLinkFrame(frames, ident): Id3v2UrlLinkFrame

Gets the first frame that matches the provided type

Parameters

NameTypeDescription
framesId3v2UrlLinkFrame[]Object to search in
identId3v2FrameIdentifierFrame identifier to search for

Returns

Id3v2UrlLinkFrame

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

Inherited from

Id3v2UrlLinkFrame.findUrlLinkFrame


findUserUrlLinkFrame

Static findUserUrlLinkFrame(frames, description): Id3v2UserUrlLinkFrame

Gets a frame from a list of frames.

Parameters

NameTypeDescription
framesId3v2UserUrlLinkFrame[]List of frames to search
descriptionstringDescription of the frame to match

Returns

Id3v2UserUrlLinkFrame

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


fromDescription

Static fromDescription(description): Id3v2UserUrlLinkFrame

Constructs and initializes a new instance using the provided description as the text of the frame.

Parameters

NameTypeDescription
descriptionstringDescription to use as text of the frame.

Returns

Id3v2UserUrlLinkFrame


fromIdentity

Static fromIdentity(ident): Id3v2UrlLinkFrame

Constructs and initializes an empty frame with the provided frame identity

Parameters

NameTypeDescription
identId3v2FrameIdentifierIdentity of the frame to construct

Returns

Id3v2UrlLinkFrame

Inherited from

Id3v2UrlLinkFrame.fromIdentity


fromOffsetRawData

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

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

NameTypeDescription
dataByteVectorRaw representation of the new frame
offsetnumberWhat offset in data the frame actually begins. Must be positive, safe integer
headerId3v2FrameHeaderHeader of the frame found at data in the data
versionnumberID3v2 version the frame was originally encoded with

Returns

Id3v2UserUrlLinkFrame

Overrides

Id3v2UrlLinkFrame.fromOffsetRawData


fromRawData

Static fromRawData(data, version): Id3v2UserUrlLinkFrame

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

Parameters

NameTypeDescription
dataByteVectorRaw representation of the new frame
versionnumberID3v2 version the raw frame is encoded with, must be a positive 8-bit integer

Returns

Id3v2UserUrlLinkFrame

Overrides

Id3v2UrlLinkFrame.fromRawData