Tag Parser  6.4.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Media::AbstractContainer Class Reference

The AbstractContainer class provides an interface and common functionality to parse and make a certain container format. More...

#include <abstractcontainer.h>

Inheritance diagram for Media::AbstractContainer:
[legend]
Collaboration diagram for Media::AbstractContainer:
[legend]

Public Member Functions

virtual ~AbstractContainer ()
 Destroys the container. More...
 
std::iostream & stream ()
 Returns the related stream. More...
 
void setStream (std::iostream &stream)
 Sets the related stream. More...
 
uint64 startOffset () const
 Returns the start offset in the related stream. More...
 
IoUtilities::BinaryReader & reader ()
 Returns the related BinaryReader. More...
 
IoUtilities::BinaryWriter & writer ()
 Returns the related BinaryWriter. More...
 
void parseHeader ()
 Parses the header if not parsed yet. More...
 
void parseTags ()
 Parses the tag information if not parsed yet. More...
 
void parseTracks ()
 Parses the tracks of the file if not parsed yet. More...
 
void parseChapters ()
 Parses the chapters of the file if not parsed yet. More...
 
void parseAttachments ()
 Parses the attachments of the file if not parsed yet. More...
 
void makeFile ()
 Rewrites the file to apply changed tag information. More...
 
bool isHeaderParsed () const
 Returns an indication whether the header has been parsed yet. More...
 
bool areTagsParsed () const
 Returns an indication whether the tags have been parsed yet. More...
 
bool areTracksParsed () const
 Returns an indication whether the tracks have been parsed yet. More...
 
bool areChaptersParsed () const
 Returns an indication whether the chapters have been parsed yet. More...
 
bool areAttachmentsParsed () const
 Returns an indication whether the attachments have been parsed yet. More...
 
virtual TagcreateTag (const TagTarget &target=TagTarget())
 Creates and returns a tag for the specified target. More...
 
virtual Tagtag (std::size_t index)
 Returns the tag with the specified index. More...
 
virtual std::size_t tagCount () const
 Returns the number of tags attached to the container. More...
 
virtual bool removeTag (Tag *tag)
 Removes the specified tag from the container. More...
 
virtual void removeAllTags ()
 Removes all tags attached to the container. More...
 
virtual ElementPosition determineTagPosition () const
 Determines the position of the tags inside the file. More...
 
virtual AbstractTracktrack (std::size_t index)
 Returns the track with the specified index. More...
 
virtual std::size_t trackCount () const
 Returns the number of tracks the container holds. More...
 
virtual bool removeTrack (AbstractTrack *track)
 Removes the specified track to the container. More...
 
virtual void removeAllTracks ()
 Removes all tracks from the container. More...
 
virtual bool supportsTrackModifications () const
 Returns whether the implementation supports adding or removing of tracks. More...
 
virtual ElementPosition determineIndexPosition () const
 Determines the position of the index. More...
 
virtual AbstractChapterchapter (std::size_t index)
 Returns the chapter with the specified index. More...
 
virtual std::size_t chapterCount () const
 Returns the number of chapters the container holds. More...
 
virtual AbstractAttachmentcreateAttachment ()
 Creates and returns a new attachment. More...
 
virtual AbstractAttachmentattachment (std::size_t index)
 Returns the attachment with the specified index. More...
 
virtual std::size_t attachmentCount () const
 Returns the number of attachments the container holds. More...
 
uint64 version () const
 Returns the version if known; otherwise returns 0. More...
 
uint64 readVersion () const
 Returns the "read version" if known; otherwise returns 0. More...
 
const std::string & documentType () const
 Returns a string that describes the document type if available; otherwise returns an empty string. More...
 
uint64 doctypeVersion () const
 Returns the document type version if known; otherwise returns 0. More...
 
uint64 doctypeReadVersion () const
 Returns the document type "read version" if known; otherwise returns 0. More...
 
const std::vector< std::string > & titles () const
 Returns the title(s) of the file. More...
 
void setTitle (const std::string &title, std::size_t segmentIndex=0)
 Sets the title for the specified segment. More...
 
virtual bool supportsTitle () const
 Returns whether the title property is supported. More...
 
virtual std::size_t segmentCount () const
 Returns the number of segments. More...
 
ChronoUtilities::TimeSpan duration () const
 Returns the duration of the file if known; otherwise returns a time span of zero ticks. More...
 
ChronoUtilities::DateTime creationTime () const
 Returns the creation time of the file if known; otherwise the returned date time is null. More...
 
ChronoUtilities::DateTime modificationTime () const
 Returns the modification time of the file if known; otherwise the returned date time is null. More...
 
uint32 timeScale () const
 Returns the time scale of the file if known; otherwise returns 0. More...
 
virtual void reset ()
 Discards all parsing results. More...
 
- Public Member Functions inherited from Media::StatusProvider
const NotificationListnotifications () const
 Returns notifications for the current object. More...
 
bool hasNotifications () const
 Returns an indication whether there are notifications for the current object. More...
 
bool hasCriticalNotifications () const
 Returns an indication whether there are critical notifications for the current object. More...
 
NotificationType worstNotificationType () const
 Returns the worst notification type. More...
 
const std::string & currentStatus () const
 Returns a status information for the current object. More...
 
double currentPercentage () const
 Returns the progress percentage of the current object. More...
 
size_t registerCallback (CallbackFunction callback)
 Registers a callback function. More...
 
void unregisterCallback (size_t id)
 Unregisters a previously registered callback function whith the specified id. More...
 
void unregisterAllCallbacks ()
 Unregisters all callback functions. More...
 
void forwardStatusUpdateCalls (StatusProvider *other=nullptr)
 Forwards all status updates calls to the specified statusProvider. More...
 
StatusProviderusedProvider ()
 Returns the provider which callback functions will be called when the status or the percentage is updated. More...
 
void tryToAbort ()
 Commands the object to abort the current operation. More...
 
bool isAborted () const
 Returns an indication whether the current operation should be aborted. More...
 
void invalidateStatus ()
 Invalidates the current status. More...
 
void invalidateNotifications ()
 Invalidates the object's notifications. More...
 
void updateStatus (const std::string &status)
 This method is meant to be called by the derived class to report updated status information. More...
 
void updateStatus (const std::string &status, double percentage)
 This method is meant to be called by the derived class to report updated status information. More...
 
void updatePercentage (double percentage)
 This method is meant to be called by the derived class to report updated progress percentage only. More...
 
void addNotification (const Notification &notification)
 This method is meant to be called by the derived class to add a notification. More...
 
void addNotification (NotificationType type, const std::string &message, const std::string &context)
 This method is meant to be called by the derived class to add a notification of the specified type, message and context. More...
 
void addNotifications (const StatusProvider &from)
 This method is meant to be called by the derived class to add all notifications from another StatusProvider instance. More...
 
void addNotifications (const std::string &higherContext, const StatusProvider &from)
 This method is meant to be called by the derived class to add all notifications from another StatusProvider instance. More...
 
void addNotifications (const NotificationList &notifications)
 This method is meant to be called by the derived class to add the specified notifications. More...
 

Protected Member Functions

 AbstractContainer (std::iostream &stream, uint64 startOffset)
 Constructs a new container for the specified file stream at the specified startOffset. More...
 
virtual void internalParseHeader ()
 Internally called to parse the header. More...
 
virtual void internalParseTags ()
 Internally called to parse the tags. More...
 
virtual void internalParseTracks ()
 Internally called to parse the tracks. More...
 
virtual void internalParseChapters ()
 Internally called to parse the chapters. More...
 
virtual void internalParseAttachments ()
 Internally called to parse the attachments. More...
 
virtual void internalMakeFile ()
 Internally called to make the file. More...
 
- Protected Member Functions inherited from Media::StatusProvider
 StatusProvider ()
 Constructs a new StatusProvider. More...
 

Protected Attributes

uint64 m_version
 
uint64 m_readVersion
 
std::string m_doctype
 
uint64 m_doctypeVersion
 
uint64 m_doctypeReadVersion
 
std::vector< std::string > m_titles
 
ChronoUtilities::TimeSpan m_duration
 
ChronoUtilities::DateTime m_creationTime
 
ChronoUtilities::DateTime m_modificationTime
 
uint32 m_timeScale
 
bool m_headerParsed
 
bool m_tagsParsed
 
bool m_tracksParsed
 
bool m_tracksAltered
 
bool m_chaptersParsed
 
bool m_attachmentsParsed
 

Additional Inherited Members

- Public Types inherited from Media::StatusProvider
typedef std::function< void(StatusProvider &sender)> CallbackFunction
 
typedef std::vector< CallbackFunctionCallbackVector
 
typedef std::pair< int, CallbackFunctionCallbackPair
 

Detailed Description

The AbstractContainer class provides an interface and common functionality to parse and make a certain container format.

Definition at line 34 of file abstractcontainer.h.

Constructor & Destructor Documentation

◆ ~AbstractContainer()

Media::AbstractContainer::~AbstractContainer ( )
virtual

Destroys the container.

Destroys the reader, the writer and track, tag, chapter and attachment objects as well. Does NOT destroy the stream which has been specified when constructing the object.

Definition at line 42 of file abstractcontainer.cpp.

◆ AbstractContainer()

Media::AbstractContainer::AbstractContainer ( std::iostream &  stream,
uint64  startOffset 
)
protected

Constructs a new container for the specified file stream at the specified startOffset.

Definition at line 18 of file abstractcontainer.cpp.

Member Function Documentation

◆ areAttachmentsParsed()

bool Media::AbstractContainer::areAttachmentsParsed ( ) const
inline

Returns an indication whether the attachments have been parsed yet.

Definition at line 199 of file abstractcontainer.h.

◆ areChaptersParsed()

bool Media::AbstractContainer::areChaptersParsed ( ) const
inline

Returns an indication whether the chapters have been parsed yet.

Definition at line 191 of file abstractcontainer.h.

◆ areTagsParsed()

bool Media::AbstractContainer::areTagsParsed ( ) const
inline

Returns an indication whether the tags have been parsed yet.

Definition at line 183 of file abstractcontainer.h.

◆ areTracksParsed()

bool Media::AbstractContainer::areTracksParsed ( ) const
inline

Returns an indication whether the tracks have been parsed yet.

Definition at line 207 of file abstractcontainer.h.

◆ attachment()

AbstractAttachment * Media::AbstractContainer::attachment ( std::size_t  index)
virtual

Returns the attachment with the specified index.

index must be less than attachmentCount().

Reimplemented in Media::MatroskaContainer.

Definition at line 432 of file abstractcontainer.cpp.

◆ attachmentCount()

size_t Media::AbstractContainer::attachmentCount ( ) const
virtual

Returns the number of attachments the container holds.

Reimplemented in Media::MatroskaContainer.

Definition at line 440 of file abstractcontainer.cpp.

◆ chapter()

AbstractChapter * Media::AbstractContainer::chapter ( std::size_t  index)
virtual

Returns the chapter with the specified index.

index must be less than chapterCount().

Reimplemented in Media::MatroskaContainer.

Definition at line 404 of file abstractcontainer.cpp.

◆ chapterCount()

size_t Media::AbstractContainer::chapterCount ( ) const
virtual

Returns the number of chapters the container holds.

Reimplemented in Media::MatroskaContainer.

Definition at line 412 of file abstractcontainer.cpp.

◆ createAttachment()

AbstractAttachment * Media::AbstractContainer::createAttachment ( )
virtual

Creates and returns a new attachment.

Returns
Returns the created attachment.
Remarks
The container keeps the ownership over the created attachment.

Reimplemented in Media::MatroskaContainer.

Definition at line 422 of file abstractcontainer.cpp.

◆ createTag()

Tag * Media::AbstractContainer::createTag ( const TagTarget target = TagTarget())
virtual

Creates and returns a tag for the specified target.

Remarks
  • If there is already a tag (for the specified target) present, no new tag will be created. The present tag will be returned instead.
  • If an empty target is specified it will be ignored.
  • If targets aren't supported the specified target will be ignored.
  • If no tag could be created, nullptr is returned.
  • The container keeps the ownership over the created tag.

Reimplemented in Media::OggContainer, Media::GenericContainer< FileInfoType, TagType, TrackType, ElementType >, Media::GenericContainer< MediaFileInfo, OggVorbisComment, OggStream, OggPage >, Media::GenericContainer< MediaFileInfo, MatroskaTag, MatroskaTrack, EbmlElement >, and Media::GenericContainer< MediaFileInfo, Mp4Tag, Mp4Track, Mp4Atom >.

Definition at line 276 of file abstractcontainer.cpp.

◆ creationTime()

ChronoUtilities::DateTime Media::AbstractContainer::creationTime ( ) const
inline

Returns the creation time of the file if known; otherwise the returned date time is null.

Definition at line 291 of file abstractcontainer.h.

◆ determineIndexPosition()

ElementPosition Media::AbstractContainer::determineIndexPosition ( ) const
virtual

Determines the position of the index.

Returns
Returns ElementPosition::BeforeData or ElementPosition::AfterData if the position could be determined; otherwise returns ElementPosition::Keep.
Remarks
  • It might be required to parse tracks before the index position can be determined.
  • Not be applicable for files composed of multiple segments.
See also
MediaFileInfo::indexPosition()

Reimplemented in Media::MatroskaContainer, and Media::Mp4Container.

Definition at line 183 of file abstractcontainer.cpp.

◆ determineTagPosition()

ElementPosition Media::AbstractContainer::determineTagPosition ( ) const
virtual

Determines the position of the tags inside the file.

Returns
Returns ElementPosition::BeforeData or ElementPosition::AfterData if the position could be determined; otherwise returns ElementPosition::Keep.
Remarks
  • It might be required to parse tags before the tag position can be determined.
  • Not be applicable for files composed of multiple segments.
See also
MediaFileInfo::tagPosition()

Reimplemented in Media::MatroskaContainer, and Media::Mp4Container.

Definition at line 341 of file abstractcontainer.cpp.

◆ doctypeReadVersion()

uint64 Media::AbstractContainer::doctypeReadVersion ( ) const
inline

Returns the document type "read version" if known; otherwise returns 0.

This is the minimum version an interpreter has to support to read the file.

Definition at line 251 of file abstractcontainer.h.

◆ doctypeVersion()

uint64 Media::AbstractContainer::doctypeVersion ( ) const
inline

Returns the document type version if known; otherwise returns 0.

Definition at line 241 of file abstractcontainer.h.

◆ documentType()

const std::string & Media::AbstractContainer::documentType ( ) const
inline

Returns a string that describes the document type if available; otherwise returns an empty string.

Definition at line 233 of file abstractcontainer.h.

◆ duration()

ChronoUtilities::TimeSpan Media::AbstractContainer::duration ( ) const
inline

Returns the duration of the file if known; otherwise returns a time span of zero ticks.

Definition at line 283 of file abstractcontainer.h.

◆ internalMakeFile()

void Media::AbstractContainer::internalMakeFile ( )
protectedvirtual

Internally called to make the file.

Must be implemented when subclassing.

Exceptions
ThrowsFailure or a derived class when a parsing error occurs.
Throwsstd::ios_base::failure when an IO error occurs.

Reimplemented in Media::OggContainer, Media::MatroskaContainer, and Media::Mp4Container.

Definition at line 261 of file abstractcontainer.cpp.

◆ internalParseAttachments()

void Media::AbstractContainer::internalParseAttachments ( )
protectedvirtual

Internally called to parse the attachments.

Must be implemented when subclassing to provide this feature.

Exceptions
ThrowsFailure or a derived class when a parsing error occurs.
Throwsstd::ios_base::failure when an IO error occurs.

Reimplemented in Media::MatroskaContainer.

Definition at line 248 of file abstractcontainer.cpp.

◆ internalParseChapters()

void Media::AbstractContainer::internalParseChapters ( )
protectedvirtual

Internally called to parse the chapters.

Must be implemented when subclassing to provide this feature.

Exceptions
ThrowsFailure or a derived class when a parsing error occurs.
Throwsstd::ios_base::failure when an IO error occurs.

Reimplemented in Media::MatroskaContainer.

Definition at line 235 of file abstractcontainer.cpp.

◆ internalParseHeader()

void Media::AbstractContainer::internalParseHeader ( )
protectedvirtual

Internally called to parse the header.

Must be implemented when subclassing to provide this feature.

Exceptions
ThrowsFailure or a derived class when a parsing error occurs.
Throwsstd::ios_base::failure when an IO error occurs.

Reimplemented in Media::OggContainer, Media::MatroskaContainer, and Media::Mp4Container.

Definition at line 196 of file abstractcontainer.cpp.

◆ internalParseTags()

void Media::AbstractContainer::internalParseTags ( )
protectedvirtual

Internally called to parse the tags.

Must be implemented when subclassing to provide this feature.

Exceptions
ThrowsFailure or a derived class when a parsing error occurs.
Throwsstd::ios_base::failure when an IO error occurs.

Reimplemented in Media::OggContainer, Media::MatroskaContainer, and Media::Mp4Container.

Definition at line 209 of file abstractcontainer.cpp.

◆ internalParseTracks()

void Media::AbstractContainer::internalParseTracks ( )
protectedvirtual

Internally called to parse the tracks.

Must be implemented when subclassing to provide this feature.

Exceptions
ThrowsFailure or a derived class when a parsing error occurs.
Throwsstd::ios_base::failure when an IO error occurs.

Reimplemented in Media::OggContainer, Media::MatroskaContainer, and Media::Mp4Container.

Definition at line 222 of file abstractcontainer.cpp.

◆ isHeaderParsed()

bool Media::AbstractContainer::isHeaderParsed ( ) const
inline

Returns an indication whether the header has been parsed yet.

Definition at line 175 of file abstractcontainer.h.

◆ makeFile()

void Media::AbstractContainer::makeFile ( )

Rewrites the file to apply changed tag information.

Exceptions
Throwsstd::ios_base::failure when an IO error occurs.
ThrowsMedia::Failure or a derived exception when a making error occurs.

Definition at line 161 of file abstractcontainer.cpp.

◆ modificationTime()

ChronoUtilities::DateTime Media::AbstractContainer::modificationTime ( ) const
inline

Returns the modification time of the file if known; otherwise the returned date time is null.

Definition at line 299 of file abstractcontainer.h.

◆ parseAttachments()

void Media::AbstractContainer::parseAttachments ( )

Parses the attachments of the file if not parsed yet.

The information will be read from the associated stream. The stream and the start offset have been specified when constructing the object.

Exceptions
Throwsstd::ios_base::failure when an IO error occurs.
ThrowsMedia::Failure or a derived exception when a parsing error occurs.

Definition at line 145 of file abstractcontainer.cpp.

◆ parseChapters()

void Media::AbstractContainer::parseChapters ( )

Parses the chapters of the file if not parsed yet.

The information will be read from the associated stream. The stream and the start offset have been specified when constructing the object.

Exceptions
Throwsstd::ios_base::failure when an IO error occurs.
ThrowsMedia::Failure or a derived exception when a parsing error occurs.

Definition at line 126 of file abstractcontainer.cpp.

◆ parseHeader()

void Media::AbstractContainer::parseHeader ( )

Parses the header if not parsed yet.

The information will be read from the associated stream. The stream and the start offset have been specified when constructing the object.

Exceptions
Throwsstd::ios_base::failure when an IO error occurs.
ThrowsFailure or a derived class when an parsing error occurs.

Definition at line 54 of file abstractcontainer.cpp.

◆ parseTags()

void Media::AbstractContainer::parseTags ( )

Parses the tag information if not parsed yet.

The header will be parsed before if not parsed yet.

The information will be read from the associated stream. The stream and the start offset have been specified when constructing the object.

Exceptions
Throwsstd::ios_base::failure when an IO error occurs.
ThrowsFailure or a derived class when an parsing error occurs.
See also
parseHeader()
parseTracks()
parseAttachments()
parseChapters()
tags()

Definition at line 82 of file abstractcontainer.cpp.

◆ parseTracks()

void Media::AbstractContainer::parseTracks ( )

Parses the tracks of the file if not parsed yet.

The header will be parsed before if not parsed yet.

The information will be read from the associated stream. The stream and the start offset have been specified when constructing the object.

Exceptions
Throwsstd::ios_base::failure when an IO error occurs.
ThrowsFailure or a derived class when an parsing error occurs.
See also
parseHeader()
parseTags()
tracks()

Definition at line 106 of file abstractcontainer.cpp.

◆ reader()

IoUtilities::BinaryReader & Media::AbstractContainer::reader ( )
inline

Returns the related BinaryReader.

Definition at line 159 of file abstractcontainer.h.

◆ readVersion()

uint64 Media::AbstractContainer::readVersion ( ) const
inline

Returns the "read version" if known; otherwise returns 0.

This is the minimum version a parser has to support to read the file.

Definition at line 225 of file abstractcontainer.h.

◆ removeAllTags()

void Media::AbstractContainer::removeAllTags ( )
virtual

Removes all tags attached to the container.

The tags need to be parsed before they can be removed.

See also
areTagsParsed()
parseTags()
Remarks
The current tag objects are destroyed. All pointers obtained by calling tag() are invalidated.

Reimplemented in Media::OggContainer, Media::GenericContainer< FileInfoType, TagType, TrackType, ElementType >, Media::GenericContainer< MediaFileInfo, OggVorbisComment, OggStream, OggPage >, Media::GenericContainer< MediaFileInfo, MatroskaTag, MatroskaTrack, EbmlElement >, and Media::GenericContainer< MediaFileInfo, Mp4Tag, Mp4Track, Mp4Atom >.

Definition at line 329 of file abstractcontainer.cpp.

◆ removeAllTracks()

void Media::AbstractContainer::removeAllTracks ( )
virtual

Removes all tracks from the container.

Modifying tracks might be not supported by the implementation.

See also
supportsTrackModifications()

The tracks need to be parsed before they can be removed.

See also
areTracksParsed()
parseTracks()
Remarks
The current track objects are destroyed. All pointers obtained by calling track() are invalidated.

Reimplemented in Media::GenericContainer< FileInfoType, TagType, TrackType, ElementType >, Media::GenericContainer< MediaFileInfo, OggVorbisComment, OggStream, OggPage >, Media::GenericContainer< MediaFileInfo, MatroskaTag, MatroskaTrack, EbmlElement >, and Media::GenericContainer< MediaFileInfo, Mp4Tag, Mp4Track, Mp4Atom >.

Definition at line 396 of file abstractcontainer.cpp.

◆ removeTag()

bool Media::AbstractContainer::removeTag ( Tag tag)
virtual

Removes the specified tag from the container.

Does nothing if the tag is not attached to the container.

The tags need to be parsed before a removal is possible.

See also
areTagsParsed()
parseTags()
Remarks
The tag is not destroyed. The ownership is transfered to the caller.
Returns
Returns whether the tag could be removed.

Reimplemented in Media::OggContainer, Media::GenericContainer< FileInfoType, TagType, TrackType, ElementType >, Media::GenericContainer< MediaFileInfo, OggVorbisComment, OggStream, OggPage >, Media::GenericContainer< MediaFileInfo, MatroskaTag, MatroskaTrack, EbmlElement >, and Media::GenericContainer< MediaFileInfo, Mp4Tag, Mp4Track, Mp4Atom >.

Definition at line 314 of file abstractcontainer.cpp.

◆ removeTrack()

bool Media::AbstractContainer::removeTrack ( AbstractTrack track)
virtual

Removes the specified track to the container.

Removal of tracks might be not supported by the implementation.

See also
supportsTrackModifications()

The tracks need to be parsed before a removal is possible.

See also
areTracksParsed()
parseTracks()
Remarks
The track is not destroyed. The ownership is transfered to the caller.
Returns
Returns whether the track could be removed.

Reimplemented in Media::GenericContainer< FileInfoType, TagType, TrackType, ElementType >, Media::GenericContainer< MediaFileInfo, OggVorbisComment, OggStream, OggPage >, Media::GenericContainer< MediaFileInfo, MatroskaTag, MatroskaTrack, EbmlElement >, and Media::GenericContainer< MediaFileInfo, Mp4Tag, Mp4Track, Mp4Atom >.

Definition at line 378 of file abstractcontainer.cpp.

◆ reset()

void Media::AbstractContainer::reset ( )
virtual

◆ segmentCount()

size_t Media::AbstractContainer::segmentCount ( ) const
virtual

Returns the number of segments.

Reimplemented in Media::MatroskaContainer.

Definition at line 456 of file abstractcontainer.cpp.

◆ setStream()

void Media::AbstractContainer::setStream ( std::iostream &  stream)
inline

Sets the related stream.

Definition at line 141 of file abstractcontainer.h.

◆ setTitle()

void Media::AbstractContainer::setTitle ( const std::string &  title,
std::size_t  segmentIndex = 0 
)
inline

Sets the title for the specified segment.

Remarks
The title is ignored if it is not supported by the concrete container format.
Exceptions
Throwsout_of_range if the segment does not exist.
See also
titles()

Definition at line 275 of file abstractcontainer.h.

◆ startOffset()

uint64 Media::AbstractContainer::startOffset ( ) const
inline

Returns the start offset in the related stream.

Definition at line 151 of file abstractcontainer.h.

◆ stream()

std::iostream & Media::AbstractContainer::stream ( )
inline

Returns the related stream.

Definition at line 133 of file abstractcontainer.h.

◆ supportsTitle()

bool Media::AbstractContainer::supportsTitle ( ) const
virtual

Returns whether the title property is supported.

Reimplemented in Media::MatroskaContainer.

Definition at line 448 of file abstractcontainer.cpp.

◆ supportsTrackModifications()

bool Media::AbstractContainer::supportsTrackModifications ( ) const
virtual

Returns whether the implementation supports adding or removing of tracks.

Reimplemented in Media::Mp4Container.

Definition at line 169 of file abstractcontainer.cpp.

◆ tag()

Tag * Media::AbstractContainer::tag ( std::size_t  index)
virtual

◆ tagCount()

size_t Media::AbstractContainer::tagCount ( ) const
virtual

◆ timeScale()

uint32 Media::AbstractContainer::timeScale ( ) const
inline

Returns the time scale of the file if known; otherwise returns 0.

Definition at line 307 of file abstractcontainer.h.

◆ titles()

const std::vector< std::string > & Media::AbstractContainer::titles ( ) const
inline

Returns the title(s) of the file.

Remarks
  • If the container does not support titles an empty vector will be returned.
  • If there are multiple segments, the title of each segment is returned.
See also
setTitle()

Definition at line 264 of file abstractcontainer.h.

◆ track()

AbstractTrack * Media::AbstractContainer::track ( std::size_t  index)
virtual

◆ trackCount()

size_t Media::AbstractContainer::trackCount ( ) const
virtual

◆ version()

uint64 Media::AbstractContainer::version ( ) const
inline

Returns the version if known; otherwise returns 0.

Definition at line 215 of file abstractcontainer.h.

◆ writer()

IoUtilities::BinaryWriter & Media::AbstractContainer::writer ( )
inline

Returns the related BinaryWriter.

Definition at line 167 of file abstractcontainer.h.

Member Data Documentation

◆ m_attachmentsParsed

bool Media::AbstractContainer::m_attachmentsParsed
protected

Definition at line 121 of file abstractcontainer.h.

◆ m_chaptersParsed

bool Media::AbstractContainer::m_chaptersParsed
protected

Definition at line 120 of file abstractcontainer.h.

◆ m_creationTime

ChronoUtilities::DateTime Media::AbstractContainer::m_creationTime
protected

Definition at line 112 of file abstractcontainer.h.

◆ m_doctype

std::string Media::AbstractContainer::m_doctype
protected

Definition at line 107 of file abstractcontainer.h.

◆ m_doctypeReadVersion

uint64 Media::AbstractContainer::m_doctypeReadVersion
protected

Definition at line 109 of file abstractcontainer.h.

◆ m_doctypeVersion

uint64 Media::AbstractContainer::m_doctypeVersion
protected

Definition at line 108 of file abstractcontainer.h.

◆ m_duration

ChronoUtilities::TimeSpan Media::AbstractContainer::m_duration
protected

Definition at line 111 of file abstractcontainer.h.

◆ m_headerParsed

bool Media::AbstractContainer::m_headerParsed
protected

Definition at line 116 of file abstractcontainer.h.

◆ m_modificationTime

ChronoUtilities::DateTime Media::AbstractContainer::m_modificationTime
protected

Definition at line 113 of file abstractcontainer.h.

◆ m_readVersion

uint64 Media::AbstractContainer::m_readVersion
protected

Definition at line 106 of file abstractcontainer.h.

◆ m_tagsParsed

bool Media::AbstractContainer::m_tagsParsed
protected

Definition at line 117 of file abstractcontainer.h.

◆ m_timeScale

uint32 Media::AbstractContainer::m_timeScale
protected

Definition at line 114 of file abstractcontainer.h.

◆ m_titles

std::vector<std::string> Media::AbstractContainer::m_titles
protected

Definition at line 110 of file abstractcontainer.h.

◆ m_tracksAltered

bool Media::AbstractContainer::m_tracksAltered
protected

Definition at line 119 of file abstractcontainer.h.

◆ m_tracksParsed

bool Media::AbstractContainer::m_tracksParsed
protected

Definition at line 118 of file abstractcontainer.h.

◆ m_version

uint64 Media::AbstractContainer::m_version
protected

Definition at line 105 of file abstractcontainer.h.


The documentation for this class was generated from the following files: