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
AudioObjecthierarchie for singleTypeDefinition::OBJECTS-type element.Creates an
AudioObjectincluding referencedAudioPackFormatandAudioChannelFormatof typeTypeDefinition::OBJECTS, as well anAudioTrackUid, the referencedAudioTrackFormatandAudioStreamFormatof typeFormatDefinition::PCM.- Parameters
name – Name that will be used for the created
Audio{Object,PackFormat,ChannelFormat}.
Create and add
AudioObjecthierarchie 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
AudioObjectwith common definitions direct speakers channel bed to document.Creates an
AudioObjectand correspondingAudioTrackUidsand 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
AudioObjectand theAudioTrackUidsshould 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
AudioObjectwith common definitions direct speakers channel bed to document with a given channel order.Creates an
AudioObjectand correspondingAudioTrackUidsand 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
AudioObjectand theAudioTrackUidsshould 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
AudioBlockFormatsThis 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
AudioProgrammewill be to determine the lifetime ofAudioObjects.- 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
AudioBlockFormatsIf an
AudioChannelFormathas multipleAudioBlockFormats, all of them should have anrtimeand aduration.As these durations might be linked to the duration of referencing
AudioObjects, the length of the parentAudioProgrammeand/or the length of a BW64 file, it is hard or impossible to set the correct duration duringAudioBlockFormatcreation.This utility function will update the
AudioBlockFormatdurations 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
AudioObjects with different durations referencing the sameAudioChannelFormat. Differences between the duration of anAudioProgrammeandfileLengthwill also be considered an error. If one of those error conditions is met (and an exception is raised), theadm::Documentwill remain unchanged.- Parameters
document – The document to update, durations will be adapted in-place.
fileLength – The length of the BW64 audio file