import { IPicture } from "./picture"; import { Tag, TagTypes } from "./tag"; /** * This class provides a unified way of accessing tag data from multiple tag types. */ export default abstract class CombinedTag extends Tag { private readonly _supportedTagTypes; private readonly _tags; private readonly _writeToAll; /** * Constructs and initializes a new instance of {@link CombinedTag}. * @param supportedTagTypes Types of tags that are supported by this instance of the combined * @param writeToAllTags Whether to write to all tags in the instance (`true`) or to the first * tag in the instance (`false`). * @param tags Optionally, a list of tags to combine in the new instance. */ protected constructor(supportedTagTypes: TagTypes, writeToAllTags: boolean, tags?: Tag[]); /** * Gets all tags contained within the current instance. If the tags within this tag are also * {@link CombinedTag}s, the retrieval will recurse and return a flat list of nested tags. * @remarks Modifications of the returned array will not be retained. */ get tags(): Tag[]; /** * Gets the types of tags that are supported by this instance of a combined tag. Only these tag * types can be added to the instance. */ get supportedTagTypes(): TagTypes; /** @inheritDoc */ get tagTypes(): TagTypes; /** * @inheritDoc * @remarks * Note that tags may not appear contiguously in a file. Access the {@link tags} * contained in this object to see the size of each tag on the disk. */ get sizeOnDisk(): number; /** @inheritDoc */ get title(): string; /** @inheritDoc */ set title(val: string); /** @inheritDoc */ get titleSort(): string; /** @inheritDoc */ set titleSort(val: string); /** @inheritDoc */ get subtitle(): string; /** @inheritDoc */ set subtitle(val: string); /** @inheritDoc */ get description(): string; /** @inheritDoc */ set description(val: string); /** @inheritDoc */ get performers(): string[]; /** @inheritDoc */ set performers(val: string[]); /** @inheritDoc */ get performersSort(): string[]; /** @inheritDoc */ set performersSort(val: string[]); /** @inheritDoc */ get performersRole(): string[]; /** @inheritDoc */ set performersRole(val: string[]); /** @inheritDoc */ get albumArtists(): string[]; /** @inheritDoc */ set albumArtists(val: string[]); /** @inheritDoc */ get albumArtistsSort(): string[]; /** @inheritDoc */ set albumArtistsSort(val: string[]); /** @inheritDoc */ get composers(): string[]; /** @inheritDoc */ set composers(val: string[]); /** @inheritDoc */ get composersSort(): string[]; /** @inheritDoc */ set composersSort(val: string[]); /** @inheritDoc */ get album(): string; /** @inheritDoc */ set album(val: string); /** @inheritDoc */ get albumSort(): string; /** @inheritDoc */ set albumSort(val: string); /** @inheritDoc */ get comment(): string; /** @inheritDoc */ set comment(val: string); /** @inheritDoc */ get genres(): string[]; /** @inheritDoc */ set genres(val: string[]); /** @inheritDoc */ get year(): number; /** @inheritDoc */ set year(val: number); /** @inheritDoc */ get track(): number; /** @inheritDoc */ set track(val: number); /** @inheritDoc */ get trackCount(): number; /** @inheritDoc */ set trackCount(val: number); /** @inheritDoc */ get disc(): number; /** @inheritDoc */ set disc(val: number); /** @inheritDoc */ get discCount(): number; /** @inheritDoc */ set discCount(val: number); /** @inheritDoc */ get lyrics(): string; /** @inheritDoc */ set lyrics(val: string); /** @inheritDoc */ get grouping(): string; /** @inheritDoc */ set grouping(val: string); /** @inheritDoc */ get beatsPerMinute(): number; /** @inheritDoc */ set beatsPerMinute(val: number); /** @inheritDoc */ get conductor(): string; /** @inheritDoc */ set conductor(val: string); /** @inheritDoc */ get copyright(): string; /** @inheritDoc */ set copyright(val: string); /** @inheritDoc */ get dateTagged(): Date; /** @inheritDoc */ set dateTagged(val: Date); /** @inheritDoc */ get musicBrainzArtistId(): string; /** @inheritDoc */ set musicBrainzArtistId(val: string); /** @inheritDoc */ get musicBrainzReleaseGroupId(): string; /** @inheritDoc */ set musicBrainzReleaseGroupId(val: string); /** @inheritDoc */ get musicBrainzReleaseId(): string; /** @inheritDoc */ set musicBrainzReleaseId(val: string); /** @inheritDoc */ get musicBrainzReleaseArtistId(): string; /** @inheritDoc */ set musicBrainzReleaseArtistId(val: string); /** @inheritDoc */ get musicBrainzTrackId(): string; /** @inheritDoc */ set musicBrainzTrackId(val: string); /** @inheritDoc */ get musicBrainzDiscId(): string; /** @inheritDoc */ set musicBrainzDiscId(val: string); /** @inheritDoc */ get musicIpId(): string; /** @inheritDoc */ set musicIpId(val: string); /** @inheritDoc */ get amazonId(): string; /** @inheritDoc */ set amazonId(val: string); /** @inheritDoc */ get musicBrainzReleaseStatus(): string; /** @inheritDoc */ set musicBrainzReleaseStatus(val: string); /** @inheritDoc */ get musicBrainzReleaseType(): string; /** @inheritDoc */ set musicBrainzReleaseType(val: string); /** @inheritDoc */ get musicBrainzReleaseCountry(): string; /** @inheritDoc */ set musicBrainzReleaseCountry(val: string); /** @inheritDoc */ get replayGainTrackGain(): number; /** @inheritDoc */ set replayGainTrackGain(val: number); /** @inheritDoc */ get replayGainTrackPeak(): number; /** @inheritDoc */ set replayGainTrackPeak(val: number); /** @inheritDoc */ get replayGainAlbumGain(): number; /** @inheritDoc */ set replayGainAlbumGain(val: number); /** @inheritDoc */ get replayGainAlbumPeak(): number; /** @inheritDoc */ set replayGainAlbumPeak(val: number); /** @inheritDoc */ get initialKey(): string; /** @inheritDoc */ set initialKey(val: string); /** @inheritDoc */ get remixedBy(): string; /** @inheritDoc */ set remixedBy(val: string); /** @inheritDoc */ get publisher(): string; /** @inheritDoc */ set publisher(val: string); /** @inheritDoc */ get isrc(): string; /** @inheritDoc */ set isrc(val: string); /** @inheritDoc */ get pictures(): IPicture[]; /** @inheritDoc */ set pictures(val: IPicture[]); /** @inheritDoc */ get isCompilation(): boolean; /** @inheritDoc */ set isCompilation(val: boolean); /** @inheritDoc */ get isEmpty(): boolean; /** * @inheritDoc * @remarks Clears all child tags. */ clear(): void; /** * Creates a new instance of the desired tag type and adds it to the current instance. If the * tag type is unsupported in the current context or the tag type already exists, an error will * be thrown. * @param tagType Type of tag to create * @param copy Whether or not to copy the contents of the current instance to the newly created * tag instance * @returns The newly created tag */ abstract createTag(tagType: TagTypes, copy: boolean): Tag; /** * Gets a tag of the specified tag type if a matching tag exists in the current instance. * @param tagType Type of tag to retrieve * @returns Tag with specified type, if it exists. `undefined` otherwise. */ getTag(tagType: TagTypes): TTag; /** * Remove all tags that match the specified tagTypes. This is performed recursively. Any nested * `CombinedTag` instances are left in place. * @param tagTypes Types of tags to remove */ removeTags(tagTypes: TagTypes): void; /** * Adds the provided tag to the list of tags contained in the current instance. * @param tag Tag to add to the current instance. * @protected */ protected addTag(tag: Tag): void; /** * This is used for special cases where the order of tags is important. * @protected */ protected replaceTag(oldTag: Tag, newTag: Tag): void; /** * Verifies if a tag can be added to the current instance. The criteria for validation are: * * A tag of the given tag type does not already exist * * The given tag type is supported by the current instance * @param tagType Tag type that the caller wants to create * @protected */ protected validateTagCreation(tagType: TagTypes): void; private getFirstArray; private getFirstValue; private setUint; private setValues; private isDefaultValue; }