import { ByteVector, StringType } from "../../byteVector"; import { Frame, FrameClassType } from "./frame"; import { Id3v2FrameHeader } from "./frameHeader"; /** * Extends {@link Frame} implementing support for ID3v2 unsynchronized lyrics (USLT) frames. */ export default class UnsynchronizedLyricsFrame extends Frame { private _description; private _language; private _text; private _textEncoding; private constructor(); /** * Constructs and initializes a new instance from the provided data * @param description Description of the frame * @param language ISO-639-2 language code for the content of the frame * @param encoding Encoding to use when storing the content of the frame */ static fromData(description: string, language?: string, encoding?: StringType): UnsynchronizedLyricsFrame; /** * 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. * @param data Raw representation of the new frame * @param offset What offset in `data` the frame actually begins. Must be positive, * safe integer * @param header Header of the frame found at `data` in the data * @param version ID3v2 version the frame was originally encoded with */ static fromOffsetRawData(data: ByteVector, offset: number, header: Id3v2FrameHeader, version: number): UnsynchronizedLyricsFrame; /** * Constructs and initializes a new instance by reading its raw data in a specified * ID3v2 version. * @param data Raw representation of the new frame * @param version ID3v2 version the raw frame is encoded with, must be a positive 8-bit integer */ static fromRawData(data: ByteVector, version: number): UnsynchronizedLyricsFrame; /** @inheritDoc */ get frameClassType(): FrameClassType; /** * Gets the description of the contents of the current instance. */ get description(): string; /** * Sets the description of the contents of the current instance. * There should only be one frame with this description and ISO-639-2 code per tag. */ set description(value: string); /** * Gets the ISO-639-2 language code for the contents of this instance. */ get language(): string; /** * Sets the ISO-639-2 language code for the contents of this instance. */ set language(value: string); /** * Gets the text stored in the current instance. */ get text(): string; /** * Sets the text stored in the current instance. */ set text(value: string); /** * Gets the text encoding to use when storing the current instance. */ get textEncoding(): StringType; /** * Sets the text encoding to use when storing the current instance. */ set textEncoding(value: StringType); /** * Gets the first unsynchronized lyrics frame from a list of frames that matches the provided * parameters. * @param frames List of frames to search * @param description Description to match * @param language Optionally, ISO-639-2 language code to match * @returns Frame that matches provided parameters, `undefined` if a match was not found */ static find(frames: UnsynchronizedLyricsFrame[], description: string, language: string): UnsynchronizedLyricsFrame; /** * Gets all unsynchronized lyrics frames that match the provided parameters from a list of * frames * @param frames List of frames to search * @param description Description to match * @param language Optionally, ISO-639-2 language code to match * @returns List of frames matching provided parameters, empty array if no matches were found */ static findAll(frames: UnsynchronizedLyricsFrame[], description: string, language: string): UnsynchronizedLyricsFrame[]; /** * Gets a specified unsynchronized frame from the list of frames, trying to match the * description and language but, failing a perfect match, accepting an incomplete match. * The method tries matching with the following order of precedence: * * First frame with a matching description and language * * First frame with a matching language * * First frame with a matching description * * First frame * @param frames List of frames to search * @param description Description to match * @param language ISO-639-2 language code to match */ static findPreferred(frames: UnsynchronizedLyricsFrame[], description: string, language: string): UnsynchronizedLyricsFrame; /** @inheritDoc */ clone(): Frame; /** * Generates a string representation of the current instance. */ toString(): string; /** @inheritDoc */ protected parseFields(data: ByteVector): void; /** @inheritDoc */ protected renderFields(version: number): ByteVector; }