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

The MatroskaCuePositionUpdater class helps to rewrite the "Cues"-element with shifted positions. More...

#include <matroskacues.h>

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

Public Member Functions

 MatroskaCuePositionUpdater ()
 Creates a new MatroskaCuePositionUpdater. More...
 
EbmlElementcuesElement () const
 Returns the "Cues"-element specified when calling the parse() method. More...
 
uint64 totalSize () const
 Returns how many bytes will be written when calling the make() method. More...
 
void parse (EbmlElement *cuesElement)
 Parses the specified cuesElement. More...
 
bool updateOffsets (uint64 originalOffset, uint64 newOffset)
 Sets the offset of the entries with the specified originalOffset to newOffset. More...
 
bool updateRelativeOffsets (uint64 referenceOffset, uint64 originalRelativeOffset, uint64 newRelativeOffset)
 Sets the relative offset of the entries with the specified originalRelativeOffset and the specified referenceOffset to newRelativeOffset. More...
 
void make (std::ostream &stream)
 Writes the previously parsed "Cues"-element with updates positions to the specified stream. More...
 
void clear ()
 Resets the object to its initial state. 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...
 

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
 
- Protected Member Functions inherited from Media::StatusProvider
 StatusProvider ()
 Constructs a new StatusProvider. More...
 

Detailed Description

The MatroskaCuePositionUpdater class helps to rewrite the "Cues"-element with shifted positions.

This class is used when rewriting a Matroska file to save changed tag information.

Definition at line 62 of file matroskacues.h.

Constructor & Destructor Documentation

◆ MatroskaCuePositionUpdater()

Media::MatroskaCuePositionUpdater::MatroskaCuePositionUpdater ( )
inline

Creates a new MatroskaCuePositionUpdater.

The parse() method should be called to do further initialization.

Definition at line 90 of file matroskacues.h.

Member Function Documentation

◆ clear()

void Media::MatroskaCuePositionUpdater::clear ( )
inline

Resets the object to its initial state.

Parsing results and updates are cleared.

Definition at line 107 of file matroskacues.h.

◆ cuesElement()

EbmlElement * Media::MatroskaCuePositionUpdater::cuesElement ( ) const
inline

Returns the "Cues"-element specified when calling the parse() method.

Returns nullptr if no "Cues"-element is set.

Definition at line 99 of file matroskacues.h.

◆ make()

void Media::MatroskaCuePositionUpdater::make ( std::ostream &  stream)

Writes the previously parsed "Cues"-element with updates positions to the specified stream.

Definition at line 224 of file matroskacues.cpp.

◆ parse()

void Media::MatroskaCuePositionUpdater::parse ( EbmlElement cuesElement)

Parses the specified cuesElement.

Remarks
Previous parsing results and updates will be cleared.

Definition at line 52 of file matroskacues.cpp.

◆ totalSize()

uint64 Media::MatroskaCuePositionUpdater::totalSize ( ) const

Returns how many bytes will be written when calling the make() method.

Remarks
The returned size might change when the object is altered (eg. by calling the updatePositions() method).

Definition at line 38 of file matroskacues.cpp.

◆ updateOffsets()

bool Media::MatroskaCuePositionUpdater::updateOffsets ( uint64  originalOffset,
uint64  newOffset 
)

Sets the offset of the entries with the specified originalOffset to newOffset.

Returns
Returns whether the size of the "Cues"-element has been altered.

Definition at line 162 of file matroskacues.cpp.

◆ updateRelativeOffsets()

bool Media::MatroskaCuePositionUpdater::updateRelativeOffsets ( uint64  referenceOffset,
uint64  originalRelativeOffset,
uint64  newRelativeOffset 
)

Sets the relative offset of the entries with the specified originalRelativeOffset and the specified referenceOffset to newRelativeOffset.

Returns
Returns whether the size of the "Cues"-element has been altered.

Definition at line 178 of file matroskacues.cpp.


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