Class: Id3v2MusicCdIdentifierFrame
November 25, 2024 · View on GitHub
node-taglib-sharp / Exports / Id3v2MusicCdIdentifierFrame
Class: Id3v2MusicCdIdentifierFrame
Class extends Frame, implementing support for ID3v2 Music CD Identifier (MCDI) frames. Music CD identifier frames should contain the table of contents data as stored on the physical CD. It is primarily used for track information lookup through web sources like CDDB.
Hierarchy
-
↳
Id3v2MusicCdIdentifierFrame
Table of contents
Accessors
Methods
- clone
- fieldData
- parseFields
- render
- renderFields
- setData
- correctEncoding
- fromOffsetRawData
- fromRawData
Accessors
data
• get data(): ByteVector
Gets the identifier data stored in the current instance
Returns
• set data(value): void
Sets the identifier data stored in the current instance
Parameters
| Name | Type | Description |
|---|---|---|
value | ByteVector | ByteVector containing the identifier stored in the current instance |
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
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
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
Overrides
Frame.frameClassType
frameId
• get frameId(): Id3v2FrameIdentifier
Gets the frame ID for the current instance.
Returns
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
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
Methods
clone
▸ clone(): Id3v2Frame
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
Overrides
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
Inherited from
parseFields
▸ Protected parseFields(data): 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 |
Returns
void
Overrides
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
Inherited from
renderFields
▸ Protected renderFields(): ByteVector
Renders the values in the current instance into field data for a specified version.
Returns
Overrides
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
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
Value containing the correct encoding to use, based on
forceDefaultEncoding and what is supported by
version
Inherited from
fromOffsetRawData
▸ Static fromOffsetRawData(data, offset, header, version): Id3v2MusicCdIdentifierFrame
Constructs and initializes a new instance of MusicCdIdentifier frame by reading its raw data in a specified ID3v2 version starting at a specified offset.
Parameters
| Name | Type | Description |
|---|---|---|
data | ByteVector | Raw representation of the new frame. |
offset | number | Offset into data where the frame actually begins. Must be a positive, safe integer |
header | Id3v2FrameHeader | Header of the frame found at offset in the data |
version | number | ID3v2 version the frame was originally encoded with |
Returns
fromRawData
▸ Static fromRawData(data, version): Id3v2MusicCdIdentifierFrame
Constructs and initializes a new instance of MusicCdIdentifierFrame by reading its raw data in a specified ID3v2 version.
Parameters
| Name | Type | Description |
|---|---|---|
data | ByteVector | ByteVector object starting with the raw representation of the new frame |
version | number | The ID3v2 version the raw frame is encoded in. Must be positive 8-bit integer |