node-taglib-sharp / Exports / AsfExtendedContentDescriptionObject
This class provides a representation of an ASF extended contend description object which can be read from and written to disk.
-
↳
AsfExtendedContentDescriptionObject
- addDescriptor
- getDescriptors
- initializeFromFile
- initializeFromGuid
- removeDescriptors
- render
- renderInternal
- setDescriptors
- fromEmpty
- fromFile
• get
descriptors(): AsfContentDescriptor
[]
Gets all descriptors stored in the current instance.
• get
guid(): UuidWrapper
Gets the GUID that identifies the current instance.
BaseObject.guid
• get
isEmpty(): boolean
Gets whether the current instance contains any records.
boolean
true
if the current instance does not contain any records, false
otherwise.
• get
objectType(): AsfObjectType
Gets the type of the object for easy comparison.
BaseObject.objectType
• get
originalSize(): number
Gets the original size of the current instance.
number
BaseObject.originalSize
▸ addDescriptor(descriptor
): void
Adds a descriptor to the current instance.
Name | Type | Description |
---|---|---|
descriptor |
AsfContentDescriptor |
Record to add to the current instance |
void
▸ getDescriptors(...names
): AsfContentDescriptor
[]
Gets all descriptors with a name matching one of the provided collection of names the current instance.
Name | Type | Description |
---|---|---|
...names |
string [] |
List of names of the records to return |
▸ Protected
initializeFromFile(file
, position
): void
Initializes a new instance by reading the contents from a specified position in a specified file.
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 |
void
AsfBaseObject.initializeFromFile
▸ Protected
initializeFromGuid(guid
): void
Initializes a new instance with a specified GUID.
Name | Type | Description |
---|---|---|
guid |
UuidWrapper |
GUID to use for the new instance. |
void
AsfBaseObject.initializeFromGuid
▸ removeDescriptors(name
): void
Removes all descriptors with a given name from the current instance.
Name | Type | Description |
---|---|---|
name |
string |
Name of the descriptor to be removed |
void
▸ render(): ByteVector
Renders the current instance as a raw ASF object.
▸ 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.
Name | Type | Description |
---|---|---|
data |
ByteVector |
Data to store in the rendered version of the current instance. |
▸ setDescriptors(name
, ...descriptors
): void
Sets a collection of descriptors 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.
Name | Type | Description |
---|---|---|
name |
string |
Name of the descriptors to be added/removed |
...descriptors |
AsfContentDescriptor [] |
Descriptors to add to the new instance |
void
▸ Static
fromEmpty(): AsfExtendedContentDescriptionObject
Constructs and initializes a new, empty extended content description object.
AsfExtendedContentDescriptionObject
▸ Static
fromFile(file
, position
): AsfExtendedContentDescriptionObject
Constructs and initializes a new instance that is read in from the provided file at the provided position.
Name | Type | Description |
---|---|---|
file |
File |
File to read the instance from. Must not be falsey |
position |
number |
Position in the file where the instance begins. Must be a positive, safe integer. |