Tag Parser
6.3.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
|
The Mp4TagField class is used by Mp4Tag to store the fields. More...
#include <mp4tagfield.h>
Public Member Functions | |
Mp4TagField () | |
Constructs a new Mp4TagField. More... | |
Mp4TagField (identifierType id, const TagValue &value) | |
Constructs a new Mp4TagField with the specified id and value. More... | |
Mp4TagField (const std::string &mean, const std::string &name, const TagValue &value) | |
Constructs a new Mp4TagField with the specified mean, name and value. More... | |
void | reparse (Mp4Atom &ilstChild) |
Parses field information from the specified Mp4Atom. More... | |
Mp4TagFieldMaker | prepareMaking () |
Prepares making. More... | |
void | make (std::ostream &stream) |
Saves the field to the specified stream. More... | |
bool | isAdditionalTypeInfoUsed () const |
Returns whether the additional type info is used. More... | |
const std::string & | name () const |
Returns the "name" for "extended" fields. More... | |
void | setName (const std::string &name) |
Sets the "name" for the "extended" field. More... | |
const std::string & | mean () const |
Returns the "mean" for "extended" fields. More... | |
void | setMean (const std::string &mean) |
Sets the "mean" for the "extended" field. More... | |
uint32 | parsedRawDataType () const |
Returns the raw data type which has been determined when parsing. More... | |
uint16 | countryIndicator () const |
Returns the country indicator. More... | |
uint16 | languageIndicator () const |
Returns the language indicator. More... | |
bool | supportsNestedFields () const |
Returns whether nested fields are supported. More... | |
std::vector< uint32 > | expectedRawDataTypes () const |
Returns the expected raw data types for the ID of the field. More... | |
uint32 | appropriateRawDataType () const |
Returns an appropriate raw data type. More... | |
![]() | |
TagField () | |
Constructs an empty TagField. More... | |
TagField (const identifierType &id, const TagValue &value) | |
Constructs a new TagField with the specified id and value. More... | |
~TagField () | |
Destroys the TagField. More... | |
const identifierType & | id () const |
Returns the id of the current TagField. More... | |
std::string | idToString () const |
void | setId (const identifierType &id) |
Sets the id of the current Tag Field. More... | |
void | clearId () |
Clears the id of the current TagField. More... | |
TagValue & | value () |
Returns the value of the current TagField. More... | |
const TagValue & | value () const |
Returns the value of the current TagField. More... | |
void | setValue (const TagValue &value) |
Sets the value of the current TagField. More... | |
void | clearValue () |
Clears the value of the current TagField. More... | |
const typeInfoType & | typeInfo () const |
Returns the type info of the current TagField. More... | |
void | setTypeInfo (const typeInfoType &typeInfo) |
Sets the type info of the current TagField. More... | |
void | removeTypeInfo () |
Removes the type info from the current TagField. More... | |
bool | isTypeInfoAssigned () const |
Returns an indication whether a type info is assigned. More... | |
bool | isDefault () const |
Returns an indication whether the field is labeled as default. More... | |
void | setDefault (bool isDefault) |
Sets whether the field is labeled as default. More... | |
void | clear () |
Clears id, value, type info and sets default flag to false. More... | |
bool | isAdditionalTypeInfoUsed () const |
Returns an indication whether the additional type info is used. More... | |
const std::vector< Mp4TagField > & | nestedFields () const |
Returns the nested fields. More... | |
std::vector< Mp4TagField > & | nestedFields () |
Returns the nested fields. More... | |
bool | supportsNestedFields () const |
Returns whether nested fields are supported by the implementation. More... | |
![]() | |
const NotificationList & | notifications () 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... | |
StatusProvider * | usedProvider () |
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 ¬ification) |
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 ¬ifications) |
This protected method is meant to be called by the derived class to add the specified notifications. More... | |
Static Public Member Functions | |
static identifierType | fieldIdFromString (const char *idString, std::size_t idStringSize=std::string::npos) |
Converts the specified ID string representation to an actual ID. More... | |
static std::string | fieldIdToString (identifierType id) |
Returns the string representation for the specified id. More... | |
Protected Member Functions | |
void | cleared () |
Ensures the field is cleared. More... | |
![]() | |
StatusProvider () | |
Constructs a new StatusProvider. More... | |
Friends | |
class | TagField< Mp4TagField > |
Additional Inherited Members | |
![]() | |
typedef TagFieldTraits< Mp4TagField >::implementationType | implementationType |
typedef TagFieldTraits< Mp4TagField >::identifierType | identifierType |
typedef TagFieldTraits< Mp4TagField >::typeInfoType | typeInfoType |
![]() | |
typedef std::function< void(StatusProvider &sender)> | CallbackFunction |
typedef std::vector< CallbackFunction > | CallbackVector |
typedef std::pair< int, CallbackFunction > | CallbackPair |
The Mp4TagField class is used by Mp4Tag to store the fields.
Definition at line 114 of file mp4tagfield.h.
Media::Mp4TagField::Mp4TagField | ( | ) |
Constructs a new Mp4TagField.
Definition at line 30 of file mp4tagfield.cpp.
Media::Mp4TagField::Mp4TagField | ( | identifierType | id, |
const TagValue & | value | ||
) |
Constructs a new Mp4TagField with the specified id and value.
Definition at line 39 of file mp4tagfield.cpp.
Media::Mp4TagField::Mp4TagField | ( | const std::string & | mean, |
const std::string & | name, | ||
const TagValue & | value | ||
) |
Constructs a new Mp4TagField with the specified mean, name and value.
The ID will be set to Mp4TagAtomIds::Extended indicating an tag field using the reverse DNS style.
Definition at line 55 of file mp4tagfield.cpp.
uint32 Media::Mp4TagField::appropriateRawDataType | ( | ) | const |
Returns an appropriate raw data type.
Returns the type info if assigned; otherwise returns an raw data type considered as appropriate for the ID of the field.
Definition at line 335 of file mp4tagfield.cpp.
|
protected |
Ensures the field is cleared.
Definition at line 391 of file mp4tagfield.cpp.
|
inline |
Returns the country indicator.
Definition at line 204 of file mp4tagfield.h.
std::vector< uint32 > Media::Mp4TagField::expectedRawDataTypes | ( | ) | const |
Returns the expected raw data types for the ID of the field.
Definition at line 287 of file mp4tagfield.cpp.
|
inlinestatic |
Converts the specified ID string representation to an actual ID.
Definition at line 230 of file mp4tagfield.h.
|
inlinestatic |
Returns the string representation for the specified id.
Definition at line 246 of file mp4tagfield.h.
|
inline |
Returns whether the additional type info is used.
Definition at line 156 of file mp4tagfield.h.
|
inline |
Returns the language indicator.
Definition at line 212 of file mp4tagfield.h.
void Media::Mp4TagField::make | ( | std::ostream & | stream | ) |
Saves the field to the specified stream.
Throws | std::ios_base::failure when an IO error occurs. |
Throws | Media::Failure or a derived exception when a making error occurs. |
Definition at line 279 of file mp4tagfield.cpp.
|
inline |
Returns the "mean" for "extended" fields.
Definition at line 180 of file mp4tagfield.h.
|
inline |
Returns the "name" for "extended" fields.
Definition at line 164 of file mp4tagfield.h.
|
inline |
Returns the raw data type which has been determined when parsing.
Definition at line 196 of file mp4tagfield.h.
Mp4TagFieldMaker Media::Mp4TagField::prepareMaking | ( | ) |
Prepares making.
Throws | Media::Failure or a derived exception when a making error occurs. |
This method might be useful when it is necessary to know the size of the field before making it.
Definition at line 267 of file mp4tagfield.cpp.
void Media::Mp4TagField::reparse | ( | Mp4Atom & | ilstChild | ) |
Parses field information from the specified Mp4Atom.
The specified atom should be a child atom of the "ilst" atom. Each child of the "ilst" atom holds one field of the Mp4Tag.
Throws | std::ios_base::failure when an IO error occurs. |
Throws | Media::Failure or a derived exception when a parsing error occurs. |
Definition at line 72 of file mp4tagfield.cpp.
|
inline |
Sets the "mean" for the "extended" field.
Definition at line 188 of file mp4tagfield.h.
|
inline |
Sets the "name" for the "extended" field.
Definition at line 172 of file mp4tagfield.h.
|
inline |
Returns whether nested fields are supported.
Definition at line 220 of file mp4tagfield.h.
|
friend |
Definition at line 116 of file mp4tagfield.h.