node-taglib-sharp / Exports / Id3v2UserUrlLinkFrame
Provides support for ID3v2 User URL Link frames (WXXX).
-
↳
Id3v2UserUrlLinkFrame
- clone
- fieldData
- parseFields
- parseRawData
- render
- renderFields
- setData
- toString
- correctEncoding
- findUrlLinkFrame
- findUserUrlLinkFrame
- fromDescription
- fromIdentity
- fromOffsetRawData
- fromRawData
• Protected _encoding: StringType = StringType.Latin1
Text encoding to use to store the text contents of the current instance.
• Protected _rawData: ByteVector
Raw data contents in the current instance.
• Protected _rawVersion: number
ID3v2 version of the current instance.
• Protected _textFields: string[] = []
Decoded text contained in the current instance.
• get description(): string
Gets the description stored in the current instance.
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.
| Name | Type |
|---|---|
value |
string |
void
• get encryptionId(): number
Gets the encryption ID applied to the current instance.
number
Value containing the encryption identifier for the current instance or
undefined if not set.
UrlLinkFrame.encryptionId
• set encryptionId(value): void
Sets the encryption ID applied to the current instance.
| 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 |
void
UrlLinkFrame.encryptionId
• get flags(): Id3v2FrameFlags
Gets the frame flags applied to the current instance.
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.
| Name | Type |
|---|---|
value |
Id3v2FrameFlags |
void
UrlLinkFrame.flags
• get frameClassType(): Id3v2FrameClassType
Gets a flag indicating which type of frame the current instance is.
UrlLinkFrame.frameClassType
• get frameId(): Id3v2FrameIdentifier
Gets the frame ID for the current instance.
Object representing of the identifier of the frame
UrlLinkFrame.frameId
• get groupId(): number
Gets the grouping ID applied to the current instance.
number
Value containing the grouping identifier for the current instance, or
undefined if not set.
UrlLinkFrame.groupId
• set groupId(value): void
Sets the grouping ID applied to the current instance.
| 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 |
void
UrlLinkFrame.groupId
• Protected get header(): Id3v2FrameHeader
Gets the header for the frame. For new frames this should not exist.
UrlLinkFrame.header
• Protected set header(value): void
Sets the header for the frame.
| Name | Type | Description |
|---|---|---|
value |
Id3v2FrameHeader |
Header for the frame |
void
UrlLinkFrame.header
• 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.
number
UrlLinkFrame.size
• 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.
string[]
UrlLinkFrame.text
• set text(value): void
Sets the text contained in the current instance.
| Name | Type |
|---|---|
value |
string[] |
void
UrlLinkFrame.text
• get textEncoding(): StringType
Gets the text encoding to use when rendering the current instance.
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.
| Name | Type |
|---|---|
value |
StringType |
void
UrlLinkFrame.textEncoding
▸ 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.
▸ 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.
| 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 |
▸ Protected parseFields(data, version): void
Populates the values in this frame by parsing its field data in a specified version.
| Name | Type | Description |
|---|---|---|
data |
ByteVector |
Extracted field data |
version |
number |
ID3v2 version the field data is encoded in |
void
▸ 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.
void
Id3v2UrlLinkFrame.parseRawData
▸ render(version): ByteVector
Renders the current instance, encoded in a specified ID3v2 version.
| Name | Type | Description |
|---|---|---|
version |
number |
Version of ID3v2 to use when encoding the current instance |
▸ Protected renderFields(version): ByteVector
Renders the values in the current instance into field data for a specified version.
| Name | Type | Description |
|---|---|---|
version |
number |
ID3v2 version the field data is to be encoded in. |
Id3v2UrlLinkFrame.renderFields
▸ Protected setData(data, offset, readHeader, version): void
Populates the current instance by reading the raw frame from disk, optionally reading the header.
| 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 |
void
▸ toString(): string
Generates a string representation of the URL link frame.
string
▸ Static Protected correctEncoding(type, version): StringType
Converts an encoding to be a supported encoding for a specified tag version.
| Name | Type | Description |
|---|---|---|
type |
StringType |
Value containing the original encoding |
version |
number |
Value containing the ID3v2 version to be encoded. |
Value containing the correct encoding to use, based on
forceDefaultEncoding and what is supported by
version
Id3v2UrlLinkFrame.correctEncoding
▸ Static findUrlLinkFrame(frames, ident): Id3v2UrlLinkFrame
Gets the first frame that matches the provided type
| Name | Type | Description |
|---|---|---|
frames |
Id3v2UrlLinkFrame[] |
Object to search in |
ident |
Id3v2FrameIdentifier |
Frame identifier to search for |
Frame containing the matching frameId, undefined if a match was not found
Id3v2UrlLinkFrame.findUrlLinkFrame
▸ Static findUserUrlLinkFrame(frames, description): Id3v2UserUrlLinkFrame
Gets a frame from a list of frames.
| Name | Type | Description |
|---|---|---|
frames |
Id3v2UserUrlLinkFrame[] |
List of frames to search |
description |
string |
Description of the frame to match |
Frame containing the matching user, undefined if a match was not found
▸ Static fromDescription(description): Id3v2UserUrlLinkFrame
Constructs and initializes a new instance using the provided description as the text of the frame.
| Name | Type | Description |
|---|---|---|
description |
string |
Description to use as text of the frame. |
▸ Static fromIdentity(ident): Id3v2UrlLinkFrame
Constructs and initializes an empty frame with the provided frame identity
| Name | Type | Description |
|---|---|---|
ident |
Id3v2FrameIdentifier |
Identity of the frame to construct |
Id3v2UrlLinkFrame.fromIdentity
▸ 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.
| 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 |
Id3v2UrlLinkFrame.fromOffsetRawData
▸ Static fromRawData(data, version): Id3v2UserUrlLinkFrame
Constructs and initializes a new instance by reading its raw data in a specified ID3v2 version.
| 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 |