import ContentDescriptionObject from "./objects/contentDescriptionObject"; import HeaderObject from "./objects/headerObject"; import { ByteVector } from "../byteVector"; import { ContentDescriptor, ExtendedContentDescriptionObject } from "./objects/extendedContentDescriptionObject"; import { IPicture, Picture } from "../picture"; import { MetadataLibraryObject } from "./objects/metadataLibraryObject"; import { Tag, TagTypes } from "../tag"; /** * This class extends {@link Tag} to provide a representation of an ASF tag which can be read from * and written to disk. */ export default class AsfTag extends Tag { private _contentDescriptionObject; private _extendedDescriptionObject; private _metadataLibraryObject; private static readonly GENRE_REGEX; private constructor(); /** * Constructs and initializes a new, empty instance. */ static fromEmpty(): AsfTag; /** * Constructs and initializes a new instance using the children of a {@link HeaderObject} * object. * @param header Header object whose children will be used to populate the new instance */ static fromHeader(header: HeaderObject): AsfTag; /** * Gets the ASF content description object used by the current instance. */ get contentDescriptionObject(): ContentDescriptionObject; /** * Gets the ASF extended content description used by the current instance. */ get extendedContentDescriptionObject(): ExtendedContentDescriptionObject; /** * Gets the ASF metadata library object used by the current instance. */ get metadataLibraryObject(): MetadataLibraryObject; /** @inheritDoc */ get tagTypes(): TagTypes; /** @inheritDoc */ get sizeOnDisk(): number; /** * @inheritDoc * @remarks Stored in the content description object */ get title(): string; /** * @inheritDoc * @remarks Stored in the content description object */ set title(value: string); /** * @inheritDoc * @remarks * Stored in the `WM/SubTitle` descriptor * https://msdn.microsoft.com/en-us/library/windows/desktop/dd757997(v=vs.85).aspx */ get subtitle(): string; /** * @inheritDoc * @remarks * Stored in the `WM/SubTitle` descriptor * https://msdn.microsoft.com/en-us/library/windows/desktop/dd757997(v=vs.85).aspx */ set subtitle(value: string); /** * @inheritDoc * @remarks * Stored in the `WM/TitleSortOrder` * http://msdn.microsoft.com/en-us/library/aa386866(VS.85).aspx */ get titleSort(): string; /** * @inheritDoc * @remarks * Stored in the `WM/TitleSortOrder` * http://msdn.microsoft.com/en-us/library/aa386866(VS.85).aspx */ set titleSort(value: string); /** * @inheritDoc * @remarks * Stored in the {@link ContentDescriptionObject.description} * Some applications will use this field for storing comments. */ get description(): string; /** * @inheritDoc * @remarks * Stored in the {@link ContentDescriptionObject.description} * Some applications will use this field for storing comments. */ set description(value: string); /** * @inheritDoc * @remarks Stored in the {@link ContentDescriptionObject.author} */ get performers(): string[]; /** * @inheritDoc * @remarks Stored in the {@link ContentDescriptionObject.author} */ set performers(value: string[]); /** * @inheritDoc * @remarks * Stored in the `WM/ArtistSortOrder` descriptor * http://msdn.microsoft.com/en-us/library/aa386866(VS.85).aspx */ get performersSort(): string[]; /** * @inheritDoc * @remarks * Stored in the `WM/ArtistSortOrder` descriptor * http://msdn.microsoft.com/en-us/library/aa386866(VS.85).aspx */ set performersSort(value: string[]); /** * @inheritDoc * @remarks Stored in the `WM/AlbumArtist` or `AlbumArtist` descriptors */ get albumArtists(): string[]; /** * @inheritDoc * @remarks Stored in the `WM/AlbumArtist` or `AlbumArtist` descriptors */ set albumArtists(value: string[]); /** * @inheritDoc * @remarks * Stored in the `WM/AlbumArtistSortOrder` descriptor * http://msdn.microsoft.com/en-us/library/aa386866(VS.85).aspx */ get albumArtistsSort(): string[]; /** * @inheritDoc * @remarks * Stored in the `WM/AlbumArtistSortOrder` descriptor * http://msdn.microsoft.com/en-us/library/aa386866(VS.85).aspx */ set albumArtistsSort(value: string[]); /** * @inheritDoc * @remarks * Stored in the `WM/Composer` or `Composer` descriptors * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-composer */ get composers(): string[]; /** * @inheritDoc * @remarks * Stored in the `WM/Composer` or `Composer` descriptors * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-composer */ set composers(value: string[]); /** * @inheritDoc * @remarks * Stored in the `WM/AlbumTitle` or `Album` descriptors * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-albumtitle */ get album(): string; /** * @inheritDoc * @remarks * Stored in the `WM/AlbumTitle` or `Album` descriptors * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-albumtitle */ set album(value: string); /** * @inheritDoc * @remarks Stored in the `WM/AlbumSortOrder` descriptors */ get albumSort(): string; /** * @inheritDoc * @remarks Stored in the `WM/AlbumSortOrder` descriptors */ set albumSort(value: string); /** * @inheritDoc * @remarks * Stored in the `WM/Text` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-text * It should be noted that many applications store comments in the field read by * {@link description}. */ get comment(): string; /** * @inheritDoc * @remarks * Stored in the `WM/Text` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-text * It should be noted that many applications store comments in the field read by * {@link description}. */ set comment(value: string); /** * @inheritDoc * @remarks * Stored in the `WM/Genre`, `WM/GenreID`, or `Genre` descriptors * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-genre * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-genreid */ get genres(): string[]; /** * @inheritDoc * @remarks * Stored in the `WM/Genre`, `WM/GenreID`, or `Genre` descriptors * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-genre * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-genreid */ set genres(value: string[]); /** * @inheritDoc * @remarks * Stored in the `WM/Year` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-year */ get year(): number; /** * @inheritDoc * @remarks * Stored in the `WM/Year` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-year */ set year(value: number); /** * @inheritDoc * @remarks * Stored in the `WM/TrackNumber` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-tracknumber */ get track(): number; /** * @inheritDoc * @remarks * Stored in the `WM/TrackNumber` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-tracknumber */ set track(value: number); /** * @inheritDoc * @remarks Stored in the `TrackTotal` descriptor */ get trackCount(): number; /** * @inheritDoc * @remarks Stored in the `TrackTotal` descriptor */ set trackCount(value: number); /** * @inheritDoc * @remarks * Stored in the `WM/PartOfSet` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-partofset */ get disc(): number; /** * @inheritDoc * @remarks * Stored in the `WM/PartOfSet` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-partofset */ set disc(value: number); /** * @inheritDoc * @remarks * Stored in the `WM/PartOfSet` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-partofset */ get discCount(): number; /** * @inheritDoc * @remarks * Stored in the `WM/PartOfSet` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-partofset */ set discCount(value: number); /** * @inheritDoc * @remarks * Stored in the `WM/Lyrics` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-lyrics */ get lyrics(): string; /** * @inheritDoc * @remarks * Stored in the `WM/Lyrics` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-lyrics */ set lyrics(value: string); /** * @inheritDoc * @remarks * Stored in the `WM/ContentGroupDescription` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-contentgroupdescription */ get grouping(): string; /** * @inheritDoc * @remarks * Stored in the `WM/ContentGroupDescription` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-contentgroupdescription */ set grouping(value: string); /** * @inheritDoc * @remarks * Stored in the `WM/BeatsPerMinute` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-beatsperminute */ get beatsPerMinute(): number; /** * @inheritDoc * @remarks * Stored in the `WM/BeatsPerMinute` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-beatsperminute */ set beatsPerMinute(value: number); /** * @inheritDoc * @remarks * Stored in the `WM/Conductor` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-conductor */ get conductor(): string; /** * @inheritDoc * @remarks * Stored in the `WM/Conductor` descriptor * https://docs.microsoft.com/en-us/windows/win32/wmformat/wm-conductor */ set conductor(value: string); /** * @inheritDoc * @remarks Stored in the {@link ContentDescriptionObject.copyright} */ get copyright(): string; /** * @inheritDoc * @remarks Stored in the {@link ContentDescriptionObject.copyright} */ set copyright(value: string); /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Artist Id` descriptor */ get musicBrainzArtistId(): string; /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Artist Id` descriptor */ set musicBrainzArtistId(value: string); /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Release Group Id` descriptor */ get musicBrainzReleaseGroupId(): string; /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Release Group Id` descriptor */ set musicBrainzReleaseGroupId(value: string); /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Album Id` descriptor */ get musicBrainzReleaseId(): string; /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Album Id` descriptor */ set musicBrainzReleaseId(value: string); /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Album Artist Id` descriptor */ get musicBrainzAlbumArtistId(): string; /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Artist Id` descriptor */ set musicBrainzAlbumArtistId(value: string); /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Track Id` descriptor */ get musicBrainzTrackId(): string; /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Track Id` descriptor */ set musicBrainzTrackId(value: string); /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Disc Id` descriptor */ get musicBrainzDiscId(): string; /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Disc Id` descriptor */ set musicBrainzDiscId(value: string); /** * @inheritDoc * @remarks Stored in the `MusicIP/PUID` descriptor */ get musicIpId(): string; /** * @inheritDoc * @remarks Stored in the `MusicIP/PUID` descriptor */ set musicIpId(value: string); /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Album Status` descriptor */ get musicBrainzReleaseStatus(): string; /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Album Status` descriptor */ set musicBrainzReleaseStatus(value: string); /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Album Type` descriptor */ get musicBrainzReleaseType(): string; /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Album Type` descriptor */ set musicBrainzReleaseType(value: string); /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Album Release Country` descriptor */ get musicBrainzReleaseCountry(): string; /** * @inheritDoc * @remarks Stored in the `MusicBrainz/Album Release Country` descriptor */ set musicBrainzReleaseCountry(value: string); /** * @inheritDoc * @remarks Stored in the `ReplayGain/Track` descriptor */ get replayGainTrackGain(): number; /** * @inheritDoc * @remarks Stored in the `ReplayGain/Track` descriptor */ set replayGainTrackGain(value: number); /** * @inheritDoc * @remarks Stored in the `ReplayGain/Track Peak` descriptor */ get replayGainTrackPeak(): number; /** * @inheritDoc * @remarks Stored in the `ReplayGain/Track Peak` descriptor */ set replayGainTrackPeak(value: number); /** * @inheritDoc * @remarks Stored in the `ReplayGain/Album` descriptor */ get replayGainAlbumGain(): number; /** * @inheritDoc * @remarks Stored in the `ReplayGain/Album` descriptor */ set replayGainAlbumGain(value: number); /** * @inheritDoc * @remarks Stored in the `ReplayGain/Album Peak` descriptor */ get replayGainAlbumPeak(): number; /** * @inheritDoc * @remarks Stored in the `ReplayGain/Album Peak` descriptor */ set replayGainAlbumPeak(value: number); /** * @inheritDoc * @remarks * Stored in the `WM/Picture` content descriptor and description record. * https://docs.microsoft.com/en-us/windows/win32/wmformat/wmpicture * Modifications to the returned array will not be stored. */ get pictures(): IPicture[]; /** * @inheritDoc * @remarks * Stored in the `WM/Picture` content descriptor and description record. * https://docs.microsoft.com/en-us/windows/win32/wmformat/wmpicture */ set pictures(value: IPicture[]); /** @inheritDoc */ get isEmpty(): boolean; /** * Adds a descriptor to the current instance's extended content description object. * @param descriptor Content descriptor to add to the current instance. Must be truthy */ addDescriptor(descriptor: ContentDescriptor): void; /** @inheritDoc */ clear(): void; /** * Gets all descriptors in the extended description object with names matching any of the names * in the provided collection of names. * @param names Collection of names to search the extended description object for */ getDescriptors(...names: string[]): ContentDescriptor[]; /** * Gets the string contained in a specific descriptor from the extended content description * object in the current instance. * @param names Names of the descriptors to look for * @returns * The contents of the first descriptor found whose name is in the provided * collection of descriptor names */ getDescriptorString(...names: string[]): string; /** * Gets the unsigned integer contained in a specific descriptor from the extended content * description object in the current instance. * @param names Names of the descriptors to look for * @returns * The contents of the first descriptor found whose name is in the provided * collection of descriptor names */ getDescriptorUint(...names: string[]): number; /** * Gets the strings contained in a specific descriptor from the extended content description * object in the current instance, as split by `;`. * @param names Names of the descriptors to look for * @returns * The contents of the first descriptor found whose name is in the provided * collection of descriptor names, split by `;` */ getDescriptorStrings(...names: string[]): string[]; /** * Removes all descriptors with a specified name from the extended content description object * in the current instance. * @param name Name of the descriptor to remove rom the current instance */ removeDescriptors(name: string): void; /** * Sets a collection of descriptors in the extended content description object for a given * name, removing the existing matching records. * @remarks * All added descriptors should have their name set to `name` but this is not * verified by the method. The descriptors will be added with their own names and not the * one provided as an argument, which is only used for removing existing values and * determining where to position the new descriptors. * @param name Name of the descriptors to be added/removed * @param descriptors Descriptors to add to the new instance */ setDescriptors(name: string, ...descriptors: ContentDescriptor[]): void; /** * Sets the string for a collection of descriptors in the current instance. * @remarks * The value will be stored in the first value in `names` and the rest of the * descriptors with the matching names will be cleared. * @param value Value to store or `undefined` to clear the value * @param names Names in which the value would be expected. For example, `WM/AlbumTitle` and * `Album` */ setDescriptorString(value: string, ...names: string[]): void; /** * Sets the strings for a collection of descriptors in the current instance. The strings will * be stored as a single string, joined together with `; `. * @remarks * The value will be stored in the first value in `names` and the rest of the * descriptors with the matching names will be cleared. * @param value Value to store or `undefined` to clear the value * @param names Names in which the value would be expected. For example, `WM/AlbumTitle` and * `Album` */ setDescriptorStrings(value: string[], ...names: string[]): void; /** @internal */ static pictureFromData(data: ByteVector): Picture; /** @internal */ static pictureToData(picture: IPicture): ByteVector; private static splitAndClean; }