Utilities¶
-
struct
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>
-
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 createdAudio{Object,PackFormat,ChannelFormat}
.
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.- See
- Parameters
document
: The document to update, durations will be adapted in-place.fileLength
: The length of the BW64 audio file