import { StringType } from "../byteVector"; /** * This class contains settings related to ID3v2 tag operations. Open files will need to be * re-read in order for changes to take effect. */ export default class Id3v2Settings { private static _defaultEncoding; private static _defaultVersion; private static _forceDefaultEncoding; private static _forceDefaultVersion; private static _strictFramesForVersion; private static _useNonstandardV2V3GenreSeparators; private static _useNonstandardV2V3NumericGenres; private static _useNumericGenres; /** * Private constructor to prevent inadvertent construction */ private constructor(); /** * Gets the encoding to use when creating new frames. */ static get defaultEncoding(): StringType; /** * Sets the encoding to use when creating new frames. * @param value Encoding to use when creating new frames */ static set defaultEncoding(value: StringType); /** * Gets the default version to use when creating new tags. * If {@link forceDefaultEncoding} is `true` then all tags will be rendered with this version. */ static get defaultVersion(): number; /** * Sets the default version to use when creating new tags. * If {@link forceDefaultEncoding} is `true` then all tags will be rendered with this version. * @param value ID3v2 version to use. Must be 2, 3, or 4. The default for this library is 3 */ static set defaultVersion(value: number); /** * Size of an ID3v2 footer in bytes */ static get footerSize(): number; /** * Gets whether to render all frames with the default encoding rather than their * original encoding. */ static get forceDefaultEncoding(): boolean; /** * Sets whether to render all frames with the default encoding rather than their * original encoding. * @param value If `true` frames will be rendered using {@link defaultEncoding} rather than * their original encoding. */ static set forceDefaultEncoding(value: boolean); /** * Gets whether to save all tags in the default version rather than their original * version. */ static get forceDefaultVersion(): boolean; /** * Sets whether to save all tags in the default version rather than their original * version. * @param value If `true`, tags will be saved in the version defined in {@link defaultVersion} * rather than their original format, except tags with footers which will always be saved * in version 4 */ static set forceDefaultVersion(value: boolean); /** * Size of an ID3v2 header in bytes */ static get headerSize(): number; /** * Gets whether to use ID3v1 style numeric genres when possible. * If `true`, the library will try looking up the numeric genre code when storing the value. * for ID3v2.2 and ID3v2.3 "Rock" would be stored as "(17)" and for ID3v2.4, it would be * stored as "17". */ static get useNumericGenres(): boolean; /** * Sets whether to use ID3v1 style numeric genres when possible. * If `true`, the library will try looking up the numeric genre code when storing the value. * for ID3v2.2 and ID3v2.3 "Rock" would be stored as "(17)" and for ID3v2.4, it would be * stored as "17". * @param value Whether or not to use genres with numeric values when possible */ static set useNumericGenres(value: boolean); /** * Gets whether to use non-standard genre separators on ID3v2.2 and ID3v2.4. * If `true`, the TCO/TCON frame value will be separated by `;` and/or `/`, empty values will * be thrown out. If `false`, the TCO/TCON frame value will be returned as-is (after processing * standard, escaped numeric genres). * @remarks * The official ID3v2 standard makes no mention of separators for genres, one of the * inherent flaws fixed in ID3v2.4. However, various media players, as well as the original * implementation of TagLib#, support using `;` and `/` to separate genres. In order to * maintain compatibility, this functionality is preserved, but can be disabled by setting * {@link useNonStandardV2V3GenreSeparators} to `false`. */ static get useNonStandardV2V3GenreSeparators(): boolean; /** * Sets whether to use non-standard genre separators on ID3v2.2 and ID3v2.3. * If `true`, the TCO/TCON frame value will be separated by `;` and/or `/`, empty values will * be thrown out. If `false`, the TCO/TCON frame value will be returned as-is (after processing * standard, escaped numeric genres). * @remarks * The official ID3v2 standard makes no mention of separators for genres, one of the * inherent flaws fixed in ID3v2.4. However, various media players, as well as the original * implementation of TagLib#, support using `;` and `/` to separate genres. In order to * maintain compatibility, this functionality is preserved, but can be disabled by setting * {@link useNonStandardV2V3GenreSeparators} to `false`. */ static set useNonStandardV2V3GenreSeparators(value: boolean); /** * Gets whether to use non-standard numeric genre parsing on ID3v2.2 and ID3v2.3. If * `true`, a purely numeric TCO/TCON frame value will attempt to be parsed as a numeric genre. * If `false`, the TCO/TCON frame value will be returned without parsing purely numeric genres. * @remarks * The official ID3v2.2/ID3v2.3 standard only supports numeric genres if they are * escaped inside parenthesis (eg, `(12)`). However, the original implementation of TagLib# * allowed ID3v2.2 and ID3v2.3 tags to parse unescaped numeric genres. In order to maintain * compatibility, this functionality is preserved, but can be disabled by setting * {@link useNonStandardV2V3NumericGenres} to `false`. */ static get useNonStandardV2V3NumericGenres(): boolean; /** * Sets whether to use non-standard numeric genre parsing on ID3v2.2 and ID3v2.3. If * `true`, a purely numeric TCO/TCON frame value will attempt to be parsed as a numeric genre. * If `false`, the TCO/TCON frame value will be returned without parsing purely numeric genres. * @remarks * The official ID3v2.2/ID3v2.3 standard only supports numeric genres if they are * escaped inside parenthesis (eg, `(12)`). However, the original implementation of TagLib# * allowed ID3v2.2 and ID3v2.3 tags to parse unescaped numeric genres. In order to maintain * compatibility, this functionality is preserved, but can be disabled by setting * {@link useNonStandardV2V3NumericGenres} to `false`. */ static set useNonStandardV2V3NumericGenres(value: boolean); /** * Gets whether attempting to write a frame that is unsupported in the desired version * will throw an error. * If `true` writing a frame that is not supported in the desired version will throw an error * during the render process. If `false` if a frame is not supported in the desired version it * will be omitted from rendering and no error will be thrown. */ static get strictFrameForVersion(): boolean; /** * Sets whether attempting to write a frame that is unsupported in the desired version * will throw an error. * If `true` writing a frame that is not supported in the desired version will throw an error * during the render process. If `false` if a frame is not supported in the desired version it * will be omitted from rendering and no error will be thrown. */ static set strictFrameForVersion(value: boolean); }