|
MythTV master
|
Read and write metadata in MPEG (mp3) ID3V2 tags. More...
#include <libmythmetadata/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 |
Public Member Functions inherited from MetaIOTagLib | |
| MetaIOTagLib (void)=default | |
| ~MetaIOTagLib (void) override=default | |
| bool | write (const QString &filename, MusicMetadata *mdata) override=0 |
| Writes all metadata back to a file. More... | |
| MusicMetadata * | read (const QString &filename) override=0 |
| Reads MusicMetadata from a file. More... | |
Public Member Functions inherited from MetaIO | |
| MetaIO () | |
| virtual | ~MetaIO (void)=default |
| virtual bool | write (const QString &filename, MusicMetadata *mdata)=0 |
| Writes all metadata back to a file. More... | |
| virtual bool | writeVolatileMetadata (const QString &filename, MusicMetadata *mdata) |
| Writes rating and playcount back to a file. More... | |
| virtual MusicMetadata * | read (const QString &filename)=0 |
| Reads MusicMetadata from a file. More... | |
| virtual bool | supportsEmbeddedImages (void) |
| Does the tag support embedded cover art. More... | |
| virtual AlbumArtList | getAlbumArtList (const QString &filename) |
| Reads the list of embedded images in the tag. More... | |
| virtual bool | writeAlbumArt (const QString &filename, const AlbumArtImage *albumart) |
| virtual bool | removeAlbumArt (const QString &filename, const AlbumArtImage *albumart) |
| virtual bool | changeImageType (const QString &filename, const AlbumArtImage *albumart, ImageType newType) |
| virtual QImage * | getAlbumArt (const QString &filename, ImageType type) |
| 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... | |
| virtual bool | TagExists (const QString &filename) |
Private Types | |
| enum | TagType : std::uint8_t { 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 TagLib::ID3v2::UserTextIdentificationFrame * | find (TagLib::ID3v2::Tag *tag, const TagLib::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 TagLib::ID3v2::PopularimeterFrame * | findPOPM (TagLib::ID3v2::Tag *tag, const TagLib::String &email) |
| Find the POPM tag associated with MythTV. More... | |
| static TagLib::ID3v2::AttachedPictureFrame * | findAPIC (TagLib::ID3v2::Tag *tag, TagLib::ID3v2::AttachedPictureFrame::Type type, const TagLib::String &description=TagLib::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 Public Member Functions inherited from MetaIO | |
| 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 Public Attributes inherited from MetaIO | |
| static const QString | kValidFileExtensions |
Protected Member Functions inherited from MetaIOTagLib | |
| 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... | |
Protected Member Functions inherited from MetaIO | |
| void | saveTimeStamps (void) |
| void | restoreTimeStamps (void) |
| virtual std::chrono::milliseconds | getTrackLength (const QString &filename)=0 |
Static Protected Member Functions inherited from MetaIOTagLib | |
| 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... | |
Protected Attributes inherited from MetaIO | |
| 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 33 of file metaioid3.h.
|
private |
| Enumerator | |
|---|---|
| kMPEG | |
| kFLAC | |
Definition at line 79 of file metaioid3.h.
|
default |
|
inlineoverride |
Definition at line 37 of file metaioid3.h.
|
overridevirtual |
Reimplemented from MetaIO.
Definition at line 729 of file metaioid3.cpp.
|
private |
Definition at line 107 of file metaioid3.cpp.
Referenced by OpenFile().
|
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 811 of file metaioid3.cpp.
Referenced by read(), write(), and writeLastPlay().
|
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 585 of file metaioid3.cpp.
Referenced by changeImageType(), removeAlbumArt(), and writeAlbumArt().
|
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 831 of file metaioid3.cpp.
Referenced by read(), writePlayCount(), and writeRating().
|
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 394 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 456 of file metaioid3.cpp.
|
staticprivate |
Definition at line 560 of file metaioid3.cpp.
Referenced by readAlbumArt().
Definition at line 136 of file metaioid3.cpp.
Referenced by read(), and TagExists().
Definition at line 116 of file metaioid3.cpp.
Referenced by changeImageType(), getAlbumArt(), getAlbumArtList(), read(), removeAlbumArt(), TagExists(), write(), writeAlbumArt(), and writeVolatileMetadata().
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().
|
overridevirtual |
Reads MusicMetadata from a file.
| filename | The filename to read metadata from. |
Implements MetaIOTagLib.
Definition at line 231 of file metaioid3.cpp.
|
staticprivate |
Read the albumart images from the file.
| tag | The ID3v2 tag object in which to look for Album Art |
Definition at line 479 of file metaioid3.cpp.
Referenced by getAlbumArtList().
|
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 682 of file metaioid3.cpp.
|
private |
Definition at line 95 of file metaioid3.cpp.
Referenced by changeImageType(), removeAlbumArt(), write(), writeAlbumArt(), and writeVolatileMetadata().
|
inlineoverridevirtual |
Does the tag support embedded cover art.
Reimplemented from MetaIO.
Definition at line 49 of file metaioid3.h.
|
overridevirtual |
Reimplemented from MetaIO.
Definition at line 961 of file metaioid3.cpp.
|
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 |
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 609 of file metaioid3.cpp.
|
staticprivate |
Definition at line 937 of file metaioid3.cpp.
Referenced by write(), and writeVolatileMetadata().
|
staticprivate |
Definition at line 844 of file metaioid3.cpp.
Referenced by write(), and writeVolatileMetadata().
|
staticprivate |
Definition at line 906 of file metaioid3.cpp.
Referenced by write(), and writeVolatileMetadata().
|
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 880 of file metaioid3.cpp.
|
private |
Definition at line 77 of file metaioid3.h.
Referenced by CloseFile(), GetID3v1Tag(), GetID3v2Tag(), OpenFile(), read(), and SaveFile().
Definition at line 80 of file metaioid3.h.
Referenced by CloseFile(), GetID3v1Tag(), GetID3v2Tag(), and OpenFile().