Tag Parser 12.4.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Loading...
Searching...
No Matches
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.
 
EbmlElementcuesElement () const
 Returns the "Cues"-element specified when calling the parse() method.
 
std::uint64_t totalSize () const
 Returns how many bytes will be written when calling the make() method.
 
void parse (EbmlElement *cuesElement, Diagnostics &diag)
 Parses the specified cuesElement.
 
bool updateOffsets (std::uint64_t originalOffset, std::uint64_t newOffset)
 Sets the offset of the entries with the specified originalOffset to newOffset.
 
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.
 
void make (std::ostream &stream, Diagnostics &diag)
 Writes the previously parsed "Cues"-element with updated positions to the specified stream.
 
void clear ()
 Resets the object to its initial state.
 

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.

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 103 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 121 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 113 of file matroskacues.h.

◆ make()

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

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

Definition at line 262 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 54 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 40 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 179 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 205 of file matroskacues.cpp.


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