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

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

#include <matroskacues.h>

Public Member Functions

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

Constructor & Destructor Documentation

◆ MatroskaCuePositionUpdater()

TagParser::MatroskaCuePositionUpdater::MatroskaCuePositionUpdater ( )
inline

Creates a new MatroskaCuePositionUpdater.

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

Definition at line 91 of file matroskacues.h.

Member Function Documentation

◆ clear()

void TagParser::MatroskaCuePositionUpdater::clear ( )
inline

Resets the object to its initial state.

Parsing results and updates are cleared.

Definition at line 109 of file matroskacues.h.

◆ cuesElement()

EbmlElement * TagParser::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 101 of file matroskacues.h.

◆ make()

void TagParser::MatroskaCuePositionUpdater::make ( std::ostream &  stream,
Diagnostics diag 
)

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

Definition at line 244 of file matroskacues.cpp.

◆ parse()

void TagParser::MatroskaCuePositionUpdater::parse ( EbmlElement cuesElement,
Diagnostics diag 
)

Parses the specified cuesElement.

Remarks
Previous parsing results and updates will be cleared.

Definition at line 52 of file matroskacues.cpp.

◆ totalSize()

std::uint64_t TagParser::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 TagParser::MatroskaCuePositionUpdater::updateOffsets ( std::uint64_t  originalOffset,
std::uint64_t  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 172 of file matroskacues.cpp.

◆ updateRelativeOffsets()

bool TagParser::MatroskaCuePositionUpdater::updateRelativeOffsets ( std::uint64_t  referenceOffset,
std::uint64_t  originalRelativeOffset,
std::uint64_t  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 191 of file matroskacues.cpp.


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