Utilities¶
Object Creation¶
-
struct adm::SimpleObjectHolder¶
Simple holder used as return type for
createSimpleObject()
andaddSimpleObjectTo()
.Gives access to all elements created by
createSimpleObject()
. This exists basically to give quick and convenient direct access to the elements after creation.Public Members
-
std::shared_ptr<AudioObject> audioObject¶
-
std::shared_ptr<AudioPackFormat> audioPackFormat¶
-
std::shared_ptr<AudioChannelFormat> audioChannelFormat¶
-
std::shared_ptr<AudioStreamFormat> audioStreamFormat¶
-
std::shared_ptr<AudioTrackFormat> audioTrackFormat¶
-
std::shared_ptr<AudioTrackUid> audioTrackUid¶
-
std::shared_ptr<AudioObject> audioObject¶
-
SimpleObjectHolder adm::createSimpleObject(const std::string &name)¶
Create
AudioObject
hierarchie for singleTypeDefinition::OBJECTS
-type element.Creates an
AudioObject
including referencedAudioPackFormat
andAudioChannelFormat
of typeTypeDefinition::OBJECTS
, as well anAudioTrackUid
, the referencedAudioTrackFormat
andAudioStreamFormat
of typeFormatDefinition::PCM
.- Parameters
name – Name that will be used for the created
Audio{Object,PackFormat,ChannelFormat}
.
Create and add
AudioObject
hierarchie for singleTypeDefinition::OBJECTS
-type element.same as
createSimpleObject
, but the elements are automatically added to the given document
-
struct adm::SimpleCommonDefinitionsObjectHolder¶
Simple holder used as return type for
addSimpleCommonDefinitionsObjectTo()
.Gives access to all elements created by
addSimpleCommonDefinitionsObjectTo()
. This exists basically to give quick and convenient direct access to the elements after creation.Public Members
-
std::shared_ptr<AudioObject> audioObject¶
-
std::map<std::string, std::shared_ptr<AudioTrackUid>> audioTrackUids¶
a mapping from the short speaker label (e.g.
M+000
) to the audioTrackUid
-
std::shared_ptr<AudioObject> audioObject¶
Create and add
AudioObject
with common definitions direct speakers channel bed to document.Creates an
AudioObject
and correspondingAudioTrackUids
and connects it to the common definition ADM elements for the given speaker layout. The created ADM elements are added to the given document.- See
adm::audioPackFormatLookupTable
Note
The document must already have the common definition elements added.
- Parameters
document – The document where the
AudioObject
and theAudioTrackUids
should be added to and whose common definition ADM elements should be used.name – Name that will be used for the created
AudioObject
.speakerLayout – Speaker layout which will be created. For possible values
Create and add
AudioObject
with common definitions direct speakers channel bed to document with a given channel order.Creates an
AudioObject
and correspondingAudioTrackUids
and connects it to the common definition ADM elements for the given speaker layout. The created ADM elements are added to the given document.Note
The document must already have the common definition elements added.
- Parameters
document – The document where the
AudioObject
and theAudioTrackUids
should be added to and whose common definition ADM elements should be used.name – Name that will be used for the created
AudioObject
.packFormatId – AudioPackFormatId of the given layout.
trackFormatIds – AudioTrackFormatIds of all the speakers in the layout.
speakerLabels – Labels of all the speakers in the layout.
audioBlockFormat timing fixes¶
Set or update durations of all
AudioBlockFormats
This function provides essentially the same functionality as adm::updateBlockFormatDurations(std::shared_ptr<Document>, std::chrono::nanoseconds), with the only difference that the duration of the
AudioProgramme
will be to determine the lifetime ofAudioObject
s.- See
void updateBlockFormatDurations(std::shared_ptr<Document>, std::chrono::nanoseconds)
- Parameters
document – The document to update, durations will be adapted in-place.
Set or update durations of all
AudioBlockFormats
If an
AudioChannelFormat
has multipleAudioBlockFormats
, all of them should have anrtime
and aduration
.As these durations might be linked to the duration of referencing
AudioObject
s, the length of the parentAudioProgramme
and/or the length of a BW64 file, it is hard or impossible to set the correct duration duringAudioBlockFormat
creation.This utility function will update the
AudioBlockFormat
durations to match the lifetime of the referencingAudioObject
(s) or, if not set, the length of the audio file given byfileLength
.An exception will be raised if there’s any ambiguity in the resulting duration, for example due to multiple
AudioObject
s with different durations referencing the sameAudioChannelFormat
. Differences between the duration of anAudioProgramme
andfileLength
will also be considered an error. If one of those error conditions is met (and an exception is raised), theadm::Document
will remain unchanged.- Parameters
document – The document to update, durations will be adapted in-place.
fileLength – The length of the BW64 audio file