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

Specialization of Media::VorbisComment for Vorbis comments inside an OGG stream. More...

#include <oggcontainer.h>

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

Public Member Functions

 OggVorbisComment ()
 Constructs a new OGG Vorbis comment. More...
 
TagType type () const
 Returns the type of the tag as Media::TagType. More...
 
const char * typeName () const
 Returns the type name of the tag as C-style string. More...
 
bool supportsTarget () const
 Returns true; the target is used to specifiy the stream. More...
 
OggParameteroggParams ()
 Returns the OGG parameter for the comment. More...
 
const OggParameteroggParams () const
 Returns the OGG parameter for the comment. More...
 
- Public Member Functions inherited from Media::VorbisComment
 VorbisComment ()
 Constructs a new Vorbis comment. More...
 
TagType type () const
 Returns the type of the tag as Media::TagType. More...
 
const char * typeName () const
 Returns the type name of the tag as C-style string. More...
 
TagTextEncoding proposedTextEncoding () const
 Returns the proposed text encoding. More...
 
bool canEncodingBeUsed (TagTextEncoding encoding) const
 Returns an indication whether the specified encoding can be used to provide string values for the tag. More...
 
const TagValuevalue (KnownField field) const
 Returns the value of the specified field. More...
 
bool setValue (KnownField field, const TagValue &value)
 Assigns the given value to the specified field. More...
 
std::string fieldId (KnownField field) const
 Returns the ID for the specified field. More...
 
KnownField knownField (const std::string &id) const
 
void parse (OggIterator &iterator, VorbisCommentFlags flags=VorbisCommentFlags::None)
 Parses tag information using the specified OGG iterator. More...
 
void parse (std::istream &stream, uint64 maxSize, VorbisCommentFlags flags=VorbisCommentFlags::None)
 Parses tag information using the specified OGG iterator. More...
 
void make (std::ostream &stream, VorbisCommentFlags flags=VorbisCommentFlags::None)
 Writes tag information to the specified stream. More...
 
const TagValuevendor () const
 Returns the vendor. More...
 
void setVendor (const TagValue &vendor)
 Sets the vendor. More...
 
- Public Member Functions inherited from Media::FieldMapBasedTag< VorbisCommentField, CaseInsensitiveStringComparer >
 FieldMapBasedTag ()
 Constructs a new FieldMapBasedTag. More...
 
virtual const TagValuevalue (const typename VorbisCommentField ::identifierType &id) const
 Returns the value of the field with the specified id. More...
 
const TagValuevalue (KnownField field) const
 Returns the value of the specified field. More...
 
std::vector< const TagValue *> values (const typename VorbisCommentField ::identifierType &id) const
 Returns the values of the field with the specified id. More...
 
std::vector< const TagValue *> values (KnownField field) const
 Returns the values of the specified field. More...
 
virtual bool setValue (const typename VorbisCommentField ::identifierType &id, const TagValue &value)
 Assigns the given value to the field with the specified id. More...
 
bool setValue (KnownField field, const TagValue &value)
 Assigns the given value to the specified field. More...
 
bool setValues (const typename VorbisCommentField ::identifierType &id, const std::vector< TagValue > &values)
 Assigns the given values to the field with the specified id. More...
 
bool setValues (KnownField field, const std::vector< TagValue > &values)
 Assigns the given values to the field with the specified id. More...
 
bool hasField (KnownField field) const
 Returns an indication whether the specified field is present. More...
 
virtual bool hasField (const typename VorbisCommentField ::identifierType &id) const
 Returns an indication whether the field with the specified id is present. More...
 
void removeAllFields ()
 Removes all fields from the tag. More...
 
const std::multimap< typename VorbisCommentField ::identifierType, VorbisCommentField, CaseInsensitiveStringComparer > & fields () const
 Returns the fields of the tag by providing direct access to the field map of the tag. More...
 
std::multimap< typename VorbisCommentField ::identifierType, VorbisCommentField, CaseInsensitiveStringComparer > & fields ()
 Returns the fields of the tag by providing direct access to the field map of the tag. More...
 
unsigned int fieldCount () const
 Returns the number of present fields. More...
 
virtual KnownField knownField (const typename VorbisCommentField ::identifierType &id) const=0
 Returns the field for the specified ID. More...
 
bool supportsField (KnownField field) const
 Returns an indication whether the specified field is supported by the tag. More...
 
virtual TagDataType proposedDataType (const typename VorbisCommentField ::identifierType &id) const
 Returns the proposed data type for the field with the specified id. More...
 
int insertFields (const FieldMapBasedTag< VorbisCommentField, CaseInsensitiveStringComparer > &from, bool overwrite)
 Inserts all fields from another tag of the same field type and compare function. More...
 
unsigned int insertValues (const Tag &from, bool overwrite)
 Inserts all compatible values from another Tag. More...
 
void ensureTextValuesAreProperlyEncoded ()
 Ensures the encoding of all assigned text values is supported by the tag by converting the character set if neccessary. More...
 
- Public Member Functions inherited from Media::Tag
virtual ~Tag ()
 Destroys the Tag. More...
 
std::string toString () const
 Returns a string representation of the tag. More...
 
const std::string & version () const
 Returns the version of the tag as std::string. More...
 
uint32 size () const
 Returns the size of the tag in bytes. More...
 
const TagTargettarget () const
 Returns the target of tag. More...
 
void setTarget (const TagTarget &target)
 Sets the target of tag. More...
 
virtual TagTargetLevel targetLevel () const
 Returns the name of the current tag target level. More...
 
const char * targetLevelName () const
 Returns the name of the current target level. More...
 
bool isTargetingLevel (TagTargetLevel tagTargetLevel) const
 Returns whether the tag is targeting the specified tagTargetLevel. More...
 
std::string targetString () const
 Returns the string representation for the assigned tag target. More...
 
virtual TagDataType proposedDataType (KnownField field) const
 Returns the proposed data type for the specified field as TagDataType. More...
 
virtual bool supportsDescription (KnownField field) const
 Returns an indications whether the specified field supports descriptions. More...
 
virtual bool supportsMimeType (KnownField field) const
 Returns an indications whether the specified field supports mime types. 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 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 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 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 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 method is meant to be called by the derived class to add the specified notifications. More...
 

Friends

class OggContainer
 

Additional Inherited Members

- Public Types inherited from Media::FieldMapBasedTag< VorbisCommentField, CaseInsensitiveStringComparer >
typedef VorbisCommentField fieldType
 
- Public Types inherited from Media::StatusProvider
typedef std::function< void(StatusProvider &sender)> CallbackFunction
 
typedef std::vector< CallbackFunctionCallbackVector
 
typedef std::pair< int, CallbackFunctionCallbackPair
 
- Static Public Attributes inherited from Media::VorbisComment
static constexpr TagType tagType = TagType::VorbisComment
 
- Protected Member Functions inherited from Media::Tag
 Tag ()
 Constructs a new Tag. More...
 
- Protected Member Functions inherited from Media::StatusProvider
 StatusProvider ()
 Constructs a new StatusProvider. More...
 
- Protected Attributes inherited from Media::Tag
std::string m_version
 
uint32 m_size
 
TagTarget m_target
 

Detailed Description

Specialization of Media::VorbisComment for Vorbis comments inside an OGG stream.

Definition at line 68 of file oggcontainer.h.

Constructor & Destructor Documentation

◆ OggVorbisComment()

Media::OggVorbisComment::OggVorbisComment ( )
inline

Constructs a new OGG Vorbis comment.

Definition at line 88 of file oggcontainer.h.

Member Function Documentation

◆ oggParams() [1/2]

OggParameter & Media::OggVorbisComment::oggParams ( )
inline

Returns the OGG parameter for the comment.

Consists of first page index, first segment index, last page index, last segment index and tag index (in this order). These values are used and managed by the OggContainer class and do not affect the behavior of the VorbisComment instance.

Definition at line 111 of file oggcontainer.h.

◆ oggParams() [2/2]

const OggParameter & Media::OggVorbisComment::oggParams ( ) const
inline

Returns the OGG parameter for the comment.

Consists of first page index, first segment index, last page index, last segment index and tag index (in this order). These values are used and managed by the OggContainer class and do not affect the behavior of the VorbisComment instance.

Definition at line 122 of file oggcontainer.h.

◆ supportsTarget()

bool Media::OggVorbisComment::supportsTarget ( ) const
inlinevirtual

Returns true; the target is used to specifiy the stream.

See also
OggContainer::createTag(), TagTarget

Reimplemented from Media::Tag.

Definition at line 100 of file oggcontainer.h.

◆ type()

TagType Media::OggVorbisComment::type ( ) const
inlinevirtual

Returns the type of the tag as Media::TagType.

This is TagType::Unspecified by default and might be overwritten when subclassing.

Reimplemented from Media::Tag.

Definition at line 91 of file oggcontainer.h.

◆ typeName()

const char * Media::OggVorbisComment::typeName ( ) const
virtual

Returns the type name of the tag as C-style string.

This is "unspecified" by default and might be overwritten when subclassing.

Reimplemented from Media::Tag.

Definition at line 26 of file oggcontainer.cpp.

Friends And Related Function Documentation

◆ OggContainer

friend class OggContainer
friend

Definition at line 70 of file oggcontainer.h.


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