MythTV
master
|
Read and write metadata in MPEG (mp3) ID3V2 tags. More...
#include <metaioid3.h>
Public Member Functions | |
MetaIOID3 (void)=default | |
~MetaIOID3 (void) override | |
bool | write (const QString &filename, MusicMetadata *mdata) override |
Writes all metadata back to a file. More... | |
bool | writeVolatileMetadata (const QString &filename, MusicMetadata *mdata) override |
Writes rating and playcount back to a file. More... | |
bool | writeAlbumArt (const QString &filename, const AlbumArtImage *albumart) override |
Write the albumart image to the file. More... | |
bool | removeAlbumArt (const QString &filename, const AlbumArtImage *albumart) override |
Remove the albumart image from the file. More... | |
MusicMetadata * | read (const QString &filename) override |
Reads MusicMetadata from a file. More... | |
AlbumArtList | getAlbumArtList (const QString &filename) override |
Read the albumart images from the file. More... | |
QImage * | getAlbumArt (const QString &filename, ImageType type) override |
Read the albumart image from the file. More... | |
bool | supportsEmbeddedImages (void) override |
Does the tag support embedded cover art. More... | |
bool | changeImageType (const QString &filename, const AlbumArtImage *albumart, ImageType newType) override |
bool | TagExists (const QString &filename) override |
![]() | |
MetaIOTagLib (void)=default | |
~MetaIOTagLib (void) override=default | |
![]() | |
MetaIO (void) | |
virtual | ~MetaIO (void)=default |
void | readFromFilename (const QString &filename, QString &artist, QString &album, QString &title, QString &genre, int &tracknum) |
Reads MusicMetadata based on the folder/filename. More... | |
MusicMetadata * | readFromFilename (const QString &filename, bool blnLength=false) |
Reads MusicMetadata based on the folder/filename. More... | |
void | readFromFilename (MusicMetadata *metadata) |
Reads MusicMetadata based on the folder/filename. More... | |
Private Types | |
enum | TagType { kMPEG, kFLAC } |
Private Member Functions | |
bool | OpenFile (const QString &filename, bool forWriting=false) |
Open the file to read the tag. More... | |
bool | SaveFile () |
void | CloseFile () |
TagLib::ID3v2::Tag * | GetID3v2Tag (bool create=false) |
TagLib::ID3v1::Tag * | GetID3v1Tag (bool create=false) |
Static Private Member Functions | |
static bool | writePlayCount (TagLib::ID3v2::Tag *tag, int playcount) |
static bool | writeRating (TagLib::ID3v2::Tag *tag, int rating) |
static bool | writeLastPlay (TagLib::ID3v2::Tag *tag, QDateTime lastPlay) |
static AlbumArtList | readAlbumArt (TagLib::ID3v2::Tag *tag) |
Read the albumart images from the file. More... | |
static UserTextIdentificationFrame * | find (TagLib::ID3v2::Tag *tag, const String &description) |
Find the a custom comment tag by description. This is a copy of the same function in the TagLib::ID3v2::UserTextIdentificationFrame Class with a static instead of dynamic cast. More... | |
static PopularimeterFrame * | findPOPM (TagLib::ID3v2::Tag *tag, const String &email) |
Find the POPM tag associated with MythTV. More... | |
static AttachedPictureFrame * | findAPIC (TagLib::ID3v2::Tag *tag, AttachedPictureFrame::Type type, const String &description=String()) |
Find an APIC tag by type and optionally description. More... | |
static QString | getExtFromMimeType (const QString &mimeType) |
Private Attributes | |
TagLib::File * | m_file {nullptr} |
TagType | m_fileType {kMPEG} |
Additional Inherited Members | |
![]() | |
static MetaIO * | createTagger (const QString &filename) |
Finds an appropriate tagger for the given file. More... | |
static MusicMetadata * | readMetadata (const QString &filename) |
Read the metadata from filename directly. More... | |
static MusicMetadata * | getMetadata (const QString &filename) |
Get the metadata for filename . More... | |
![]() | |
static const QString | kValidFileExtensions |
![]() | |
std::chrono::milliseconds | getTrackLength (const QString &filename) override |
Find the length of the track (in milliseconds) More... | |
void | ReadGenericMetadata (TagLib::Tag *tag, MusicMetadata *metadata) |
Writes metadata common to all tag formats to the tag. More... | |
![]() | |
void | saveTimeStamps (void) |
void | restoreTimeStamps (void) |
![]() | |
static std::chrono::milliseconds | getTrackLength (TagLib::File *file) |
Find the length of the track (in milliseconds) More... | |
static void | WriteGenericMetadata (TagLib::Tag *tag, const MusicMetadata *metadata) |
Writes metadata common to all tag formats to the tag. More... | |
![]() | |
QString | m_filename |
QString | m_filenameFormat |
Read and write metadata in MPEG (mp3) ID3V2 tags.
Will read ID3v1 but always writes ID3v2.4 compliant tags.
Definition at line 38 of file metaioid3.h.
|
private |
Enumerator | |
---|---|
kMPEG | |
kFLAC |
Definition at line 84 of file metaioid3.h.
|
default |
|
inlineoverride |
Definition at line 42 of file metaioid3.h.
|
overridevirtual |
Writes all metadata back to a file.
filename | The filename to write metadata to |
mdata | A pointer to a MusicMetadata object |
Implements MetaIOTagLib.
Definition at line 153 of file metaioid3.cpp.
Referenced by LameEncoder::~LameEncoder().
|
overridevirtual |
Writes rating and playcount back to a file.
filename | The filename to write metadata to |
mdata | A pointer to a MusicMetadata object |
Reimplemented from MetaIO.
Definition at line 878 of file metaioid3.cpp.
|
overridevirtual |
Write the albumart image to the file.
filename | The music file to add the albumart |
albumart | The Album Art image to write |
Reimplemented from MetaIO.
Definition at line 607 of file metaioid3.cpp.
|
overridevirtual |
Remove the albumart image from the file.
filename | The music file to remove the albumart |
albumart | The Album Art image to remove |
Reimplemented from MetaIO.
Definition at line 680 of file metaioid3.cpp.
|
overridevirtual |
Reads MusicMetadata from a file.
filename | The filename to read metadata from. |
Implements MetaIOTagLib.
Definition at line 229 of file metaioid3.cpp.
|
overridevirtual |
Read the albumart images from the file.
filename | The filename for which we want to find the images. |
Reimplemented from MetaIO.
Definition at line 454 of file metaioid3.cpp.
|
overridevirtual |
Read the albumart image from the file.
filename | The filename for which we want to find the albumart. |
type | The type of image we want - front/back etc |
Reimplemented from MetaIO.
Definition at line 392 of file metaioid3.cpp.
|
inlineoverridevirtual |
Does the tag support embedded cover art.
Reimplemented from MetaIO.
Definition at line 54 of file metaioid3.h.
|
overridevirtual |
Reimplemented from MetaIO.
Definition at line 727 of file metaioid3.cpp.
|
overridevirtual |
Reimplemented from MetaIO.
Definition at line 955 of file metaioid3.cpp.
Open the file to read the tag.
filename | The filename |
forWriting | Need write permission on the file. |
Definition at line 31 of file metaioid3.cpp.
Referenced by changeImageType(), getAlbumArt(), getAlbumArtList(), read(), removeAlbumArt(), TagExists(), write(), writeAlbumArt(), and writeVolatileMetadata().
|
private |
Definition at line 95 of file metaioid3.cpp.
Referenced by changeImageType(), removeAlbumArt(), write(), writeAlbumArt(), and writeVolatileMetadata().
|
private |
Definition at line 107 of file metaioid3.cpp.
Referenced by OpenFile().
Definition at line 116 of file metaioid3.cpp.
Referenced by changeImageType(), getAlbumArt(), getAlbumArtList(), read(), removeAlbumArt(), TagExists(), write(), writeAlbumArt(), and writeVolatileMetadata().
Definition at line 136 of file metaioid3.cpp.
Referenced by read(), and TagExists().
|
staticprivate |
Definition at line 842 of file metaioid3.cpp.
Referenced by write(), and writeVolatileMetadata().
|
staticprivate |
Definition at line 904 of file metaioid3.cpp.
Referenced by write(), and writeVolatileMetadata().
|
staticprivate |
Definition at line 935 of file metaioid3.cpp.
Referenced by write(), and writeVolatileMetadata().
|
staticprivate |
Read the albumart images from the file.
tag | The ID3v2 tag object in which to look for Album Art |
Definition at line 477 of file metaioid3.cpp.
Referenced by getAlbumArtList().
|
staticprivate |
Find the a custom comment tag by description. This is a copy of the same function in the TagLib::ID3v2::UserTextIdentificationFrame Class with a static instead of dynamic cast.
tag | Pointer to TagLib::ID3v2::Tag object |
description | Description of tag to search for |
Definition at line 809 of file metaioid3.cpp.
Referenced by read(), write(), and writeLastPlay().
|
staticprivate |
Find the POPM tag associated with MythTV.
tag | Pointer to TagLib::ID3v2::Tag object |
Email address associated with this POPM frame |
Definition at line 829 of file metaioid3.cpp.
Referenced by read(), writePlayCount(), and writeRating().
|
staticprivate |
Find an APIC tag by type and optionally description.
tag | Pointer to TagLib::ID3v2::Tag object |
type | Type of picture to search for |
description | Description of picture to search for (optional) |
Definition at line 583 of file metaioid3.cpp.
Referenced by changeImageType(), removeAlbumArt(), and writeAlbumArt().
|
staticprivate |
Definition at line 558 of file metaioid3.cpp.
Referenced by readAlbumArt().
|
private |
Definition at line 82 of file metaioid3.h.
Referenced by CloseFile(), GetID3v1Tag(), GetID3v2Tag(), OpenFile(), read(), and SaveFile().
Definition at line 85 of file metaioid3.h.
Referenced by CloseFile(), GetID3v1Tag(), GetID3v2Tag(), and OpenFile().