Class: AsfMetadataLibraryObject
November 25, 2024 · View on GitHub
node-taglib-sharp / Exports / AsfMetadataLibraryObject
Class: AsfMetadataLibraryObject
This class provides a representation of an ASF metadata library object which can be read from and written to disk.
Hierarchy
-
↳
AsfMetadataLibraryObject
Table of contents
Accessors
Methods
- addRecord
- getRecords
- initializeFromFile
- initializeFromGuid
- removeRecords
- render
- renderInternal
- setRecords
- fromEmpty
- fromFile
Accessors
guid
• get guid(): UuidWrapper
Gets the GUID that identifies the current instance.
Returns
Inherited from
BaseObject.guid
isEmpty
• get isEmpty(): boolean
Gets whether the current instance contains any records.
Returns
boolean
true if the current instance does not contain any records, false
otherwise.
objectType
• get objectType(): AsfObjectType
Gets the type of the object for easy comparison.
Returns
Overrides
BaseObject.objectType
originalSize
• get originalSize(): number
Gets the original size of the current instance.
Returns
number
Inherited from
BaseObject.originalSize
records
• get records(): AsfMetadataDescriptor[]
Gets all records stored in the current instance.
Returns
Methods
addRecord
▸ addRecord(record): void
Adds a record to the current instance.
Parameters
| Name | Type | Description |
|---|---|---|
record | AsfMetadataDescriptor | Record to add to the current instance |
Returns
void
getRecords
▸ getRecords(languageListIndex, streamNumber, ...names): AsfMetadataDescriptor[]
Gets all records with a given language, stream, and any of a collection of names from the current instance.
Parameters
| Name | Type | Description |
|---|---|---|
languageListIndex | number | Index of the desired language in the language list |
streamNumber | number | Index of the stream in the file the desired records applies to |
...names | string[] | List of names of the records to return |
Returns
initializeFromFile
▸ Protected initializeFromFile(file, position): void
Initializes a new instance by reading the contents from a specified position in a specified file.
Parameters
| Name | Type | Description |
|---|---|---|
file | File | File which contains the details of the new instance to create |
position | number | Position in file where the object begins |
Returns
void
Inherited from
AsfBaseObject.initializeFromFile
initializeFromGuid
▸ Protected initializeFromGuid(guid): void
Initializes a new instance with a specified GUID.
Parameters
| Name | Type | Description |
|---|---|---|
guid | UuidWrapper | GUID to use for the new instance. |
Returns
void
Inherited from
AsfBaseObject.initializeFromGuid
removeRecords
▸ removeRecords(languageListIndex, streamNumber, name): void
Removes all records with a given language, stream, and name from the current instance.
Parameters
| Name | Type | Description |
|---|---|---|
languageListIndex | number | Language list index of the records to be removed |
streamNumber | number | Index of the stream in the file the desired records to remove |
name | string | Name of the records to remove |
Returns
void
render
▸ render(): ByteVector
Renders the current instance as a raw ASF object.
Returns
Overrides
renderInternal
▸ Protected renderInternal(data): ByteVector
Renders the current instance as a raw ASF object containing the specified data.
Remarks
Child classes implementing () should render their contents and then send the data through this method to produce the final output.
Parameters
| Name | Type | Description |
|---|---|---|
data | ByteVector | Data to store in the rendered version of the current instance. |
Returns
Inherited from
setRecords
▸ setRecords(languageListIndex, streamNumber, name, ...records): void
Sets a collection of records for a given language, language, ane name, removing the existing records that match.
Remarks
All added entries in records should match the provided languageListIndex,
streamNumber, and name, but this will not be verified by the method. The records
will be added with their own values and not those provided in the method arguments. The
arguments are only used for removing existing values and determining where to position
the new records.
Parameters
| Name | Type | Description |
|---|---|---|
languageListIndex | number | Index of the desired language in the language list |
streamNumber | number | Index of the stream in the file the desired records applies to |
name | string | Names of the records to remove |
...records | AsfMetadataDescriptor[] | Records to insert into the current instance |
Returns
void
fromEmpty
▸ Static fromEmpty(): AsfMetadataLibraryObject
Constructs and initializes a new instance that does not contain any records.
Returns
fromFile
▸ Static fromFile(file, position): AsfMetadataLibraryObject
Constructs and initializes a new instance by reading the object from a file.
Parameters
| Name | Type | Description |
|---|---|---|
file | File | File to read the instance from |
position | number | Offset into the file where the object begins |