Tag Parser  6.2.2
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::AbstractChapter Class Referenceabstract

The AbstractChapter class parses chapter information. More...

#include <abstractchapter.h>

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

Public Member Functions

virtual ~AbstractChapter ()
 Destroys the chapter. More...
 
uint64 id () const
 Returns the chapter ID if known; otherwise returns zero. More...
 
const std::vector< LocaleAwareString > & names () const
 Returns the chapter name. More...
 
ChronoUtilities::TimeSpan startTime () const
 Returns the start time if known; otherwise returns a negative time span. More...
 
ChronoUtilities::TimeSpan endTime () const
 Returns the end time if known; otherwise returns a negative time span. More...
 
const std::vector< uint64 > & tracks () const
 Returns a list of tracks on which the chapter applies. More...
 
bool isHidden () const
 Returns whether the chapter is flagged as hidden. More...
 
bool isEnabled () const
 Returns whether the chapter is flagged as enabled. More...
 
std::string label () const
 Returns a label for the chapter. More...
 
virtual AbstractChapternestedChapter (std::size_t index)
 Returns the nested chapter with the specified index. More...
 
virtual const AbstractChapternestedChapter (std::size_t index) const
 Returns the nested chapter with the specified index. More...
 
virtual std::size_t nestedChapterCount () const
 Returns the number of nested chapters. More...
 
virtual void clear ()
 Resets the object to its initial state. More...
 
void parse ()
 Parses the chapter. More...
 
void parseNested ()
 Parses the chapter and nested chapters recursively. 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 protected 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 protected 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 protected 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 protected 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 protected method is meant to be called by the derived class to add the specified notifications. More...
 

Protected Member Functions

 AbstractChapter ()
 Constructs a new chapter. More...
 
virtual void internalParse ()=0
 Internally called to parse the chapter. More...
 
- Protected Member Functions inherited from Media::StatusProvider
 StatusProvider ()
 Constructs a new StatusProvider. More...
 

Protected Attributes

uint64 m_id
 
std::vector< LocaleAwareStringm_names
 
ChronoUtilities::TimeSpan m_startTime
 
ChronoUtilities::TimeSpan m_endTime
 
std::vector< uint64 > m_tracks
 
bool m_hidden
 
bool m_enabled
 

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 AbstractChapter class parses chapter information.

Definition at line 14 of file abstractchapter.h.

Constructor & Destructor Documentation

◆ ~AbstractChapter()

Media::AbstractChapter::~AbstractChapter ( )
virtual

Destroys the chapter.

Definition at line 29 of file abstractchapter.cpp.

◆ AbstractChapter()

Media::AbstractChapter::AbstractChapter ( )
protected

Constructs a new chapter.

Definition at line 18 of file abstractchapter.cpp.

Member Function Documentation

◆ clear()

void Media::AbstractChapter::clear ( )
virtual

Resets the object to its initial state.

Reimplemented in Media::MatroskaChapter.

Definition at line 51 of file abstractchapter.cpp.

◆ endTime()

ChronoUtilities::TimeSpan Media::AbstractChapter::endTime ( ) const
inline

Returns the end time if known; otherwise returns a negative time span.

Definition at line 74 of file abstractchapter.h.

◆ id()

uint64 Media::AbstractChapter::id ( ) const
inline

Returns the chapter ID if known; otherwise returns zero.

Definition at line 50 of file abstractchapter.h.

◆ internalParse()

Media::AbstractChapter::internalParse ( )
protectedpure virtual

Internally called to parse the chapter.

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.

Implemented in Media::MatroskaChapter.

◆ isEnabled()

bool Media::AbstractChapter::isEnabled ( ) const
inline

Returns whether the chapter is flagged as enabled.

Definition at line 98 of file abstractchapter.h.

◆ isHidden()

bool Media::AbstractChapter::isHidden ( ) const
inline

Returns whether the chapter is flagged as hidden.

Definition at line 90 of file abstractchapter.h.

◆ label()

string Media::AbstractChapter::label ( ) const

Returns a label for the chapter.

Definition at line 35 of file abstractchapter.cpp.

◆ names()

const std::vector< LocaleAwareString > & Media::AbstractChapter::names ( ) const
inline

Returns the chapter name.

Definition at line 58 of file abstractchapter.h.

◆ nestedChapter() [1/2]

AbstractChapter * Media::AbstractChapter::nestedChapter ( std::size_t  index)
inlinevirtual

Returns the nested chapter with the specified index.

Reimplemented in Media::MatroskaChapter.

Definition at line 106 of file abstractchapter.h.

◆ nestedChapter() [2/2]

const AbstractChapter * Media::AbstractChapter::nestedChapter ( std::size_t  index) const
inlinevirtual

Returns the nested chapter with the specified index.

Reimplemented in Media::MatroskaChapter.

Definition at line 114 of file abstractchapter.h.

◆ nestedChapterCount()

std::size_t Media::AbstractChapter::nestedChapterCount ( ) const
inlinevirtual

Returns the number of nested chapters.

Reimplemented in Media::MatroskaChapter.

Definition at line 122 of file abstractchapter.h.

◆ parse()

void Media::AbstractChapter::parse ( )

Parses the chapter.

Fetches nested chapters but does not parse them.

Clears all previous parsing results.

Definition at line 68 of file abstractchapter.cpp.

◆ parseNested()

void Media::AbstractChapter::parseNested ( )

Parses the chapter and nested chapters recursively.

Clears all previous parsing results.

Definition at line 80 of file abstractchapter.cpp.

◆ startTime()

ChronoUtilities::TimeSpan Media::AbstractChapter::startTime ( ) const
inline

Returns the start time if known; otherwise returns a negative time span.

Definition at line 66 of file abstractchapter.h.

◆ tracks()

const std::vector< uint64 > & Media::AbstractChapter::tracks ( ) const
inline

Returns a list of tracks on which the chapter applies.

Definition at line 82 of file abstractchapter.h.

Member Data Documentation

◆ m_enabled

bool Media::AbstractChapter::m_enabled
protected

Definition at line 44 of file abstractchapter.h.

◆ m_endTime

ChronoUtilities::TimeSpan Media::AbstractChapter::m_endTime
protected

Definition at line 41 of file abstractchapter.h.

◆ m_hidden

bool Media::AbstractChapter::m_hidden
protected

Definition at line 43 of file abstractchapter.h.

◆ m_id

uint64 Media::AbstractChapter::m_id
protected

Definition at line 38 of file abstractchapter.h.

◆ m_names

std::vector<LocaleAwareString> Media::AbstractChapter::m_names
protected

Definition at line 39 of file abstractchapter.h.

◆ m_startTime

ChronoUtilities::TimeSpan Media::AbstractChapter::m_startTime
protected

Definition at line 40 of file abstractchapter.h.

◆ m_tracks

std::vector<uint64> Media::AbstractChapter::m_tracks
protected

Definition at line 42 of file abstractchapter.h.


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